Giter Club home page Giter Club logo

Comments (4)

aswaterman avatar aswaterman commented on July 25, 2024

lui takes the immediate right-shifted by 12 and unsigned (i.e. 0x0 - 0xfffff), so -4096 would be 0xfffff. I fear that changing this will cause problems. In your proposal, what range of inputs would lui accept?

Seems better to rely on li if you want to use constants like -4096; this is what GCC does.

from riscv-binutils-gdb.

kito-cheng avatar kito-cheng commented on July 25, 2024

Humm, I expect it lui can accept two kind of input, shifted immediate and signed integer.
For shifted immediate, accept 0xfffff000 instead of 0xfffff and output 0xfffff000 in disassembler.
For signed integer, accept all encode-able number.

And for disassembler, naybe we can add both kind of output?

0000000000000000 <x>:
   0:	fffffab7          	lui	s5,0xfffff000 # -4096

from riscv-binutils-gdb.

aswaterman avatar aswaterman commented on July 25, 2024

If we changed it to accept 0xfffff000 instead of 0xfffff, this would make sense, but I really don't want to make a backwards-incompatible change like this. It won't break gcc, but it will break hand-written assembly.

I think in the assembler style guide, we just tell people to use li, not lui. We can make it a requirement that li uses lui if the result is in lui range, so that it is predictable.

from riscv-binutils-gdb.

kito-cheng avatar kito-cheng commented on July 25, 2024

OK, I agree it's will break backwards-compatible, and the let the disassembler output keep the same to prevent inconsistent or any confuse.

from riscv-binutils-gdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.