pub enum Builtin {
Show 18 variants
Carry,
Scarry,
Sborrow,
Nan,
Abs,
Sqrt,
Floor,
Ceil,
Round,
Int2Float,
Float2Float,
Trunc,
Zext,
Sext,
Popcount,
Lzcount,
Cpool,
NewObject,
}Expand description
The built-in SLEIGH functions — a spec may call these without declaring
them, unlike define pcodeop names.
They appear as ExpressionTy::FunctionCall
and every one of them has a direct p-code meaning, so a consumer lowering to
its own IR is expected to implement them rather than treat them as opaque
calls. The two exceptions are noted on their variants.
Variants§
Carry
carry(a, b) — would the unsigned addition a + b carry out of the
top bit? One byte.
Scarry
scarry(a, b) — would the signed addition a + b overflow? One byte.
Sborrow
sborrow(a, b) — would the signed subtraction a - b overflow? One
byte.
Nan
nan(x) — is the floating-point value x a NaN? One byte.
Abs
abs(x) — floating-point absolute value.
Sqrt
sqrt(x) — floating-point square root.
Floor
floor(x) — round towards negative infinity, staying floating-point.
Ceil
ceil(x) — round towards positive infinity, staying floating-point.
Round
round(x) — round to nearest, staying floating-point.
Int2Float
int2float(x) — signed integer to floating-point.
Float2Float
float2float(x) — change floating-point width, preserving the value.
Trunc
trunc(x) — floating-point to signed integer, truncating towards zero.
Zext
zext(x) — widen, filling with zeroes. The result width comes from the
context the call sits in, not from the argument.
Sext
sext(x) — widen, filling with copies of the sign bit.
Popcount
popcount(x) — number of set bits.
Lzcount
lzcount(x) — number of leading zero bits.
Cpool
Constant-pool reference. Has no p-code expansion: a consumer must resolve it against the binary’s constant pool.
NewObject
Object allocation, the companion of Builtin::Cpool in
bytecode-oriented specifications.