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

Missing pseudo instructions for l{b,h,d} #122

Closed
drepekh opened this issue Jun 15, 2021 · 1 comment
Closed

Missing pseudo instructions for l{b,h,d} #122

drepekh opened this issue Jun 15, 2021 · 1 comment

Comments

@drepekh
Copy link

drepekh commented Jun 15, 2021

Seeing that there exists lw t1, %lo(label)(t2) it would make sense to add similar form for instructions l{b,h,d}. Additionally, ld is only available in the form of ld t1, -100(t2), so it would probably make sense to extend it to be consistent with other load instructions.

@TheThirdOne
Copy link
Owner

The current instructions were added because they are very common in GCC-generated assembly.

The relevant code is:

rars/src/PseudoOps.txt

Lines 257 to 262 in 46ab74d

### GCC compatability
lui t1,%hi(label) ;lui RG1,LH4 ;#Load Upper Address : Set t1 to upper 20-bit label's address
addi t1,t2,%lo(label) ;addi RG1,RG2,LL5 ;#Load Lower Address : Set t1 to t2 + lower 12-bit label's address
lw t1,%lo(label)(t2) ;lw RG1,LL4(RG7) ;#Load from Address
flw f1,%lo(label)(t2) ;flw RG1,LL4(RG7) ;#Load from Address
flwd f1,%lo(label)(t2) ;fld RG1,LL4(RG7) ;#Load from Address

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

2 participants