Handbook
Glossary
x86.64
Factor handbook
»
The implementation
»
System interface
»
Processor detection
Prev:
x86.32
Next:
ppc
Vocabulary
system
Definition
IN:
system
SINGLETON:
x86.64
Methods
USING:
cpu.architecture
cpu.x86
cpu.x86.64
cpu.x86.assembler
system
;
M:
x86.64
%begin-callback
param-reg-0
vm-reg
MOV
param-reg-1
0
MOV
"begin_callback"
f
f
%c-invoke
;
USING:
alien
assocs
cpu.architecture
cpu.x86
cpu.x86.64
cpu.x86.assembler
kernel
sequences
system
;
M::
x86.64
%box
( dst src func rep gc-map -- )
0 rep
reg-class-of
cdecl
param-regs
at
nth
src rep
%copy
rep
int-rep?
os
windows?
or
param-reg-1
param-reg-0
?
vm-reg
MOV
func
f
gc-map
%c-invoke
dst
int-rep
%load-return
;
USING:
compiler.codegen.gc-maps
compiler.codegen.relocation
compiler.constants
cpu.architecture
cpu.x86.assembler
cpu.x86.assembler.operands
kernel
system
;
M:
x86.64
%c-invoke
[
R11
0
MOV
rc-absolute-cell
rel-dlsym
R11
CALL
]
dip
gc-map-here
;
USING:
cpu.x86
kernel
system
;
M:
x86.64
%cleanup
0
assert=
;
USING:
cpu.x86
kernel
system
;
M:
x86.64
%discard-reg-param
2drop
;
USING:
cpu.architecture
cpu.x86
cpu.x86.64
cpu.x86.assembler
system
;
M:
x86.64
%end-callback
param-reg-0
vm-reg
MOV
"end_callback"
f
f
%c-invoke
;
USING:
cpu.architecture
cpu.x86.assembler
system
;
M::
x86.64
%gather-int-vector-2
( dst src1 src2 rep -- )
dst rep
%zero-vector
dst src1 0
PINSRQ
dst src2 1
PINSRQ
;
USING:
cpu.architecture
cpu.x86.features
cpu.x86.sse
system
;
M:
x86.64
%gather-int-vector-2-reps
{
{
sse4.1?
{
longlong-2-rep
ulonglong-2-rep
}
}
}
available-reps
;
USING:
cpu.architecture
cpu.x86
system
;
M::
x86.64
%load-reg-param
( vreg rep reg -- )
vreg reg rep
%copy
;
USING:
cpu.architecture
cpu.x86
system
;
M::
x86.64
%load-stack-param
( vreg rep n -- )
rep
return-reg
n
next-stack@
rep
%copy
vreg rep
return-reg
rep
%copy
;
USING:
compiler.codegen.labels
compiler.constants
cpu.architecture
cpu.x86
cpu.x86.assembler.operands
system
;
M::
x86.64
%load-vector
( dst val rep -- )
dst 0
[RIP+]
rep
copy-memory*
val
rc-relative
rel-binary-literal
;
USING:
compiler.constants
cpu.x86
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
kernel
system
;
M:
x86.64
%mark-card
dup
load-cards-offset
[+]
card-mark
<byte>
MOV
;
USING:
compiler.constants
cpu.x86
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
kernel
system
;
M:
x86.64
%mark-deck
dup
load-decks-offset
[+]
card-mark
<byte>
MOV
;
USING:
cpu.x86
cpu.x86.assembler
cpu.x86.assembler.operands
system
;
M:
x86.64
%prepare-jump
pic-tail-reg
xt-tail-pic-offset
[RIP+]
LEA
;
USING:
cpu.architecture
cpu.x86
cpu.x86.assembler
cpu.x86.assembler.operands
kernel
math
math.order
sequences
system
;
M:
x86.64
%prepare-var-args
[
second
reg-class-of
float-regs?
]
count
8
min
[
EAX
EAX
XOR
]
[
<byte>
AL
swap
MOV
]
if-zero
;
USING:
compiler.codegen.relocation
compiler.constants
cpu.architecture
cpu.x86.assembler
cpu.x86.assembler.operands
system
;
M:
x86.64
%safepoint
0
[RIP+]
EAX
MOV
rc-relative
rel-safepoint
;
USING:
combinators
cpu.architecture
cpu.x86.assembler
cpu.x86.sse
system
;
M:
x86.64
%scalar>integer
{
{
longlong-scalar-rep
[
MOVD
]
}
{
ulonglong-scalar-rep
[
MOVD
]
}
[
%scalar>integer-32
]
}
case
;
USING:
combinators
cpu.architecture
cpu.x86.assembler
cpu.x86.sse
system
;
M:
x86.64
%select-vector
{
{
longlong-2-rep
[
PEXTRQ
]
}
{
ulonglong-2-rep
[
PEXTRQ
]
}
[
%select-vector-32
]
}
case
;
USING:
cpu.architecture
cpu.x86.features
cpu.x86.sse
system
;
M:
x86.64
%select-vector-reps
{
{
sse4.1?
{
uchar-16-rep
char-16-rep
ushort-8-rep
short-8-rep
uint-4-rep
int-4-rep
ulonglong-2-rep
longlong-2-rep
}
}
}
available-reps
;
USING:
cpu.architecture
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
kernel
system
;
M:
x86.64
%set-vm-field
[
vm-reg
]
dip
[+]
swap
MOV
;
USING:
cpu.architecture
cpu.x86
system
;
M::
x86.64
%store-reg-param
( vreg rep reg -- )
reg vreg rep
%copy
;
USING:
cpu.architecture
cpu.x86
math
system
;
M::
x86.64
%store-stack-param
( vreg rep n -- )
rep
return-reg
vreg rep
%copy
n
reserved-stack-space
+
stack@
rep
return-reg
rep
%copy
;
USING:
cpu.architecture
cpu.x86
cpu.x86.64
cpu.x86.assembler
system
;
M::
x86.64
%unbox
( dst src func rep -- )
param-reg-0
src
tagged-rep
%copy
param-reg-1
vm-reg
MOV
func
f
f
%c-invoke
dst rep
%load-return
;
USING:
cpu.architecture
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
kernel
system
;
M:
x86.64
%vm-field
[
vm-reg
]
dip
[+]
MOV
;
USING:
cpu.x86
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
kernel
system
;
M:
x86.64
%vm-field-ptr
[
vm-reg
]
dip
[+]
LEA
;
USING:
alien
alien.c-types
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
cpu.x86.features
system
;
M:
x86.64
(cpuid)
void
{
uint
uint
void*
}
cdecl
[
RAX
param-reg-0
MOV
RCX
param-reg-1
MOV
RSI
param-reg-2
MOV
CPUID
RSI
[]
EAX
MOV
RSI
4
[+]
EBX
MOV
RSI
8
[+]
ECX
MOV
RSI
12
[+]
EDX
MOV
]
alien-assembly
;
USING:
cpu.x86
cpu.x86.assembler.operands
system
;
M:
x86.64
ds-reg
R14
;
USING:
cpu.architecture
system
;
M:
x86.64
dummy-fp-params?
f
;
USING:
cpu.architecture
system
;
M:
x86.64
dummy-int-params?
f
;
USING:
cpu.architecture
system
;
M:
x86.64
dummy-stack-params?
f
;
USING:
alien.c-types
arrays
compiler.cfg.builder.alien.boxing
cpu.x86.64.unix
generic
kernel
math
sequences
system
;
M:
x86.64
flatten-struct-type
dup
heap-size
16
<=
[
flatten-small-struct
record-reg-reps
]
[
M\
x86.64
flatten-struct-type
(call-next-method)
unrecord-reg-reps
[
first
t
f
3array
]
map
]
if
;
USING:
cpu.architecture
cpu.x86.assembler.operands
system
;
M:
x86.64
frame-reg
RBP
;
USING:
alien
alien.c-types
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
math.floats.env.x86
system
;
M:
x86.64
get-sse-env
void
{
void*
}
cdecl
[
param-reg-0
[]
STMXCSR
]
alien-assembly
;
USING:
alien
alien.c-types
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
math.floats.env.x86
system
;
M:
x86.64
get-x87-env
void
{
void*
}
cdecl
[
param-reg-0
[]
FNSTSW
param-reg-0
2
[+]
FNSTCW
]
alien-assembly
;
USING:
cpu.x86
kernel
system
;
M:
x86.64
has-small-reg?
2drop
t
;
USING:
alien
alien.c-types
cpu.x86.assembler
cpu.x86.assembler.operands
cpu.x86.features
system
;
M:
x86.64
instruction-count
longlong
{
}
cdecl
[
RAX
0
MOV
RDTSC
RDX
32
SHL
RAX
RDX
OR
]
alien-assembly
;
USING:
cpu.architecture
system
;
M:
x86.64
long-long-on-stack?
f
;
USING:
cpu.architecture
cpu.x86.assembler.operands
system
;
M:
x86.64
machine-registers
{
{
int-regs
{
RAX
RBX
RCX
RDX
RBP
RSI
RDI
R8
R9
R10
R11
R12
}
}
{
float-regs
{
XMM0
XMM1
XMM2
XMM3
XMM4
XMM5
XMM6
XMM7
XMM8
XMM9
XMM10
XMM11
XMM12
XMM13
XMM14
XMM15
}
}
}
;
USING:
cpu.architecture
cpu.x86.assembler.operands
kernel
system
;
M:
x86.64
param-regs
drop
{
{
int-regs
{
RDI
RSI
RDX
RCX
R8
R9
}
}
{
float-regs
{
XMM0
XMM1
XMM2
XMM3
XMM4
XMM5
XMM6
XMM7
}
}
}
;
USING:
cpu.x86
cpu.x86.assembler.operands
system
;
M:
x86.64
pic-tail-reg
RBX
;
USING:
cpu.x86
system
;
M:
x86.64
reserved-stack-space
0
;
USING:
cpu.architecture
cpu.x86.assembler.operands
system
;
M:
x86.64
return-regs
{
{
int-regs
{
RAX
RDX
}
}
{
float-regs
{
XMM0
XMM1
}
}
}
;
USING:
alien.c-types
cpu.architecture
layouts
math
system
;
M:
x86.64
return-struct-in-registers?
heap-size
2
cells
<=
;
USING:
cpu.x86
cpu.x86.assembler.operands
system
;
M:
x86.64
rs-reg
R15
;
USING:
alien
alien.c-types
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
math.floats.env.x86
system
;
M:
x86.64
set-sse-env
void
{
void*
}
cdecl
[
param-reg-0
[]
LDMXCSR
]
alien-assembly
;
USING:
alien
alien.c-types
cpu.x86.64
cpu.x86.assembler
cpu.x86.assembler.operands
math.floats.env.x86
system
;
M:
x86.64
set-x87-env
void
{
void*
}
cdecl
[
FNCLEX
param-reg-0
2
[+]
FLDCW
]
alien-assembly
;
USING:
cpu.architecture
kernel
system
;
M:
x86.64
stack-cleanup
3drop
0
;
USING:
cpu.x86
cpu.x86.assembler.operands
system
;
M:
x86.64
stack-reg
RSP
;
USING:
cpu.architecture
system
;
M:
x86.64
struct-return-on-stack?
f
;