Handbook
Glossary
load-struct-component ( src offset rep type -- dst )
Vocabulary
compiler
.
cfg
.
builder
.
alien
.
boxing
Inputs
src
an
object
offset
an
object
rep
an
object
type
an
object
Outputs
dst
an
object
Definition
IN:
compiler.cfg.builder.alien.boxing
GENERIC:
load-struct-component
( src offset rep type -- dst )
Methods
USING:
compiler.cfg.builder.alien.boxing
compiler.cfg.hats
kernel
;
M:
object
load-struct-component
^^load-memory-imm
;
USING:
accessors
alien.c-types
compiler.cfg.builder.alien.boxing
compiler.cfg.hats
cpu.architecture
kernel
math
sequences
;
M::
partial-struct-cell
load-struct-component
( src offset rep part -- dst )
part
size>>
<iota>
0
^^load-integer
[|
dst index |
src offset index
+
int-rep
uchar
^^load-memory-imm
index 8
*
^^shl-imm
dst
swap
^^or
]
reduce
;
USING:
accessors
alien.c-types
classes.struct
compiler.cfg.builder.alien.boxing
compiler.cfg.hats
cpu.architecture
kernel
layouts
math
sequences
;
M::
struct-bit-slot-spec
load-struct-component
( src offset rep field -- dst )
field
offset>>
8
mod
:>
start field
bits>>
:>
bits start bits
+
8
align
8
/i
<iota>
0
^^load-integer
[|
dst index |
src offset index
+
int-rep
uchar
^^load-memory-imm
:>
byte index 8
*
start
-
:>
shift byte shift 0
<
[
shift
neg
^^shr-imm
]
[
shift
^^shl-imm
]
if
dst
swap
^^or
]
reduce
bits
cell-bits
<
[
cell-bits
bits
-
^^shl-imm
cell-bits
bits
-
field
signed?>>
[
^^sar-imm
]
[
^^shr-imm
]
if
]
when
;