Add Instructions for PIC Support #15
Labels
No labels
I-bug
I-enhancement
S-bug
S-proposal
bikeshedding
help-wanted
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AbleOS/holey-bytes#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add the following instructions to the ISA, to support generation of PIC and PIE code. In all instructions
PC
is computed from the byte immediately following the last byte of the instruction| Instruction Name | Mode | Effects |
|==================|======|========================|
| LRA | BBD |
#1 <- #2 + imm #3 + PC
|| LDR | BBDH |
#0 <- imm #4 [#2 + imm #3 + PC]
|| STR | BBDH |
imm #4 [#2 + imm #3 + PC]
|| JMPR | D | Jumps tp
#1 + PC
|| JALR | BBD |
#0 <- PC
Jumps to#1 + imm #2 + PC
|| JEQR | BBD | If
#0 == #1
Jumps toimm #2 + PC
|| JNER | BBD | If
#0 != #1
Jumps toimm #2 + PC
|| JLTR | BBD | If
#0 < #1
(signed) Jumps toimm #2 + PC
|| JGTR | BBD | If
#0 > #1
(signed) Jumps toimm #2 + PC
|| JLTUR | BBD | If
#0 < #1
(unsigned) Jumps toimm #2 + PC
|| JGTUR | BBD | If
#0 > #1
(unsigned) Jumps toimm #2 + PC
|Also add relaxed 8-bit and 32-bit version replacing the D operand with B or W respectively, for more compact codegen in common cases. Suggested mnemonics:
_8
(IE.LRA8
) and_32
(IE.LRA32
)