Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the GAS oddity for compatability with gcc -S output. #2

Open
pharaun opened this issue Jan 9, 2018 · 0 comments
Open

Handle the GAS oddity for compatability with gcc -S output. #2

pharaun opened this issue Jan 9, 2018 · 0 comments

Comments

@pharaun
Copy link
Owner

pharaun commented Jan 9, 2018

Basically these are the following oddity that I've noticed in GAS so far. (The description might not be 100% accurate)

  • LUI takes the lower 20 bits, not the upper 20 bit, and uses %LOW and %HI() to shift the bits (HI = high 20bit shifted over 12) (low = grabbing the low 12 bits)
  • Ordering in sw in GAS is swapped
  • GAS syntax such as:
//      - add x0, x1, x3
//      - lw x0, 0x0(x3)
//      - sw x0, 0x0(x3)
//      - csr{rw, rs, rc} a0, cycle, x0
//      - csr{rw, rs, rc}i a1, sscratch, 1

Look into if I want to have 1:1 compat with GAS in the parser/assembler and have a flag to enable/disable the compat, or if it would be better to just provide a transpiler of sorts that can take the GAS syntax outputted by gcc -S and reformat it into a format that my assembler can take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant