Warning: This is the manual of the legacy Guile 2.2 series. You may want to read the manual of the current stable series instead.
Next: Unboxed Floating-Point Arithmetic, Previous: Inlined Bytevector Instructions, Up: Instruction Set [Contents][Index]
Guile supports two kinds of unboxed integers: unsigned 64-bit integers,
and signed 64-bit integers. Guile prefers unsigned integers, in the
sense that Guile’s compiler supports them better and the virtual machine
has more operations that work on them. Still, signed integers are
supported at least to allow bv-s64-ref
and related instructions
to avoid boxing their values.
Unbox the SCM value at src to a unsigned 64-bit integer, placing the result in dst. If the src value is not an exact integer in the unsigned 64-bit range, signal an error.
Box the unsigned 64-bit integer at src to a SCM value and place the result in dst. The result will be a fixnum or a bignum.
Load a 64-bit value formed by joining high-bits and low-bits, and write it to dst.
Like scm->u64
, u64->scm
, and load-u64
, but for
signed 64-bit integers.
Sometimes the compiler can know that we will only need a subset of the bits in an integer. In that case we can sometimes unbox an integer even if it might be out of range.
Take the SCM value in dst and logand
it with (1- (ash
1 64))
. Place the unboxed result in dst.
If the unboxed unsigned 64-bit integer value in a is =
,
<
, or <=
to the unboxed unsigned 64-bit integer value in
b, respectively, add offset to the current instruction
pointer.
If the unboxed unsigned 64-bit integer value in a is =
,
<
, or <=
to the SCM value in b, respectively, add
offset to the current instruction pointer.
Like add
, sub
, and mul
, except taking
the operands as unboxed unsigned 64-bit integers, and producing the
same. The result will be silently truncated to 64 bits.
Like uadd
, usub
, and umul
, except the second
operand is an immediate unsigned 8-bit integer.
Like logand
, logior
, logxor
, and logsub
, but
operating on unboxed unsigned 64-bit integers.
Shift the unboxed unsigned 64-bit integer in a left by b bits, also an unboxed unsigned 64-bit integer. Truncate to 64 bits and write to dst as an unboxed value. Only the lower 6 bits of b are used.
Like ulsh
, but shifting right.
Like ulsh
and ursh
, but encoding b
as an immediate
8-bit unsigned integer.
Next: Unboxed Floating-Point Arithmetic, Previous: Inlined Bytevector Instructions, Up: Instruction Set [Contents][Index]