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_localorfnhead_stack. - To construct a load operand: use
pop,imm,uimm,imml,imml_off,derefl,derefl_off,derefl_uoff,llocor one of the reimportsf32_to_immorf64_to_imm. - To construct a store operand: use
push,discard,storel,storel_off,storel_uofforsloc. - To construct an instruction item: use the function named for the
instruction, except that
modismoduloandreturnisretto avoid colliding with Rust keywords. Branch instructions, for their branch target operand, just take anLrather than aLoadOperand<L>. They have each have a variant named instr_retwhich 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
accelfuncinstruction. - accelparam
- Constructs an item for the
accelparaminstruction. - acos
- Constructs an item for the
acosinstruction. - add
- Constructs an item for the
addinstruction. - align
- Constructs an
Alignitem. - aload
- Constructs an item for the
aloadinstruction. - aloadb
- Constructs an item for the
aloadbinstruction. - aloadbit
- Constructs an item for the
aloadbitinstruction. - aloads
- Constructs an item for the
aloadsinstruction. - asin
- Constructs an item for the
asininstruction. - astore
- Constructs an item for the
astoreinstruction. - astoreb
- Constructs an item for the
astorebinstruction. - astorebit
- Constructs an item for the
astorebitinstruction. - astores
- Constructs an item for the
astoresinstruction. - atan
- Constructs an item for the
ataninstruction. - atan2
- Constructs an item for the
atan2instruction. - binarysearch
- Constructs an item for the
binarysearchinstruction. - bitand
- Constructs an item for the
bitandinstruction. - bitnot
- Constructs an item for the
bitnotinstruction. - bitor
- Constructs an item for the
bitorinstruction. - bitxor
- Constructs an item for the
bitxorinstruction. - blob
- Constructs a
Blobitem. - call
- Constructs an item for the
callinstruction. - callf
- Constructs an item for the
callfinstruction. - callfi
- Constructs an item for the
callfiinstruction. - callfii
- Constructs an item for the
callfiiinstruction. - callfiii
- Constructs an item for the
callfiiiinstruction. - catch
- Constructs an item for the
catchinstruction. - catch_
ret - Constructs an item for the
catchinstruction, with a branch operand that returns 0 or 1 instead of branching - ceil
- Constructs an item for the
ceilinstruction. - compressed_
string - Constructs a
CompressedStringitem. - copy
- Constructs an item for the
copyinstruction. - copyb
- Constructs an item for the
copybinstruction. - copys
- Constructs an item for the
copysinstruction. - cos
- Constructs an item for the
cosinstruction. - dacos
- Constructs an item for the
dacosinstruction. - dadd
- Constructs an item for the
daddinstruction. - dasin
- Constructs an item for the
dasininstruction. - datan
- Constructs an item for the
dataninstruction. - datan2
- Constructs an item for the
datan2instruction. - dceil
- Constructs an item for the
dceilinstruction. - dcos
- Constructs an item for the
dcosinstruction. - ddiv
- Constructs an item for the
ddivinstruction. - debugtrap
- Constructs an item for the
debugtrapinstruction. - decoding_
table - Constructs a
DecodingTableitem. - 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
dexpinstruction. - dfloor
- Constructs an item for the
dfloorinstruction. - discard
- Constructs a store operand which discards the value.
- discardundo
- Constructs an item for the
discardundoinstruction. - div
- Constructs an item for the
divinstruction. - dlog
- Constructs an item for the
dloginstruction. - dmodq
- Constructs an item for the
dmodqinstruction. - dmodr
- Constructs an item for the
dmodrinstruction. - dmul
- Constructs an item for the
dmulinstruction. - dpow
- Constructs an item for the
dpowinstruction. - dsin
- Constructs an item for the
dsininstruction. - dsqrt
- Constructs an item for the
dsqrtinstruction. - dsub
- Constructs an item for the
dsubinstruction. - dtan
- Constructs an item for the
dtaninstruction. - dtof
- Constructs an item for the
dtofinstruction. - dtonumn
- Constructs an item for the
dtonumninstruction. - dtonumz
- Constructs an item for the
dtonumzinstruction. - exp
- Constructs an item for the
expinstruction. - fadd
- Constructs an item for the
faddinstruction. - fdiv
- Constructs an item for the
fdivinstruction. - floor
- Constructs an item for the
floorinstruction. - fmod
- Constructs an item for the
fmodinstruction. - fmul
- Constructs an item for the
fmulinstruction. - fnhead_
local - Constructs a function header item with the
ArgsInLocalscalling convention. - fnhead_
stack - Constructs a function header item with the
ArgsOnStackcalling convention. - fsub
- Constructs an item for the
fsubinstruction. - ftod
- Constructs an item for the
ftodinstruction. - ftonumn
- Constructs an item for the
ftonumninstruction. - ftonumz
- Constructs an item for the
ftonumzinstruction. - gestalt
- Constructs an item for the
gestaltinstruction. - getiosys
- Constructs an item for the
getiosysinstruction. - getmemsize
- Constructs an item for the
getmemsizeinstruction. - getstringtbl
- Constructs an item for the
getstringtblinstruction. - glk
- Constructs an item for the
glkinstruction. - hasundo
- Constructs an item for the
hasundoinstruction. - 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
jdeqinstruction. - jdeq_
ret - Constructs an item for the
jdeqinstruction, with a branch operand that returns 0 or 1 instead of branching - jdge
- Constructs an item for the
jdgeinstruction. - jdge_
ret - Constructs an item for the
jdgeinstruction, with a branch operand that returns 0 or 1 instead of branching - jdgt
- Constructs an item for the
jdgtinstruction. - jdgt_
ret - Constructs an item for the
jdgtinstruction, with a branch operand that returns 0 or 1 instead of branching - jdisinf
- Constructs an item for the
jdisinfinstruction. - jdisinf_
ret - Constructs an item for the
jdisinfinstruction, with a branch operand that returns 0 or 1 instead of branching - jdisnan
- Constructs an item for the
jdisnaninstruction. - jdisnan_
ret - Constructs an item for the
jdisnaninstruction, with a branch operand that returns 0 or 1 instead of branching - jdle
- Constructs an item for the
jdleinstruction. - jdle_
ret - Constructs an item for the
jdleinstruction, with a branch operand that returns 0 or 1 instead of branching - jdlt
- Constructs an item for the
jdltinstruction. - jdlt_
ret - Constructs an item for the
jdltinstruction, with a branch operand that returns 0 or 1 instead of branching - jdne
- Constructs an item for the
jdneinstruction. - jdne_
ret - Constructs an item for the
jdneinstruction, with a branch operand that returns 0 or 1 instead of branching - jeq
- Constructs an item for the
jeqinstruction. - jeq_ret
- Constructs an item for the
jeqinstruction, with a branch operand that returns 0 or 1 instead of branching - jfeq
- Constructs an item for the
jfeqinstruction. - jfeq_
ret - Constructs an item for the
jfeqinstruction, with a branch operand that returns 0 or 1 instead of branching - jfge
- Constructs an item for the
jfgeinstruction. - jfge_
ret - Constructs an item for the
jfgeinstruction, with a branch operand that returns 0 or 1 instead of branching - jfgt
- Constructs an item for the
jfgtinstruction. - jfgt_
ret - Constructs an item for the
jfgtinstruction, with a branch operand that returns 0 or 1 instead of branching - jfle
- Constructs an item for the
jfleinstruction. - jfle_
ret - Constructs an item for the
jfleinstruction, with a branch operand that returns 0 or 1 instead of branching - jflt
- Constructs an item for the
jfltinstruction. - jflt_
ret - Constructs an item for the
jfltinstruction, with a branch operand that returns 0 or 1 instead of branching - jfne
- Constructs an item for the
jfneinstruction. - jfne_
ret - Constructs an item for the
jfneinstruction, with a branch operand that returns 0 or 1 instead of branching - jge
- Constructs an item for the
jgeinstruction. - jge_ret
- Constructs an item for the
jgeinstruction, with a branch operand that returns 0 or 1 instead of branching - jgeu
- Constructs an item for the
jgeuinstruction. - jgeu_
ret - Constructs an item for the
jgeuinstruction, with a branch operand that returns 0 or 1 instead of branching - jgt
- Constructs an item for the
jgtinstruction. - jgt_ret
- Constructs an item for the
jgtinstruction, with a branch operand that returns 0 or 1 instead of branching - jgtu
- Constructs an item for the
jgtuinstruction. - jgtu_
ret - Constructs an item for the
jgtuinstruction, with a branch operand that returns 0 or 1 instead of branching - jisinf
- Constructs an item for the
jisinfinstruction. - jisinf_
ret - Constructs an item for the
jisinfinstruction, with a branch operand that returns 0 or 1 instead of branching - jisnan
- Constructs an item for the
jisnaninstruction. - jisnan_
ret - Constructs an item for the
jisnaninstruction, with a branch operand that returns 0 or 1 instead of branching - jle
- Constructs an item for the
jleinstruction. - jle_ret
- Constructs an item for the
jleinstruction, with a branch operand that returns 0 or 1 instead of branching - jleu
- Constructs an item for the
jleuinstruction. - jleu_
ret - Constructs an item for the
jleuinstruction, with a branch operand that returns 0 or 1 instead of branching - jlt
- Constructs an item for the
jltinstruction. - jlt_ret
- Constructs an item for the
jltinstruction, with a branch operand that returns 0 or 1 instead of branching - jltu
- Constructs an item for the
jltuinstruction. - jltu_
ret - Constructs an item for the
jltuinstruction, with a branch operand that returns 0 or 1 instead of branching - jne
- Constructs an item for the
jneinstruction. - jne_ret
- Constructs an item for the
jneinstruction, with a branch operand that returns 0 or 1 instead of branching - jnz
- Constructs an item for the
jnzinstruction. - jnz_ret
- Constructs an item for the
jnzinstruction, with a branch operand that returns 0 or 1 instead of branching - jump
- Constructs an item for the
jumpinstruction. - jump_
ret - Constructs an item for the
jumpinstruction, with a branch operand that returns 0 or 1 instead of branching - jumpabs
- Constructs an item for the
jumpabsinstruction. - jz
- Constructs an item for the
jzinstruction. - jz_ret
- Constructs an item for the
jzinstruction, with a branch operand that returns 0 or 1 instead of branching - label
- Constructs a
Labelitem. - labelref
- Constructs a
LabelRefitem. - labelref_
off - Constructs a
LabelRefitem with an offset. - labelref_
off_ shift - Constructs a
LabelRefitem with an offset and right shift. - labelref_
uoff - Constructs a
LabelRefitem with an unsigned offset. - labelref_
uoff_ shift - Constructs a
LabelRefitem with an unsigned offset and right shift. - linearsearch
- Constructs an item for the
linearsearchinstruction. - linkedsearch
- Constructs an item for the
linkedsearchinstruction. - lloc
- Constructs a load operand which loads from the
n’th local. - log
- Constructs an item for the
loginstruction. - malloc
- Constructs an item for the
mallocinstruction. - mcopy
- Constructs an item for the
mcopyinstruction. - mfree
- Constructs an item for the
mfreeinstruction. - modulo
- Constructs an item for the
modinstruction. - mul
- Constructs an item for the
mulinstruction. - mystery_
string - Constructs a
MysteryStringitem. - mzero
- Constructs an item for the
mzeroinstruction. - neg
- Constructs an item for the
neginstruction. - nop
- Constructs an item for the
nopinstruction. - numtod
- Constructs an item for the
numtodinstruction. - numtof
- Constructs an item for the
numtofinstruction. - pop
- Constructs a load operand that pops from the stack.
- pow
- Constructs an item for the
powinstruction. - protect
- Constructs an item for the
protectinstruction. - push
- Constructs a store operand which pushes to the stack.
- quit
- Constructs an item for the
quitinstruction. - random
- Constructs an item for the
randominstruction. - restart
- Constructs an item for the
restartinstruction. - restore
- Constructs an item for the
restoreinstruction. - restoreundo
- Constructs an item for the
restoreundoinstruction. - ret
- Constructs an item for the
returninstruction. - save
- Constructs an item for the
saveinstruction. - saveundo
- Constructs an item for the
saveundoinstruction. - setiosys
- Constructs an item for the
setiosysinstruction. - setmemsize
- Constructs an item for the
setmemsizeinstruction. - setrandom
- Constructs an item for the
setrandominstruction. - setstringtbl
- Constructs an item for the
setstringtblinstruction. - sexb
- Constructs an item for the
sexbinstruction. - sexs
- Constructs an item for the
sexsinstruction. - shiftl
- Constructs an item for the
shiftlinstruction. - sin
- Constructs an item for the
sininstruction. - sloc
- Constructs a store operand which stores to the
n’th local. - sqrt
- Constructs an item for the
sqrtinstruction. - sshiftr
- Constructs an item for the
sshiftrinstruction. - stkcopy
- Constructs an item for the
stkcopyinstruction. - stkcount
- Constructs an item for the
stkcountinstruction. - stkpeek
- Constructs an item for the
stkpeekinstruction. - stkroll
- Constructs an item for the
stkrollinstruction. - stkswap
- Constructs an item for the
stkswapinstruction. - 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
streamcharinstruction. - streamnum
- Constructs an item for the
streamnuminstruction. - streamstr
- Constructs an item for the
streamstrinstruction. - streamunichar
- Constructs an item for the
streamunicharinstruction. - sub
- Constructs an item for the
subinstruction. - tailcall
- Constructs an item for the
tailcallinstruction. - tan
- Constructs an item for the
taninstruction. - throw
- Constructs an item for the
throwinstruction. - uimm
- Constructs an unsigned immediate load operand.
- ushiftr
- Constructs an item for the
ushiftrinstruction. - utf32_
string - Constructs a
Utf32Stringitem. - verify
- Constructs an item for the
verifyinstruction. - zalign
- Constructs an
Alignzero-item. - zlabel
- Constructs a
Labelzero-item. - zspace
- Constructs a
Spacezero-item.