Skip to content

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

@pharaun

Description

@pharaun

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions