Expand description
Functions for concisely constructing items.
Everything here is just a trivial wrapper around various enum variants, but using it will make your code-generation code much more readable.
- To construct a function header item: use
fnhead_local
orfnhead_stack
. - To construct a load operand: use
pop
,imm
,uimm
,imml
,imml_off
,derefl
,derefl_off
,derefl_uoff
,lloc
or one of the reimportsf32_to_imm
orf64_to_imm
. - To construct a store operand: use
push
,discard
,storel
,storel_off
,storel_uoff
orsloc
. - To construct an instruction item: use the function named for the
instruction, except that
mod
ismodulo
andreturn
isret
to avoid colliding with Rust keywords. Branch instructions, for their branch target operand, just take anL
rather than aLoadOperand<L>
. They have each have a variant named instr_ret
which instead takes a boolean, yielding an instruction which returns a 0 or 1 from the current call frame instead of branching. - To construct a string or blob: use
mystery_string
,utf32_string
,compressed_string
, orblob
. - To contsruct a label: use
label
. - To construct a label reference item: use
labelref
,labelref_off
,labelref_uoff
,labelref_off_shift
, orlabelref_uoff_shift
. - To construct an alignment item: use
align
. - To construct a decoding table item: use
decoding_table
. - To construct a zero-item: use
zlabel
,zspace
,zalign
.
Re-exports§
pub use crate::f32_to_imm;
pub use crate::f64_to_imm;
Functions§
- accelfunc
- Constructs an item for the
accelfunc
instruction. - accelparam
- Constructs an item for the
accelparam
instruction. - acos
- Constructs an item for the
acos
instruction. - add
- Constructs an item for the
add
instruction. - align
- Constructs an
Align
item. - aload
- Constructs an item for the
aload
instruction. - aloadb
- Constructs an item for the
aloadb
instruction. - aloadbit
- Constructs an item for the
aloadbit
instruction. - aloads
- Constructs an item for the
aloads
instruction. - asin
- Constructs an item for the
asin
instruction. - astore
- Constructs an item for the
astore
instruction. - astoreb
- Constructs an item for the
astoreb
instruction. - astorebit
- Constructs an item for the
astorebit
instruction. - astores
- Constructs an item for the
astores
instruction. - atan
- Constructs an item for the
atan
instruction. - atan2
- Constructs an item for the
atan2
instruction. - binarysearch
- Constructs an item for the
binarysearch
instruction. - bitand
- Constructs an item for the
bitand
instruction. - bitnot
- Constructs an item for the
bitnot
instruction. - bitor
- Constructs an item for the
bitor
instruction. - bitxor
- Constructs an item for the
bitxor
instruction. - blob
- Constructs a
Blob
item. - call
- Constructs an item for the
call
instruction. - callf
- Constructs an item for the
callf
instruction. - callfi
- Constructs an item for the
callfi
instruction. - callfii
- Constructs an item for the
callfii
instruction. - callfiii
- Constructs an item for the
callfiii
instruction. - catch
- Constructs an item for the
catch
instruction. - catch_
ret - Constructs an item for the
catch
instruction, with a branch operand that returns 0 or 1 instead of branching - ceil
- Constructs an item for the
ceil
instruction. - compressed_
string - Constructs a
CompressedString
item. - copy
- Constructs an item for the
copy
instruction. - copyb
- Constructs an item for the
copyb
instruction. - copys
- Constructs an item for the
copys
instruction. - cos
- Constructs an item for the
cos
instruction. - dacos
- Constructs an item for the
dacos
instruction. - dadd
- Constructs an item for the
dadd
instruction. - dasin
- Constructs an item for the
dasin
instruction. - datan
- Constructs an item for the
datan
instruction. - datan2
- Constructs an item for the
datan2
instruction. - dceil
- Constructs an item for the
dceil
instruction. - dcos
- Constructs an item for the
dcos
instruction. - ddiv
- Constructs an item for the
ddiv
instruction. - debugtrap
- Constructs an item for the
debugtrap
instruction. - decoding_
table - Constructs a
DecodingTable
item. - derefl
- Constructs a load operand which derefernces a label.
- derefl_
off - Constructs a load operand which derefernces a label and offset.
- derefl_
uoff - Constructs a load operand which derefernces a label and unsigend offset.
- dexp
- Constructs an item for the
dexp
instruction. - dfloor
- Constructs an item for the
dfloor
instruction. - discard
- Constructs a store operand which discards the value.
- discardundo
- Constructs an item for the
discardundo
instruction. - div
- Constructs an item for the
div
instruction. - dlog
- Constructs an item for the
dlog
instruction. - dmodq
- Constructs an item for the
dmodq
instruction. - dmodr
- Constructs an item for the
dmodr
instruction. - dmul
- Constructs an item for the
dmul
instruction. - dpow
- Constructs an item for the
dpow
instruction. - dsin
- Constructs an item for the
dsin
instruction. - dsqrt
- Constructs an item for the
dsqrt
instruction. - dsub
- Constructs an item for the
dsub
instruction. - dtan
- Constructs an item for the
dtan
instruction. - dtof
- Constructs an item for the
dtof
instruction. - dtonumn
- Constructs an item for the
dtonumn
instruction. - dtonumz
- Constructs an item for the
dtonumz
instruction. - exp
- Constructs an item for the
exp
instruction. - fadd
- Constructs an item for the
fadd
instruction. - fdiv
- Constructs an item for the
fdiv
instruction. - floor
- Constructs an item for the
floor
instruction. - fmod
- Constructs an item for the
fmod
instruction. - fmul
- Constructs an item for the
fmul
instruction. - fnhead_
local - Constructs a function header item with the
ArgsInLocals
calling convention. - fnhead_
stack - Constructs a function header item with the
ArgsOnStack
calling convention. - fsub
- Constructs an item for the
fsub
instruction. - ftod
- Constructs an item for the
ftod
instruction. - ftonumn
- Constructs an item for the
ftonumn
instruction. - ftonumz
- Constructs an item for the
ftonumz
instruction. - gestalt
- Constructs an item for the
gestalt
instruction. - getiosys
- Constructs an item for the
getiosys
instruction. - getmemsize
- Constructs an item for the
getmemsize
instruction. - getstringtbl
- Constructs an item for the
getstringtbl
instruction. - glk
- Constructs an item for the
glk
instruction. - hasundo
- Constructs an item for the
hasundo
instruction. - imm
- Constructs an immediate load operand.
- imml
- Constructs an immedate load operand from a label.
- imml_
off - Constructs an immedate load operand from a label and offset.
- imml_
off_ shift - Constructs an immedate load operand from a label, offset, and right-shift.
- imml_
uoff - Constructs an immedate load operand from a label and an unsigned offset.
- imml_
uoff_ shift - Constructs an immedate load operand from a label, unsigned offset, and right-shift.
- jdeq
- Constructs an item for the
jdeq
instruction. - jdeq_
ret - Constructs an item for the
jdeq
instruction, with a branch operand that returns 0 or 1 instead of branching - jdge
- Constructs an item for the
jdge
instruction. - jdge_
ret - Constructs an item for the
jdge
instruction, with a branch operand that returns 0 or 1 instead of branching - jdgt
- Constructs an item for the
jdgt
instruction. - jdgt_
ret - Constructs an item for the
jdgt
instruction, with a branch operand that returns 0 or 1 instead of branching - jdisinf
- Constructs an item for the
jdisinf
instruction. - jdisinf_
ret - Constructs an item for the
jdisinf
instruction, with a branch operand that returns 0 or 1 instead of branching - jdisnan
- Constructs an item for the
jdisnan
instruction. - jdisnan_
ret - Constructs an item for the
jdisnan
instruction, with a branch operand that returns 0 or 1 instead of branching - jdle
- Constructs an item for the
jdle
instruction. - jdle_
ret - Constructs an item for the
jdle
instruction, with a branch operand that returns 0 or 1 instead of branching - jdlt
- Constructs an item for the
jdlt
instruction. - jdlt_
ret - Constructs an item for the
jdlt
instruction, with a branch operand that returns 0 or 1 instead of branching - jdne
- Constructs an item for the
jdne
instruction. - jdne_
ret - Constructs an item for the
jdne
instruction, with a branch operand that returns 0 or 1 instead of branching - jeq
- Constructs an item for the
jeq
instruction. - jeq_ret
- Constructs an item for the
jeq
instruction, with a branch operand that returns 0 or 1 instead of branching - jfeq
- Constructs an item for the
jfeq
instruction. - jfeq_
ret - Constructs an item for the
jfeq
instruction, with a branch operand that returns 0 or 1 instead of branching - jfge
- Constructs an item for the
jfge
instruction. - jfge_
ret - Constructs an item for the
jfge
instruction, with a branch operand that returns 0 or 1 instead of branching - jfgt
- Constructs an item for the
jfgt
instruction. - jfgt_
ret - Constructs an item for the
jfgt
instruction, with a branch operand that returns 0 or 1 instead of branching - jfle
- Constructs an item for the
jfle
instruction. - jfle_
ret - Constructs an item for the
jfle
instruction, with a branch operand that returns 0 or 1 instead of branching - jflt
- Constructs an item for the
jflt
instruction. - jflt_
ret - Constructs an item for the
jflt
instruction, with a branch operand that returns 0 or 1 instead of branching - jfne
- Constructs an item for the
jfne
instruction. - jfne_
ret - Constructs an item for the
jfne
instruction, with a branch operand that returns 0 or 1 instead of branching - jge
- Constructs an item for the
jge
instruction. - jge_ret
- Constructs an item for the
jge
instruction, with a branch operand that returns 0 or 1 instead of branching - jgeu
- Constructs an item for the
jgeu
instruction. - jgeu_
ret - Constructs an item for the
jgeu
instruction, with a branch operand that returns 0 or 1 instead of branching - jgt
- Constructs an item for the
jgt
instruction. - jgt_ret
- Constructs an item for the
jgt
instruction, with a branch operand that returns 0 or 1 instead of branching - jgtu
- Constructs an item for the
jgtu
instruction. - jgtu_
ret - Constructs an item for the
jgtu
instruction, with a branch operand that returns 0 or 1 instead of branching - jisinf
- Constructs an item for the
jisinf
instruction. - jisinf_
ret - Constructs an item for the
jisinf
instruction, with a branch operand that returns 0 or 1 instead of branching - jisnan
- Constructs an item for the
jisnan
instruction. - jisnan_
ret - Constructs an item for the
jisnan
instruction, with a branch operand that returns 0 or 1 instead of branching - jle
- Constructs an item for the
jle
instruction. - jle_ret
- Constructs an item for the
jle
instruction, with a branch operand that returns 0 or 1 instead of branching - jleu
- Constructs an item for the
jleu
instruction. - jleu_
ret - Constructs an item for the
jleu
instruction, with a branch operand that returns 0 or 1 instead of branching - jlt
- Constructs an item for the
jlt
instruction. - jlt_ret
- Constructs an item for the
jlt
instruction, with a branch operand that returns 0 or 1 instead of branching - jltu
- Constructs an item for the
jltu
instruction. - jltu_
ret - Constructs an item for the
jltu
instruction, with a branch operand that returns 0 or 1 instead of branching - jne
- Constructs an item for the
jne
instruction. - jne_ret
- Constructs an item for the
jne
instruction, with a branch operand that returns 0 or 1 instead of branching - jnz
- Constructs an item for the
jnz
instruction. - jnz_ret
- Constructs an item for the
jnz
instruction, with a branch operand that returns 0 or 1 instead of branching - jump
- Constructs an item for the
jump
instruction. - jump_
ret - Constructs an item for the
jump
instruction, with a branch operand that returns 0 or 1 instead of branching - jumpabs
- Constructs an item for the
jumpabs
instruction. - jz
- Constructs an item for the
jz
instruction. - jz_ret
- Constructs an item for the
jz
instruction, with a branch operand that returns 0 or 1 instead of branching - label
- Constructs a
Label
item. - labelref
- Constructs a
LabelRef
item. - labelref_
off - Constructs a
LabelRef
item with an offset. - labelref_
off_ shift - Constructs a
LabelRef
item with an offset and right shift. - labelref_
uoff - Constructs a
LabelRef
item with an unsigned offset. - labelref_
uoff_ shift - Constructs a
LabelRef
item with an unsigned offset and right shift. - linearsearch
- Constructs an item for the
linearsearch
instruction. - linkedsearch
- Constructs an item for the
linkedsearch
instruction. - lloc
- Constructs a load operand which loads from the
n
’th local. - log
- Constructs an item for the
log
instruction. - malloc
- Constructs an item for the
malloc
instruction. - mcopy
- Constructs an item for the
mcopy
instruction. - mfree
- Constructs an item for the
mfree
instruction. - modulo
- Constructs an item for the
mod
instruction. - mul
- Constructs an item for the
mul
instruction. - mystery_
string - Constructs a
MysteryString
item. - mzero
- Constructs an item for the
mzero
instruction. - neg
- Constructs an item for the
neg
instruction. - nop
- Constructs an item for the
nop
instruction. - numtod
- Constructs an item for the
numtod
instruction. - numtof
- Constructs an item for the
numtof
instruction. - pop
- Constructs a load operand that pops from the stack.
- pow
- Constructs an item for the
pow
instruction. - protect
- Constructs an item for the
protect
instruction. - push
- Constructs a store operand which pushes to the stack.
- quit
- Constructs an item for the
quit
instruction. - random
- Constructs an item for the
random
instruction. - restart
- Constructs an item for the
restart
instruction. - restore
- Constructs an item for the
restore
instruction. - restoreundo
- Constructs an item for the
restoreundo
instruction. - ret
- Constructs an item for the
return
instruction. - save
- Constructs an item for the
save
instruction. - saveundo
- Constructs an item for the
saveundo
instruction. - setiosys
- Constructs an item for the
setiosys
instruction. - setmemsize
- Constructs an item for the
setmemsize
instruction. - setrandom
- Constructs an item for the
setrandom
instruction. - setstringtbl
- Constructs an item for the
setstringtbl
instruction. - sexb
- Constructs an item for the
sexb
instruction. - sexs
- Constructs an item for the
sexs
instruction. - shiftl
- Constructs an item for the
shiftl
instruction. - sin
- Constructs an item for the
sin
instruction. - sloc
- Constructs a store operand which stores to the
n
’th local. - sqrt
- Constructs an item for the
sqrt
instruction. - sshiftr
- Constructs an item for the
sshiftr
instruction. - stkcopy
- Constructs an item for the
stkcopy
instruction. - stkcount
- Constructs an item for the
stkcount
instruction. - stkpeek
- Constructs an item for the
stkpeek
instruction. - stkroll
- Constructs an item for the
stkroll
instruction. - stkswap
- Constructs an item for the
stkswap
instruction. - storel
- Constructs a store operand which stores to a labeled address.
- storel_
off - Constructs a store operand which stores to a labeled address with offset.
- storel_
uoff - Constructs a store operand which stores to a labeled address with unsigned offset.
- streamchar
- Constructs an item for the
streamchar
instruction. - streamnum
- Constructs an item for the
streamnum
instruction. - streamstr
- Constructs an item for the
streamstr
instruction. - streamunichar
- Constructs an item for the
streamunichar
instruction. - sub
- Constructs an item for the
sub
instruction. - tailcall
- Constructs an item for the
tailcall
instruction. - tan
- Constructs an item for the
tan
instruction. - throw
- Constructs an item for the
throw
instruction. - uimm
- Constructs an unsigned immediate load operand.
- ushiftr
- Constructs an item for the
ushiftr
instruction. - utf32_
string - Constructs a
Utf32String
item. - verify
- Constructs an item for the
verify
instruction. - zalign
- Constructs an
Align
zero-item. - zlabel
- Constructs a
Label
zero-item. - zspace
- Constructs a
Space
zero-item.