Jakob Stoklund Olesen
9e02b9818f
Encode iconst.i32 for RISC-V.
...
For large constants with the low 12 bits clear, we already have the
"lui" encoding. Add "addi %x0" encodings for signed 12-bit constants.
2017-06-22 12:13:37 -07:00
Jakob Stoklund Olesen
9eb0778f9b
Add RISC-V encodings for call_indirect.
2017-06-14 16:14:16 -07:00
Jakob Stoklund Olesen
66af915eed
Add RISC-V encodings for copy instructions.
2017-06-14 15:36:25 -07:00
Jakob Stoklund Olesen
00551dbc5f
Add RISC-V encodings for spill and fill.
...
Add a Stack() class for specifying operand constraints for values on the
stack.
Add encoding recipes for RISC-V spill and fill instructions. Don't
implement the encoding recipe functions yet since we don't have the
stack slot layout yet.
2017-06-13 13:39:52 -07:00
Jakob Stoklund Olesen
832247019b
Remove the return_reg instruction.
...
RISC architectures that take a return address in a register can use a
special-purpose `link` return value to do so.
2017-04-19 16:08:16 -07:00
Jakob Stoklund Olesen
1c890f317d
Add RISC-V call instruction encodings.
...
Calls are jal with a fixed %x1 link register.
2017-04-11 10:40:38 -07:00
Jakob Stoklund Olesen
d2f575b54a
Add jump encodings to RISC-V.
...
Fix a bug in gen_encoding.py when dealing with non-polymorphic
instructions where the type variable is None in Python, VOID in Rust.
2017-04-06 15:17:57 -07:00
Jakob Stoklund Olesen
3a47b40ff8
Add RISC-V encodings for brz and brnz.
...
These branches compare a register to zero. RISC-V implements this with
the %x0 hard-coded zero register.
2017-04-03 15:20:57 -07:00
Jakob Stoklund Olesen
39e102b155
Add conditional branch encodings for RISC-V.
...
Not all br_icmp opcodes are present in the ISA. The missing ones can be
reached by commuting operands.
Don't attempt to encode EBB offsets yet. For now just emit an EBB
relocation for the branch instruction.
2017-04-03 15:16:25 -07:00
Jakob Stoklund Olesen
175b269760
Add RISC-V encodings for lui.
...
This instruction can materialize constants with the low 12 bits clear.
2017-04-03 12:27:22 -07:00
Jakob Stoklund Olesen
c13c318ec4
Add icmp_imm encodings for RISC-V.
...
The ISA has icmp_imm slt/ult with 12-bit signed immediate operands.
2017-04-03 10:59:28 -07:00
Jakob Stoklund Olesen
39fc0eb3cf
Add RISC-V encodings for supported icmp variants.
...
Only slt and ult variants are in the instruction set. Other condition
codes must be synthesized.
2017-03-31 13:47:07 -07:00
Jakob Stoklund Olesen
62334b26b4
Add return_reg encodings for RISC-V.
2017-02-21 16:29:23 -08:00
Jakob Stoklund Olesen
5fa322f797
Split out instruction definitions.
...
- cdsl.instructions defines the Instruction class.
- base.instructions defines the base instruction set.
2016-11-08 12:33:50 -08:00
Jakob Stoklund Olesen
e7f30a40b4
Move the 'meta' dir to 'lib/cretonne/meta'.
...
The 'lib/cretonne' directory will be the new root of a stand-alone
cretonne crate containg both Python and Rust sources.
This is in preparation for publishing crates on crates.io.
2016-10-17 14:19:23 -07:00