Fil-C on Nix

Filnix wiki

the formal campaign

rocq/backend/EmitOps.v

The scalar instruction selection of the stack-homed emission: amd64.pl's compute_op//4 with all it calls, its store_insn/3 and load_insn/3, and filc_amd64.pl's x87 instructions for long double. Every operand is read from its slot below %rbp into %rax, %rcx or %rdx, and the result is left in %rax.

The lines are the Prolog compiler's, in order. Where a Prolog clause fails (a class an operation does not take, a wrong number of arguments) the code holds a todo line, as in Layout.v. The examples at the end are lines the Prolog compiler printed (nanofil --registers=stack asm-terms).

From Stdlib Require Import String ZArith List Bool
From Nanofil Require Import Term Syntax Maps
From Backend Require Import Text Asm Plan PlanTerm Layout
Import ListNotations
Open Scope string_scope
Open Scope Z_scope
Open Scope list_scope

Registers and suffixes

Whether r is a short register of reg_name/3: a, c, d, si, di, r8 or r9.

24Definition short_regr : string : bool ≔
String.eqbr "a" || String.eqbr "c" || String.eqbr "d" || String.eqbr "si" || String.eqbr "di" || String.eqbr "r8" || String.eqbr "r9"

Whether reg_name/3 names the byte and the halfword of the short register r: only of a, c and d.

30Definition narrow_regr : string : bool ≔
String.eqbr "a" || String.eqbr "c" || String.eqbr "d"

The byte of the short register r: al, cl and dl as reg_name/3 has them at b, and x86's names for the others (sil, dil, r8b, r9b), which reg_name/3 lacks.

36Definition reg8r : string : string ≔
→
"al"
→
"cl"
→
"dl"
→
"sil"
→
"dil"
else
r ++ "b"

The halfword of the short register r: ax, cx and dx as reg_name/3 has them at h, and x86's names for the others (si, di, r8w, r9w), which reg_name/3 lacks.

44Definition reg16r : string : string ≔
→
"ax"
→
"cx"
→
"dx"
→
"si"
→
"di"
else
r ++ "w"

As att_suffix/2 at a store width: the suffix of a move of that width. A pointer and an x87 float have none.

51Definition width_suffixw : width : optionstring ≔
match w with
⇒
Some"b"
⇒
Some"w"
Ww | Ws
⇒
Some"l"
Wl | Wd
⇒
Some"q"
Wp | Wx
⇒
None

As reg_name/3 at a store width: the name of the part of the short register r that a store of the width w writes. Only a, c and d have a byte and a halfword there.

63Definition width_regr : string w : width : optionstring ≔
→
None
else
match w with
⇒
else
None
⇒
else
None
Ww | Ws
⇒
Somereg32r
Wl | Wd
⇒
Somereg64r
Wp | Wx
⇒
None

As store_insn/3: the store of the w-sized part of the short register r to (%rax).

75Definition store_insnw : width r : string : listline ≔
match width_suffixw, width_regr w with
Somes, Somern
⇒
ins"mov" s regrn; mem0 "rax"
_, _
⇒
todo"store width"

Extensions and loads

As ext_op/5: the mnemonic and suffix of the move that extends the narrow type t to the class k, and its destination register. An unsigned byte or halfword extends the same way at every class; a word extends only to l.

87Definition ext_opt : narrow k : class : optionstring × string × string ≔
match t, k with
Sb, W
⇒
Some"movsb", "l", "eax"
Sb, L
⇒
Some"movsb", "q", "rax"
Ub, _
⇒
Some"movzb", "l", "eax"
Sh, W
⇒
Some"movsw", "l", "eax"
Sh, L
⇒
Some"movsw", "q", "rax"
Uh, _
⇒
Some"movzw", "l", "eax"
Sw, L
⇒
Some"movsl", "q", "rax"
Uw, L
⇒
Some"mov", "l", "eax"
_, _
⇒
None

As ext_from/2: the part of %rax that the narrow type t extends.

102Definition ext_fromt : narrow : string ≔
match t with
Sb | Ub
⇒
"al"
Sh | Uh
⇒
"ax"
Sw | Uw
⇒
"eax"

As ext_insn/3: the move that extends the low part of %rax that t names into %rax at the class k.

111Definition ext_insnt : narrow k : class : listline ≔
match ext_opt k with
Someop, s, to
⇒
None
⇒
todo"ext class"

As sw_load_op/4: a signed word loads at w with a 32-bit move, and at l as it extends.

119Definition sw_load_opk : class : optionstring × string × string ≔
match k with
⇒
Some"mov", "l", "eax"
_
⇒
None

As load_op/5: as ext_op, for a load of the type t from memory at the class k. An l, s or d loads only at its own class, an unsigned word loads with a 32-bit move at every class, and an x87 float does not load into %rax.

130Definition load_opt : load_type k : class : optionstring × string × string ≔
match t, k with
⇒
Some"mov", "q", "rax"
⇒
Some"mov", "l", "eax"
⇒
Some"mov", "q", "rax"
⇒
Some"mov", "l", "eax"
_, _
⇒
None

As load_insn/3: the load of a value of the type t from (%rax) into %rax, extended to the class k.

146Definition load_insnt : load_type k : class : listline ≔
match load_opt k with
Someop, s, to
⇒
insop s mem0 "rax"; regto
None
⇒
todo"load type"

Integer arithmetic

As alu//4: the x86 two-operand instruction insn at the class k on the two arguments, the first in %rax and the second in %rcx.

157Definition alucx : ctx insn : string k : class args : listvalue : listline ≔
match args, class_halfk with
x; y, Somehalf
⇒
loadcx x k "a" ++ loadcx y k "c" ++ insinsn class_suffixhalf regreg_name"c" half; regreg_name"a" half
_; _, None
⇒
todo"alu class"
_, _
⇒
todo"alu arguments"

As shift//4: the x86 shift insn at the class k of the first argument by the second, a w count in %cl.

168Definition shiftcx : ctx insn : string k : class args : listvalue : listline ≔
match args, class_halfk with
x; y, Somehalf
⇒
loadcx x k "a" ++ loadcx y W "c" ++ insinsn class_suffixhalf reg"cl"; regreg_name"a" half
_; _, None
⇒
todo"shift class"
_, _
⇒
todo"shift arguments"

As zero_divisor//4: a zero divisor c becomes 1 and the dividend a becomes 0, so that quotient and remainder are 0. With e 1 if c is 0 and else 0, in d: c is c + e and a is a and e - 1.

181Definition zero_divisors a c d : string : listline ≔
ins"test" s regc; regc; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" s regd; regc; ins"sub" s imm1; regd; ins"and" s regd; rega

As minus_one_divisor//5: a signed divisor c of -1 becomes 1 and the dividend a its negation, which wraps the least integer to itself where idiv would fault. With e 1 if c is -1 and else 0, in d: c is c + 2e and a is (a xor -e) + e. An unsigned division needs none of it.

194Definition minus_one_divisorsg : signedness s a c d : string : listline ≔
match sg with
⇒
[ ]
⇒
ins"cmp" s imm−1; regc; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" s regd; regc; ins"add" s regd; regc; ins"neg" s regd; ins"xor" s regd; rega; ins"sub" s regd; rega

As sign_extension/2: the instruction that sign-extends %eax or %rax at the class k into %edx or %rdx.

210Definition sign_extensionk : class : optionstring ≔
match k with
⇒
Some"cltd"
⇒
Some"cqto"
_
⇒
None

As divide//4: %rdx:%rax (or %edx:%eax) divided by the register c, the upper half extended from %rax by the signedness sg.

220Definition dividesg : signedness k : class s c : string : listline ≔
match sg with
⇒
match sign_extensionk with
Someextend
⇒
ins0extend [ ]; ins"idiv" s regc
None
⇒
todo"signed division class"
⇒
ins"xor" "l" reg"edx"; reg"edx"; ins"div" s regc

As division_result//3: for a remainder, its move from %rdx to %rax; the quotient is already there.

232Definition division_resultremainder half : bool : listline ≔
remainder
→
ins"mov" class_suffixhalf regreg_name"d" half; regreg_name"a" half
else
[ ]

As division//5: the division at the class k, signed or unsigned by sg, of the first argument by the second, leaving in %rax the remainder if remainder holds and else the quotient. It is total: the operands are first rewritten, without branches, so that the divide cannot fault.

242Definition divisioncx : ctx sg : signedness remainder : bool k : class args : listvalue : listline ≔
match args, class_halfk with
x; y, Somehalf
⇒
let s ≔ class_suffixhalf in
let a ≔ reg_name"a" half in
let c ≔ reg_name"c" half in
let d ≔ reg_name"d" half in
loadcx x k "a" ++ loadcx y k "c" ++ zero_divisors a c d ++ minus_one_divisorsg s a c d ++ dividesg k s c ++ division_resultremainder half
_; _, None
⇒
todo"division class"
_, _
⇒
todo"division arguments"

As cond_code/2: the x86 condition code of the integer comparison c. A float order has none.

259Definition cond_codec : cond : optionstring ≔
match c with
⇒
Some"e"
⇒
Some"ne"
⇒
Some"l"
⇒
Some"le"
⇒
Some"g"
⇒
Some"ge"
⇒
Some"b"
⇒
Some"be"
⇒
Some"a"
⇒
Some"ae"
Le | Lt | Ge | Gt | Ord | Unord
⇒
None

As the cmp(Cond, CmpClass) clause of compute_op//4: 1 in %eax if the two arguments, read at the class ck, compare by the integer condition c, else 0.

277Definition integer_comparecx : ctx c : cond ck : class args : listvalue : listline ≔
match args, class_halfck, cond_codec with
x; y, Somehalf, Somecc
⇒
loadcx x ck "a" ++ loadcx y ck "c" ++ ins"cmp" class_suffixhalf regreg_name"c" half; regreg_name"a" half; ins0"set" ++ cc reg"al"; ins"movzb" "l" reg"al"; reg"eax"
_; _, None, _
⇒
todo"cmp class"
_; _, _, None
⇒
todo"cmp condition"
_, _, _
⇒
todo"cmp arguments"

As the alloc(Align) clause of compute_op//4, which only the plain backend reaches: the size, rounded up to 16 bytes, taken from the stack, the stack pointer aligned further when align is more than 16, and the new stack pointer in %rax.

294Definition stack_alloccx : ctx align : Z args : listvalue : listline ≔
match args with
size
⇒
loadcx size L "a"
++
ins"add" "q" immfifteen; reg"rax"; ins"and" "q" imm−sixteen; reg"rax"; ins"sub" "q" reg"rax"; reg"rsp"
++
align >? sixteen
→
ins"and" "q" imm−align; reg"rsp"
else
[ ]
++
ins"mov" "q" reg"rsp"; reg"rax"
_
⇒
todo"alloc arguments"

SSE2 floats

As float_suffix/2: the suffix of a scalar SSE2 instruction at the float class k, s or d.

310Definition float_suffixk : class : optionstring ≔
match k with
⇒
Some"ss"
⇒
Some"sd"
_
⇒
None

As amd64.pl's float_class/1: whether k is s or d, the float classes SSE2 computes.

319Definition sse_classk : class : bool ≔
match k with
⇒
true
_
⇒
false

As float_bits/2: the integer class as wide as the float class k.

324Definition float_bitsk : class : optionclass ≔
match k with
⇒
SomeW
⇒
SomeL
_
⇒
None

As float_compare/2: the unordered compare at the float class k.

333Definition float_comparek : class : optionstring ≔
match k with
⇒
Some"ucomiss"
⇒
Some"ucomisd"
_
⇒
None

As float_compute/2: whether the op o at the class k is SSE2's: arithmetic at a float class, a comparison of floats, the conversions between s and d, between floats and integers, and a cast.

344Definition float_computeo : op k : class : bool ≔

As float_load//4: the bits of the value v of the float class k into the xmm register x, by way of %rax.

358Definition float_loadcx : ctx v : value k : class x : string : listline ≔
→
loadcx v k "a" ++ to_xmmk "a" x
else
todo"float class"

The mnemonic stem of the SSE2 arithmetic of the op o, which is its own name.

363Definition float_aritho : op : optionstring ≔
match o with
⇒
Some"add"
⇒
Some"sub"
⇒
Some"mul"
⇒
Some"div"
_
⇒
None

As float_condition//1: sets %al to the float comparison c after ucomiss, ucomisd or fucomip compared the operands. eq, ne, lt and le also read the parity flag, so that an unordered compare gives 0, or 1 for ne. Writes %cl.

376Definition float_conditionc : cond : listline ≔
match c with
⇒
ins0"sete" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"
⇒
ins0"setne" reg"al"; ins0"setp" reg"cl"; ins"or" "b" reg"cl"; reg"al"
⇒
ins0"setb" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"
⇒
ins0"setbe" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"
⇒
ins0"seta" reg"al"
⇒
ins0"setae" reg"al"
⇒
ins0"setnp" reg"al"
⇒
ins0"setp" reg"al"
_
⇒
todo"float condition"

As truncate_float//2: the float of the class f in %xmm0, truncated to an integer of the class k in %rax.

391Definition truncate_floatf k : class : listline ≔
match float_suffixf, class_halfk with
Somes, Somehalf
⇒
ins"cvtt" ++ s ++ "2si" class_suffixhalf reg"xmm0"; regreg_name"a" half
_, _
⇒
todo"truncate class"

The sign bit of an s and of a d, and 2^63 as the bits of an s and of a d.

400Definition single_sign: Z ≔
2147483648
401Definition double_sign: Z ≔
9223372036854775808
402Definition single_two63: Z ≔
1593835520
403Definition double_two63: Z ≔
4890909195324358656
404Definition sixty_three: Z ≔
63

As float_integer//4: the float of the class f in %xmm0 to an integer of the class k in %rax, signed or unsigned by sg. An unsigned w is the low half of the signed l. SSE2 has no unsigned l conversion: a float of 2^63 or more has 2^63 subtracted, is converted, and gets bit 63 back.

411Definition float_integercx : ctx sg : signedness f k : class : listline ≔
match sg, k with
⇒
truncate_floatf L ++ ins"mov" "l" reg"eax"; reg"eax"
⇒
Somecmp, Somes
⇒
let bits ≔
in
float_loadcx Constbits f "xmm1" ++ ins0cmp reg"xmm1"; reg"xmm0"; ins0"jb" sym"1f"; ins"sub" s reg"xmm1"; reg"xmm0" ++ truncate_floatf L ++ ins"btc" "q" immsixty_three; reg"rax"; ins0"jmp" sym"2f"; label"1" ++ truncate_floatf L ++ label"2"
_, _
⇒
todo"float class"
⇒
todo"unsigned conversion class"

As convert_integer//2: the integer of the class k in %rax to a float of the class f in %xmm0.

435Definition convert_integerk f : class : listline ≔
match float_suffixf, class_halfk with
Somes, Somehalf
⇒
ins"cvtsi2" ++ s class_suffixhalf regreg_name"a" half; reg"xmm0"
_, _
⇒
todo"convert class"

As integer_float//3: the integer of the class k in %rax, signed or unsigned by sg, to the nearest float of the class f in %xmm0. An unsigned w converts as the l it is. An unsigned l with bit 63 set is halved, keeping its low bit as a sticky bit, converted and doubled, which rounds correctly.

447Definition integer_floatsg : signedness k f : class : listline ≔
match sg, k with
⇒
match float_suffixf with
Somes
⇒
ins"test" "q" reg"rax"; reg"rax"; ins0"jns" sym"1f"; ins"mov" "q" reg"rax"; reg"rcx"; ins"and" "l" imm1; reg"ecx"; ins"shr" "q" imm1; reg"rax"; ins"or" "q" reg"rcx"; reg"rax" ++ convert_integerL f ++ ins"add" s reg"xmm0"; reg"xmm0"; ins0"jmp" sym"2f"; label"1" ++ convert_integerL f ++ label"2"
None
⇒
todo"float class"
⇒
todo"unsigned conversion class"

As float_op//4: the code of the SSE2 op o at the class k on args, its result's bits in %rax.

  • Arithmetic loads its operands into %xmm0 and %xmm1.
  • A negation flips the sign bit in %rax.
  • A comparison, whose class is w, is 1 or 0 by float_condition.
  • ext(s) widens an s to a d and truncd narrows a d to an s.
  • A cast is its operand's bits, read at the class k.
  • A float becomes an integer by float_integer and an integer a float by integer_float.
482Definition float_opcx : ctx o : op k : class args : listvalue : listline ≔
match o, args with
Add | Sub | Mul | Div, x; y
⇒
Someinsn, Somes
⇒
float_loadcx x k "xmm0" ++ float_loadcx y k "xmm1" ++ insinsn s reg"xmm1"; reg"xmm0" ++ from_xmmk "xmm0" "a"
_, _
⇒
todo"float class"
Neg, x
⇒
match float_bitsk with
Someb
⇒
let mask ≔
match k with
in
let half ≔
match k with
⇒
true
_
⇒
false
in
loadcx x k "a" ++ loadcx Constmask b "c" ++ ins"xor" class_suffixhalf regreg_name"c" half; regreg_name"a" half
None
⇒
todo"float class"
Cmpc ck, x; y
⇒
match k, float_compareck with
W, Somecmp
⇒
float_loadcx x ck "xmm0" ++ float_loadcx y ck "xmm1" ++ ins0cmp reg"xmm1"; reg"xmm0" ++ float_conditionc ++ ins"movzb" "l" reg"al"; reg"eax"
_, _
⇒
todo"float cmp class"
⇒
match k with
⇒
float_loadcx x Single "xmm0" ++ ins0"cvtss2sd" reg"xmm0"; reg"xmm0" ++ from_xmmDouble "xmm0" "a"
_
⇒
todo"ext class"
⇒
match k with
⇒
float_loadcx x Double "xmm0" ++ ins0"cvtsd2ss" reg"xmm0"; reg"xmm0" ++ from_xmmSingle "xmm0" "a"
_
⇒
todo"truncd class"
Cast, x
⇒
loadcx x k "a"
FloatToIntf sg, x
⇒
→
float_loadcx x f "xmm0" ++ float_integercx sg f k
else
todo"float op"
IntToFloatik sg, x
⇒
match ik with
W | L
⇒
→
loadcx x ik "a" ++ integer_floatsg ik k ++ from_xmmk "xmm0" "a"
else
todo"float class"
_
⇒
todo"float op"
_, _
⇒
todo"float op"

compute_op

As compute_op//4: the code that computes the op o at the class k on args into %rax, zero-extended for the class w. An SSE2 op (float_compute) is float_op's; the others are the integer clauses, one each. The load(Type) clause has no op here: it is load_insn after the load of the address into %rax.

545Definition compute_opcx : ctx o : op k : class args : listvalue : listline ≔
→
float_opcx o k args
else
match o, args with
Copy, x
⇒
loadcx x k "a"
Neg, x
⇒
match class_halfk with
Somehalf
⇒
loadcx x k "a" ++ ins"neg" class_suffixhalf regreg_name"a" half
None
⇒
todo"neg class"
Add, _
⇒
alucx "add" k args
Sub, _
⇒
alucx "sub" k args
Mul, _
⇒
alucx "imul" k args
And, _
⇒
alucx "and" k args
Or, _
⇒
alucx "or" k args
Xor, _
⇒
alucx "xor" k args
Shl, _
⇒
shiftcx "shl" k args
Shr, _
⇒
shiftcx "shr" k args
Sar, _
⇒
shiftcx "sar" k args
Div, _
⇒
divisioncx Signed false k args
Rem, _
⇒
divisioncx Signed true k args
Udiv, _
⇒
divisioncx Unsigned false k args
Urem, _
⇒
divisioncx Unsigned true k args
Cmpc ck, _
⇒
integer_comparecx c ck args
Extt, x
⇒
loadcx x W "a" ++ ext_insnt k
Allocalign, _
⇒
stack_alloccx align args
_, _
⇒
todo"compute_op"

x87 long double

An x temporary has a 16-byte slot, of which fldt and fstpt use the first 10 bytes. Each instruction pushes its operands on the x87 stack, computes and pops the stack empty again. Scalars and constants go through the red zone below %rsp.

As x87_op/3: whether the op o at the class k is x87's: every op at the class x, a comparison of x values, truncx, xtosi and xtoui. The op's kind, which the Prolog relation also takes, is the op's own.

585Definition x87_opo : op k : class : bool ≔
match k with
⇒
true
_
⇒
match o with
⇒
true
⇒
true
_
⇒
false

The low 64 bits and the low 16 bits of an integer.

598Definition mask64: Z ≔
18446744073709551615
599Definition mask16: Z ≔
65535
600Definition sixty_four: Z ≔
64

As x87_push//2: push the x value v: a temporary from its slot, a constant's 10 bytes through the red zone, by %rdx.

604Definition x87_pushcx : ctx v : value : listline ≔
match v with
⇒
with_slotcx KTmpn λoff ⇒ ins"fld" "t" mem−off "rbp"
⇒
loadcx ConstZ.landn mask64 L "d" ++ ins"mov" "q" reg"rdx"; mem−16 "rsp"; ins"mov" "w" immZ.landZ.shiftrn sixty_four mask16; mem−8 "rsp"; ins"fld" "t" mem−16 "rsp"
⇒
todo"x87 push of a global"

As x87_suffix/3: the suffix of an x87 load or store of the float class k, and of the integer move as wide.

617Definition x87_suffixk : class : optionstring × string ≔
match k with
⇒
Some"s", "l"
⇒
Some"l", "q"
_
⇒
None

As x87_push_float//3: push the value v of the float class f, s or d, widened exactly.

626Definition x87_push_floatcx : ctx f : class v : value : listline ≔
match x87_suffixf with
Somes, _
⇒
loadcx v f "a" ++ ins"mov" "q" reg"rax"; mem−8 "rsp"; ins"fld" s mem−8 "rsp"
None
⇒
todo"x87 ext class"

As x87_pop//2: pop %st into the wide slot of the temporary d.

636Definition x87_popcx : ctx d : name : listline ≔
with_slotcx KTmpd λoff ⇒ ins"fstp" "t" mem−off "rbp"

As x87_fisttp//3: truncate %st toward zero into the temporary d of the class k and pop it.

641Definition x87_fisttpcx : ctx k : class d : name : listline ≔
let half ≔
match k with
⇒
true
_
⇒
false
in
ins"fisttp" "ll" mem−8 "rsp"; ins"mov" class_suffixhalf mem−8 "rsp"; regreg_name"a" half ++ slot_storecx "rax" KTmpd

As x87_int_source//3: the integer operand a of the conversion o in %rax, extended to 64 bits as o reads it.

649Definition x87_int_sourcecx : ctx o : op a : value : listline ≔
match o with
⇒
loadcx a W "a" ++ ins"movsl" "q" reg"eax"; reg"rax"
⇒
loadcx a W "a" ++ ins"mov" "l" reg"eax"; reg"eax"
⇒
loadcx a L "a"
_
⇒
todo"x87 integer source"

2^64 as the bits of an s.

658Definition single_two64: Z ≔
1602224128

As x87_unsigned_fix//1: fildll read an unsigned l with bit 63 set as negative; ultof adds 2^64 to it, exactly.

662Definition x87_unsigned_fixo : op : listline ≔
match o with
⇒
ins"test" "q" reg"rax"; reg"rax"; ins0"jns" sym"1f"; ins"mov" "l" immsingle_two64; mem−12 "rsp"; ins"fadd" "s" mem−12 "rsp"; label"1"
_
⇒
[ ]

The x87 arithmetic of the op o.

674Definition x87_aritho : op : optionstring ≔
match o with
⇒
Some"fadd"
⇒
Some"fsub"
⇒
Some"fmul"
⇒
Some"fdiv"
_
⇒
None

As x87_inst//5: the code of the temporary d as the op o at the class k on args, with x87. Operands are pushed in reverse, so %st is the first and %st(1) the second.

  • Arithmetic, a negation and a copy leave an x in d's slot.
  • A comparison leaves 1 or 0 by float_condition.
  • ext(s) and ext(d) widen to an x; truncx rounds an x to the class k, s or d.
  • xtosi and xtoui truncate an x to an integer; an unsigned l of 2^63 or more has 2^63 subtracted and bit 63 restored.
  • swtof, uwtof, sltof and ultof at x load the integer as 64 bits.
695Definition x87_instcx : ctx o : op k : class args : listvalue d : name : listline ≔
match o, k, args with
Add | Sub | Mul | Div, Extended, a; b
⇒
match x87_aritho with
Someinsn
⇒
x87_pushcx b ++ x87_pushcx a ++ ins0insn reg"st(1)"; reg"st" ++ x87_popcx d ++ ins0"fstp" reg"st(0)"
None
⇒
todo"x87 op"
⇒
x87_pushcx a ++ ins0"fchs" [ ] ++ x87_popcx d
⇒
x87_pushcx a ++ x87_popcx d
Cmpc Extended, W, a; b
⇒
x87_pushcx b ++ x87_pushcx a ++ ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)" ++ float_conditionc ++ ins"movzb" "l" reg"al"; reg"eax" ++ slot_storecx "rax" KTmpd
⇒
x87_push_floatcx f a ++ x87_popcx d
Truncx, _, a
⇒
match x87_suffixk with
Somes, mov
⇒
x87_pushcx a ++ ins"fstp" s mem−8 "rsp"; ins"mov" mov mem−8 "rsp"; regif String.eqbmov "l" then "eax" else "rax" ++ slot_storecx "rax" KTmpd
None
⇒
todo"x87 truncx class"
⇒
x87_pushcx a ++ ins"mov" "l" immsingle_two63; mem−12 "rsp"; ins"fld" "s" mem−12 "rsp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"ja" sym"1f"; ins"fsub" "s" mem−12 "rsp"; ins"fisttp" "ll" mem−8 "rsp"; ins"mov" "q" mem−8 "rsp"; reg"rax"; ins"btc" "q" immsixty_three; reg"rax"; ins0"jmp" sym"2f"; label"1"; ins"fisttp" "ll" mem−8 "rsp"; ins"mov" "q" mem−8 "rsp"; reg"rax"; label"2" ++ slot_storecx "rax" KTmpd
⇒
x87_int_sourcecx o a ++ ins"mov" "q" reg"rax"; mem−8 "rsp"; ins"fild" "ll" mem−8 "rsp" ++ x87_unsigned_fixo ++ x87_popcx d
_, _, _
⇒
todo"x87 op"

Examples

Each states that a definition gives the very lines the Prolog compiler gave. The lines are copied from its output, not from the code above.

The temporary of the name s.

757Definition ex_tmps : string : value ≔

The slots m with the temporary s at -off(%rbp).

760Definition ex_slots : string off : Z m : nmapZ : nmapZ ≔

Whether the lines ls hold a todo.

764Definition ex_todols : listline : bool ≔
existsb
λ l  ⇒
match l with
_
⇒
false
ls

Integer ops

compute_op on the instructions of a function ints, as asm − terms printed them in the stack-homed mode.

772Definition int_cx: ctx ≔
mkCtx"ints" ex_slot"a" 24 ex_slot"b" 8 ex_slot"c" 32 ex_slot"d" 16 nm_empty nm_empty 0 0 nm_empty

let(tmp(t1), w, add, tmp(a), tmp(b))

781Example int_t1: compute_opint_cx Add W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"add" "l" reg"ecx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t2), l, add, tmp(c), tmp(d))

788Example int_t2: compute_opint_cx Add L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"add" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t3), w, sub, tmp(a), tmp(b))

795Example int_t3: compute_opint_cx Sub W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"sub" "l" reg"ecx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t4), l, sub, tmp(c), tmp(d))

802Example int_t4: compute_opint_cx Sub L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"sub" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t5), w, mul, tmp(a), tmp(b))

809Example int_t5: compute_opint_cx Mul W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"imul" "l" reg"ecx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t6), l, mul, tmp(c), tmp(d))

816Example int_t6: compute_opint_cx Mul L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"imul" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t7), w, and, tmp(a), tmp(b))

823Example int_t7: compute_opint_cx And W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"and" "l" reg"ecx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t8), l, and, tmp(c), tmp(d))

830Example int_t8: compute_opint_cx And L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"and" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t9), w, or, tmp(a), tmp(b))

837Example int_t9: compute_opint_cx Or W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"or" "l" reg"ecx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t10), l, or, tmp(c), tmp(d))

844Example int_t10: compute_opint_cx Or L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"or" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t11), w, xor, tmp(a), tmp(b))

851Example int_t11: compute_opint_cx Xor W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"xor" "l" reg"ecx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t12), l, xor, tmp(c), tmp(d))

858Example int_t12: compute_opint_cx Xor L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"xor" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t13), w, shl, tmp(a), tmp(b))

865Example int_t13: compute_opint_cx Shl W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"shl" "l" reg"cl"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t14), l, shl, tmp(c), tmp(b))

872Example int_t14: compute_opint_cx Shl L ex_tmp"c"; ex_tmp"b" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"shl" "q" reg"cl"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t15), w, shr, tmp(a), tmp(b))

879Example int_t15: compute_opint_cx Shr W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"shr" "l" reg"cl"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t16), l, shr, tmp(c), tmp(b))

886Example int_t16: compute_opint_cx Shr L ex_tmp"c"; ex_tmp"b" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"shr" "q" reg"cl"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t17), w, sar, tmp(a), tmp(b))

893Example int_t17: compute_opint_cx Sar W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"sar" "l" reg"cl"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t18), l, sar, tmp(c), tmp(b))

900Example int_t18: compute_opint_cx Sar L ex_tmp"c"; ex_tmp"b" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"sar" "q" reg"cl"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t19), w, div, tmp(a), tmp(b))

907Example int_t19: compute_opint_cx Div W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"test" "l" reg"ecx"; reg"ecx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "l" reg"edx"; reg"ecx"; ins"sub" "l" imm1; reg"edx"; ins"and" "l" reg"edx"; reg"eax"; ins"cmp" "l" imm−1; reg"ecx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "l" reg"edx"; reg"ecx"; ins"add" "l" reg"edx"; reg"ecx"; ins"neg" "l" reg"edx"; ins"xor" "l" reg"edx"; reg"eax"; ins"sub" "l" reg"edx"; reg"eax"; ins0"cltd" [ ]; ins"idiv" "l" reg"ecx"
Proof 1 step Qed
reflexivity

let(tmp(t20), l, div, tmp(c), tmp(d))

921Example int_t20: compute_opint_cx Div L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"test" "q" reg"rcx"; reg"rcx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "q" reg"rdx"; reg"rcx"; ins"sub" "q" imm1; reg"rdx"; ins"and" "q" reg"rdx"; reg"rax"; ins"cmp" "q" imm−1; reg"rcx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "q" reg"rdx"; reg"rcx"; ins"add" "q" reg"rdx"; reg"rcx"; ins"neg" "q" reg"rdx"; ins"xor" "q" reg"rdx"; reg"rax"; ins"sub" "q" reg"rdx"; reg"rax"; ins0"cqto" [ ]; ins"idiv" "q" reg"rcx"
Proof 1 step Qed
reflexivity

let(tmp(t21), w, rem, tmp(a), tmp(b))

935Example int_t21: compute_opint_cx Rem W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"test" "l" reg"ecx"; reg"ecx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "l" reg"edx"; reg"ecx"; ins"sub" "l" imm1; reg"edx"; ins"and" "l" reg"edx"; reg"eax"; ins"cmp" "l" imm−1; reg"ecx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "l" reg"edx"; reg"ecx"; ins"add" "l" reg"edx"; reg"ecx"; ins"neg" "l" reg"edx"; ins"xor" "l" reg"edx"; reg"eax"; ins"sub" "l" reg"edx"; reg"eax"; ins0"cltd" [ ]; ins"idiv" "l" reg"ecx"; ins"mov" "l" reg"edx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t22), l, rem, tmp(c), tmp(d))

949Example int_t22: compute_opint_cx Rem L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"test" "q" reg"rcx"; reg"rcx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "q" reg"rdx"; reg"rcx"; ins"sub" "q" imm1; reg"rdx"; ins"and" "q" reg"rdx"; reg"rax"; ins"cmp" "q" imm−1; reg"rcx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "q" reg"rdx"; reg"rcx"; ins"add" "q" reg"rdx"; reg"rcx"; ins"neg" "q" reg"rdx"; ins"xor" "q" reg"rdx"; reg"rax"; ins"sub" "q" reg"rdx"; reg"rax"; ins0"cqto" [ ]; ins"idiv" "q" reg"rcx"; ins"mov" "q" reg"rdx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t23), w, udiv, tmp(a), tmp(b))

963Example int_t23: compute_opint_cx Udiv W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"test" "l" reg"ecx"; reg"ecx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "l" reg"edx"; reg"ecx"; ins"sub" "l" imm1; reg"edx"; ins"and" "l" reg"edx"; reg"eax"; ins"xor" "l" reg"edx"; reg"edx"; ins"div" "l" reg"ecx"
Proof 1 step Qed
reflexivity

let(tmp(t24), l, udiv, tmp(c), tmp(d))

973Example int_t24: compute_opint_cx Udiv L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"test" "q" reg"rcx"; reg"rcx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "q" reg"rdx"; reg"rcx"; ins"sub" "q" imm1; reg"rdx"; ins"and" "q" reg"rdx"; reg"rax"; ins"xor" "l" reg"edx"; reg"edx"; ins"div" "q" reg"rcx"
Proof 1 step Qed
reflexivity

let(tmp(t25), w, urem, tmp(a), tmp(b))

983Example int_t25: compute_opint_cx Urem W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"test" "l" reg"ecx"; reg"ecx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "l" reg"edx"; reg"ecx"; ins"sub" "l" imm1; reg"edx"; ins"and" "l" reg"edx"; reg"eax"; ins"xor" "l" reg"edx"; reg"edx"; ins"div" "l" reg"ecx"; ins"mov" "l" reg"edx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t26), l, urem, tmp(c), tmp(d))

994Example int_t26: compute_opint_cx Urem L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"mov" "q" mem−16 "rbp"; reg"rcx"; ins"test" "q" reg"rcx"; reg"rcx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "q" reg"rdx"; reg"rcx"; ins"sub" "q" imm1; reg"rdx"; ins"and" "q" reg"rdx"; reg"rax"; ins"xor" "l" reg"edx"; reg"edx"; ins"div" "q" reg"rcx"; ins"mov" "q" reg"rdx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t27), w, neg, tmp(a))

1005Example int_t27: compute_opint_cx Neg W ex_tmp"a" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"neg" "l" reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t28), l, neg, tmp(c))

1011Example int_t28: compute_opint_cx Neg L ex_tmp"c" = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"neg" "q" reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t29), w, copy, tmp(a))

1017Example int_t29: compute_opint_cx Copy W ex_tmp"a" = ins"mov" "l" mem−24 "rbp"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t30), l, copy, tmp(c))

1023Example int_t30: compute_opint_cx Copy L ex_tmp"c" = ins"mov" "q" mem−32 "rbp"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t31), w, add, tmp(a), const(-1))

1029Example int_t31: compute_opint_cx Add W ex_tmp"a"; Const−1 = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" imm4294967295; reg"ecx"; ins"add" "l" reg"ecx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t32), l, add, tmp(c), const(-1))

1036Example int_t32: compute_opint_cx Add L ex_tmp"c"; Const−1 = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"movabs" "q" imm−1; reg"rcx"; ins"add" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t33), l, add, tmp(c), const(9223372036854775807))

1043Example int_t33: compute_opint_cx Add L ex_tmp"c"; Const9223372036854775807 = ins"mov" "q" mem−32 "rbp"; reg"rax"; ins"movabs" "q" imm9223372036854775807; reg"rcx"; ins"add" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

Integer comparisons and extensions

1052Definition cmp_cx: ctx ≔
mkCtx"cmps" ex_slot"a" 32 ex_slot"b" 8 ex_slot"c" 16 ex_slot"d" 24 nm_empty nm_empty 0 0 nm_empty

let(tmp(t1), w, cmp(eq, w), tmp(a), tmp(b))

1061Example cmp_t1: compute_opcmp_cx CmpEq W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"sete" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t2), w, cmp(eq, l), tmp(c), tmp(d))

1069Example cmp_t2: compute_opcmp_cx CmpEq L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"sete" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t3), w, cmp(ne, w), tmp(a), tmp(b))

1077Example cmp_t3: compute_opcmp_cx CmpNe W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"setne" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t4), w, cmp(ne, l), tmp(c), tmp(d))

1085Example cmp_t4: compute_opcmp_cx CmpNe L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"setne" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t5), w, cmp(slt, w), tmp(a), tmp(b))

1093Example cmp_t5: compute_opcmp_cx CmpSlt W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"setl" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t6), w, cmp(slt, l), tmp(c), tmp(d))

1101Example cmp_t6: compute_opcmp_cx CmpSlt L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"setl" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t7), w, cmp(sle, w), tmp(a), tmp(b))

1109Example cmp_t7: compute_opcmp_cx CmpSle W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"setle" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t8), w, cmp(sle, l), tmp(c), tmp(d))

1117Example cmp_t8: compute_opcmp_cx CmpSle L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"setle" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t9), w, cmp(sgt, w), tmp(a), tmp(b))

1125Example cmp_t9: compute_opcmp_cx CmpSgt W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"setg" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t10), w, cmp(sgt, l), tmp(c), tmp(d))

1133Example cmp_t10: compute_opcmp_cx CmpSgt L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"setg" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t11), w, cmp(sge, w), tmp(a), tmp(b))

1141Example cmp_t11: compute_opcmp_cx CmpSge W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"setge" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t12), w, cmp(sge, l), tmp(c), tmp(d))

1149Example cmp_t12: compute_opcmp_cx CmpSge L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"setge" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t13), w, cmp(ult, w), tmp(a), tmp(b))

1157Example cmp_t13: compute_opcmp_cx CmpUlt W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"setb" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t14), w, cmp(ult, l), tmp(c), tmp(d))

1165Example cmp_t14: compute_opcmp_cx CmpUlt L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"setb" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t15), w, cmp(ule, w), tmp(a), tmp(b))

1173Example cmp_t15: compute_opcmp_cx CmpUle W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"setbe" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t16), w, cmp(ule, l), tmp(c), tmp(d))

1181Example cmp_t16: compute_opcmp_cx CmpUle L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"setbe" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t17), w, cmp(ugt, w), tmp(a), tmp(b))

1189Example cmp_t17: compute_opcmp_cx CmpUgt W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"seta" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t18), w, cmp(ugt, l), tmp(c), tmp(d))

1197Example cmp_t18: compute_opcmp_cx CmpUgt L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"seta" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t19), w, cmp(uge, w), tmp(a), tmp(b))

1205Example cmp_t19: compute_opcmp_cx CmpUge W W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"setae" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t20), w, cmp(uge, l), tmp(c), tmp(d))

1213Example cmp_t20: compute_opcmp_cx CmpUge L W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"setae" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t21), l, cmp(eq, w), tmp(a), tmp(b))

1221Example cmp_t21: compute_opcmp_cx CmpEq W L ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"sete" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t22), l, cmp(ult, l), tmp(c), tmp(d))

1229Example cmp_t22: compute_opcmp_cx CmpUlt L L ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" mem−24 "rbp"; reg"rcx"; ins"cmp" "q" reg"rcx"; reg"rax"; ins0"setb" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t23), w, ext(sb), tmp(a))

1237Example cmp_t23: compute_opcmp_cx ExtSb W ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movsb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t24), l, ext(sb), tmp(a))

1243Example cmp_t24: compute_opcmp_cx ExtSb L ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movsb" "q" reg"al"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t25), w, ext(ub), tmp(a))

1249Example cmp_t25: compute_opcmp_cx ExtUb W ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t26), l, ext(ub), tmp(a))

1255Example cmp_t26: compute_opcmp_cx ExtUb L ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t27), w, ext(sh), tmp(a))

1261Example cmp_t27: compute_opcmp_cx ExtSh W ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movsw" "l" reg"ax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t28), l, ext(sh), tmp(a))

1267Example cmp_t28: compute_opcmp_cx ExtSh L ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movsw" "q" reg"ax"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t29), w, ext(uh), tmp(a))

1273Example cmp_t29: compute_opcmp_cx ExtUh W ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movzw" "l" reg"ax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t30), l, ext(uh), tmp(a))

1279Example cmp_t30: compute_opcmp_cx ExtUh L ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movzw" "l" reg"ax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t31), l, ext(sw), tmp(a))

1285Example cmp_t31: compute_opcmp_cx ExtSw L ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movsl" "q" reg"eax"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t32), l, ext(uw), tmp(a))

1291Example cmp_t32: compute_opcmp_cx ExtUw L ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" reg"eax"; reg"eax"
Proof 1 step Qed
reflexivity

SSE2 floats

1299Definition flt_cx: ctx ≔
mkCtx"flts" ex_slot"a" 32 ex_slot"b" 8 ex_slot"c" 40 ex_slot"d" 16 ex_slot"i" 48 ex_slot"j" 24 nm_empty nm_empty 0 0 nm_empty

let(tmp(t1), s, add, tmp(a), tmp(b))

1310Example flt_t1: compute_opflt_cx Add Single ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins"add" "ss" reg"xmm1"; reg"xmm0"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t2), d, add, tmp(c), tmp(d))

1318Example flt_t2: compute_opflt_cx Add Double ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins"add" "sd" reg"xmm1"; reg"xmm0"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t3), s, sub, tmp(a), tmp(b))

1326Example flt_t3: compute_opflt_cx Sub Single ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins"sub" "ss" reg"xmm1"; reg"xmm0"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t4), d, sub, tmp(c), tmp(d))

1334Example flt_t4: compute_opflt_cx Sub Double ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins"sub" "sd" reg"xmm1"; reg"xmm0"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t5), s, mul, tmp(a), tmp(b))

1342Example flt_t5: compute_opflt_cx Mul Single ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins"mul" "ss" reg"xmm1"; reg"xmm0"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t6), d, mul, tmp(c), tmp(d))

1350Example flt_t6: compute_opflt_cx Mul Double ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins"mul" "sd" reg"xmm1"; reg"xmm0"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t7), s, div, tmp(a), tmp(b))

1358Example flt_t7: compute_opflt_cx Div Single ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins"div" "ss" reg"xmm1"; reg"xmm0"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t8), d, div, tmp(c), tmp(d))

1366Example flt_t8: compute_opflt_cx Div Double ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins"div" "sd" reg"xmm1"; reg"xmm0"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t9), s, neg, tmp(a))

1374Example flt_t9: compute_opflt_cx Neg Single ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" imm2147483648; reg"ecx"; ins"xor" "l" reg"ecx"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t10), d, neg, tmp(c))

1381Example flt_t10: compute_opflt_cx Neg Double ex_tmp"c" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins"movabs" "q" imm−9223372036854775808; reg"rcx"; ins"xor" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t11), s, copy, tmp(a))

1389Example flt_t11: compute_opflt_cx Copy Single ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t12), d, copy, tmp(c))

1395Example flt_t12: compute_opflt_cx Copy Double ex_tmp"c" = ins"mov" "q" mem−40 "rbp"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t13), w, cmp(eq, s), tmp(a), tmp(b))

1401Example flt_t13: compute_opflt_cx CmpEq Single W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins0"ucomiss" reg"xmm1"; reg"xmm0"; ins0"sete" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t14), w, cmp(eq, d), tmp(c), tmp(d))

1410Example flt_t14: compute_opflt_cx CmpEq Double W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins0"ucomisd" reg"xmm1"; reg"xmm0"; ins0"sete" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t15), w, cmp(ne, s), tmp(a), tmp(b))

1419Example flt_t15: compute_opflt_cx CmpNe Single W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins0"ucomiss" reg"xmm1"; reg"xmm0"; ins0"setne" reg"al"; ins0"setp" reg"cl"; ins"or" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t16), w, cmp(ne, d), tmp(c), tmp(d))

1428Example flt_t16: compute_opflt_cx CmpNe Double W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins0"ucomisd" reg"xmm1"; reg"xmm0"; ins0"setne" reg"al"; ins0"setp" reg"cl"; ins"or" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t17), w, cmp(lt, s), tmp(a), tmp(b))

1437Example flt_t17: compute_opflt_cx CmpLt Single W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins0"ucomiss" reg"xmm1"; reg"xmm0"; ins0"setb" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t18), w, cmp(lt, d), tmp(c), tmp(d))

1446Example flt_t18: compute_opflt_cx CmpLt Double W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins0"ucomisd" reg"xmm1"; reg"xmm0"; ins0"setb" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t19), w, cmp(le, s), tmp(a), tmp(b))

1455Example flt_t19: compute_opflt_cx CmpLe Single W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins0"ucomiss" reg"xmm1"; reg"xmm0"; ins0"setbe" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t20), w, cmp(le, d), tmp(c), tmp(d))

1464Example flt_t20: compute_opflt_cx CmpLe Double W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins0"ucomisd" reg"xmm1"; reg"xmm0"; ins0"setbe" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t21), w, cmp(gt, s), tmp(a), tmp(b))

1473Example flt_t21: compute_opflt_cx CmpGt Single W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins0"ucomiss" reg"xmm1"; reg"xmm0"; ins0"seta" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t22), w, cmp(gt, d), tmp(c), tmp(d))

1482Example flt_t22: compute_opflt_cx CmpGt Double W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins0"ucomisd" reg"xmm1"; reg"xmm0"; ins0"seta" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t23), w, cmp(ge, s), tmp(a), tmp(b))

1491Example flt_t23: compute_opflt_cx CmpGe Single W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins0"ucomiss" reg"xmm1"; reg"xmm0"; ins0"setae" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t24), w, cmp(ge, d), tmp(c), tmp(d))

1500Example flt_t24: compute_opflt_cx CmpGe Double W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins0"ucomisd" reg"xmm1"; reg"xmm0"; ins0"setae" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t25), w, cmp(o, s), tmp(a), tmp(b))

1509Example flt_t25: compute_opflt_cx CmpOrd Single W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins0"ucomiss" reg"xmm1"; reg"xmm0"; ins0"setnp" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t26), w, cmp(o, d), tmp(c), tmp(d))

1518Example flt_t26: compute_opflt_cx CmpOrd Double W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins0"ucomisd" reg"xmm1"; reg"xmm0"; ins0"setnp" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t27), w, cmp(uo, s), tmp(a), tmp(b))

1527Example flt_t27: compute_opflt_cx CmpUnord Single W ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" mem−8 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins0"ucomiss" reg"xmm1"; reg"xmm0"; ins0"setp" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t28), w, cmp(uo, d), tmp(c), tmp(d))

1536Example flt_t28: compute_opflt_cx CmpUnord Double W ex_tmp"c"; ex_tmp"d" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"mov" "q" mem−16 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins0"ucomisd" reg"xmm1"; reg"xmm0"; ins0"setp" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t29), d, ext(s), tmp(a))

1545Example flt_t29: compute_opflt_cx ExtFSingle Double ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins0"cvtss2sd" reg"xmm0"; reg"xmm0"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t30), s, truncd, tmp(c))

1552Example flt_t30: compute_opflt_cx Truncd Single ex_tmp"c" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins0"cvtsd2ss" reg"xmm0"; reg"xmm0"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t31), w, cast, tmp(a))

1559Example flt_t31: compute_opflt_cx Cast W ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t32), l, cast, tmp(c))

1565Example flt_t32: compute_opflt_cx Cast L ex_tmp"c" = ins"mov" "q" mem−40 "rbp"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t33), s, cast, tmp(i))

1571Example flt_t33: compute_opflt_cx Cast Single ex_tmp"i" = ins"mov" "l" mem−48 "rbp"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t34), d, cast, tmp(j))

1577Example flt_t34: compute_opflt_cx Cast Double ex_tmp"j" = ins"mov" "q" mem−24 "rbp"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t35), w, stosi, tmp(a))

1583Example flt_t35: compute_opflt_cx FloatToIntSingle Signed W ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"cvttss2si" "l" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t36), w, stoui, tmp(a))

1590Example flt_t36: compute_opflt_cx FloatToIntSingle Unsigned W ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"cvttss2si" "q" reg"xmm0"; reg"rax"; ins"mov" "l" reg"eax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t37), w, dtosi, tmp(c))

1597Example flt_t37: compute_opflt_cx FloatToIntDouble Signed W ex_tmp"c" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"cvttsd2si" "l" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t38), w, dtoui, tmp(c))

1604Example flt_t38: compute_opflt_cx FloatToIntDouble Unsigned W ex_tmp"c" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"cvttsd2si" "q" reg"xmm0"; reg"rax"; ins"mov" "l" reg"eax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t39), l, stosi, tmp(a))

1611Example flt_t39: compute_opflt_cx FloatToIntSingle Signed L ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"cvttss2si" "q" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t40), l, stoui, tmp(a))

1618Example flt_t40: compute_opflt_cx FloatToIntSingle Unsigned L ex_tmp"a" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" imm1593835520; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins0"ucomiss" reg"xmm1"; reg"xmm0"; ins0"jb" sym"1f"; ins"sub" "ss" reg"xmm1"; reg"xmm0"; ins"cvttss2si" "q" reg"xmm0"; reg"rax"; ins"btc" "q" imm63; reg"rax"; ins0"jmp" sym"2f"; label"1"; ins"cvttss2si" "q" reg"xmm0"; reg"rax"; label"2"
Proof 1 step Qed
reflexivity

let(tmp(t41), l, dtosi, tmp(c))

1629Example flt_t41: compute_opflt_cx FloatToIntDouble Signed L ex_tmp"c" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"cvttsd2si" "q" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t42), l, dtoui, tmp(c))

1636Example flt_t42: compute_opflt_cx FloatToIntDouble Unsigned L ex_tmp"c" = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"movabs" "q" imm4890909195324358656; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins0"ucomisd" reg"xmm1"; reg"xmm0"; ins0"jb" sym"1f"; ins"sub" "sd" reg"xmm1"; reg"xmm0"; ins"cvttsd2si" "q" reg"xmm0"; reg"rax"; ins"btc" "q" imm63; reg"rax"; ins0"jmp" sym"2f"; label"1"; ins"cvttsd2si" "q" reg"xmm0"; reg"rax"; label"2"
Proof 1 step Qed
reflexivity

let(tmp(t43), s, swtof, tmp(i))

1647Example flt_t43: compute_opflt_cx IntToFloatW Signed Single ex_tmp"i" = ins"mov" "l" mem−48 "rbp"; reg"eax"; ins"cvtsi2ss" "l" reg"eax"; reg"xmm0"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t44), s, uwtof, tmp(i))

1654Example flt_t44: compute_opflt_cx IntToFloatW Unsigned Single ex_tmp"i" = ins"mov" "l" mem−48 "rbp"; reg"eax"; ins"cvtsi2ss" "q" reg"rax"; reg"xmm0"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t45), s, sltof, tmp(j))

1661Example flt_t45: compute_opflt_cx IntToFloatL Signed Single ex_tmp"j" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"cvtsi2ss" "q" reg"rax"; reg"xmm0"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t46), s, ultof, tmp(j))

1668Example flt_t46: compute_opflt_cx IntToFloatL Unsigned Single ex_tmp"j" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"test" "q" reg"rax"; reg"rax"; ins0"jns" sym"1f"; ins"mov" "q" reg"rax"; reg"rcx"; ins"and" "l" imm1; reg"ecx"; ins"shr" "q" imm1; reg"rax"; ins"or" "q" reg"rcx"; reg"rax"; ins"cvtsi2ss" "q" reg"rax"; reg"xmm0"; ins"add" "ss" reg"xmm0"; reg"xmm0"; ins0"jmp" sym"2f"; label"1"; ins"cvtsi2ss" "q" reg"rax"; reg"xmm0"; label"2"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t47), d, swtof, tmp(i))

1679Example flt_t47: compute_opflt_cx IntToFloatW Signed Double ex_tmp"i" = ins"mov" "l" mem−48 "rbp"; reg"eax"; ins"cvtsi2sd" "l" reg"eax"; reg"xmm0"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t48), d, uwtof, tmp(i))

1686Example flt_t48: compute_opflt_cx IntToFloatW Unsigned Double ex_tmp"i" = ins"mov" "l" mem−48 "rbp"; reg"eax"; ins"cvtsi2sd" "q" reg"rax"; reg"xmm0"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t49), d, sltof, tmp(j))

1693Example flt_t49: compute_opflt_cx IntToFloatL Signed Double ex_tmp"j" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"cvtsi2sd" "q" reg"rax"; reg"xmm0"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t50), d, ultof, tmp(j))

1700Example flt_t50: compute_opflt_cx IntToFloatL Unsigned Double ex_tmp"j" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"test" "q" reg"rax"; reg"rax"; ins0"jns" sym"1f"; ins"mov" "q" reg"rax"; reg"rcx"; ins"and" "l" imm1; reg"ecx"; ins"shr" "q" imm1; reg"rax"; ins"or" "q" reg"rcx"; reg"rax"; ins"cvtsi2sd" "q" reg"rax"; reg"xmm0"; ins"add" "sd" reg"xmm0"; reg"xmm0"; ins0"jmp" sym"2f"; label"1"; ins"cvtsi2sd" "q" reg"rax"; reg"xmm0"; label"2"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t51), s, add, tmp(a), const(1069547520))

1711Example flt_t51: compute_opflt_cx Add Single ex_tmp"a"; Const1069547520 = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins0"movd" reg"eax"; reg"xmm0"; ins"mov" "l" imm1069547520; reg"eax"; ins0"movd" reg"eax"; reg"xmm1"; ins"add" "ss" reg"xmm1"; reg"xmm0"; ins0"movd" reg"xmm0"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t52), d, add, tmp(c), const(4621819117588971520))

1719Example flt_t52: compute_opflt_cx Add Double ex_tmp"c"; Const4621819117588971520 = ins"mov" "q" mem−40 "rbp"; reg"rax"; ins0"movq" reg"rax"; reg"xmm0"; ins"movabs" "q" imm4621819117588971520; reg"rax"; ins0"movq" reg"rax"; reg"xmm1"; ins"add" "sd" reg"xmm1"; reg"xmm0"; ins0"movq" reg"xmm0"; reg"rax"
Proof 1 step Qed
reflexivity

Loads and stores

The access itself of each raw load and store, after its checks.

let(tmp(t1), l, load(l), tmp(p))

1732Example load_l_l: load_insnLdL L = ins"mov" "q" mem0 "rax"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t2), s, load(s), tmp(p))

1738Example load_s_s: load_insnLdS Single = ins"mov" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t3), d, load(d), tmp(p))

1744Example load_d_d: load_insnLdD Double = ins"mov" "q" mem0 "rax"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t4), w, load(sw), tmp(p))

1750Example load_sw_w: load_insnLdNarrowSw W = ins"mov" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t5), l, load(sw), tmp(p))

1756Example load_sw_l: load_insnLdNarrowSw L = ins"movsl" "q" mem0 "rax"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t6), w, load(uw), tmp(p))

1762Example load_uw_w: load_insnLdNarrowUw W = ins"mov" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t7), l, load(uw), tmp(p))

1768Example load_uw_l: load_insnLdNarrowUw L = ins"mov" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t8), w, load(sh), tmp(p))

1774Example load_sh_w: load_insnLdNarrowSh W = ins"movsw" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t9), l, load(sh), tmp(p))

1780Example load_sh_l: load_insnLdNarrowSh L = ins"movsw" "q" mem0 "rax"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t10), w, load(uh), tmp(p))

1786Example load_uh_w: load_insnLdNarrowUh W = ins"movzw" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t11), l, load(uh), tmp(p))

1792Example load_uh_l: load_insnLdNarrowUh L = ins"movzw" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t12), w, load(sb), tmp(p))

1798Example load_sb_w: load_insnLdNarrowSb W = ins"movsb" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t13), l, load(sb), tmp(p))

1804Example load_sb_l: load_insnLdNarrowSb L = ins"movsb" "q" mem0 "rax"; reg"rax"
Proof 1 step Qed
reflexivity

let(tmp(t14), w, load(ub), tmp(p))

1810Example load_ub_w: load_insnLdNarrowUb W = ins"movzb" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

let(tmp(t15), l, load(ub), tmp(p))

1816Example load_ub_l: load_insnLdNarrowUb L = ins"movzb" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

store(b, tmp(a), tmp(p))

1822Example store_b_d: store_insnWb "d" = ins"mov" "b" reg"dl"; mem0 "rax"
Proof 1 step Qed
reflexivity

store(h, tmp(a), tmp(p))

1828Example store_h_d: store_insnWh "d" = ins"mov" "w" reg"dx"; mem0 "rax"
Proof 1 step Qed
reflexivity

store(w, tmp(a), tmp(p))

1834Example store_w_d: store_insnWw "d" = ins"mov" "l" reg"edx"; mem0 "rax"
Proof 1 step Qed
reflexivity

store(l, tmp(c), tmp(p))

1840Example store_l_d: store_insnWl "d" = ins"mov" "q" reg"rdx"; mem0 "rax"
Proof 1 step Qed
reflexivity

store(s, tmp(e), tmp(p))

1846Example store_s_d: store_insnWs "d" = ins"mov" "l" reg"edx"; mem0 "rax"
Proof 1 step Qed
reflexivity

store(d, tmp(f), tmp(p))

1852Example store_d_d: store_insnWd "d" = ins"mov" "q" reg"rdx"; mem0 "rax"
Proof 1 step Qed
reflexivity

x87

The context holds the operands and the slot of the one temporary d that the instruction defines.

1863Definition x87_cxd : string off : Z : ctx ≔
mkCtx"xs" ex_slotd off ex_slot"e" 8 ex_slot"f" 16 ex_slot"a" 32 ex_slot"c" 24 ex_slot"x" 56 ex_slot"y" 72 nm_empty nm_empty 0 0 nm_empty

let(tmp(x), x, ext(s), tmp(e))

1875Example x87_x: x87_instx87_cx"x" 56 ExtFSingle Extended ex_tmp"e" TAtom"x" = ins"mov" "l" mem−8 "rbp"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rsp"; ins"fld" "s" mem−8 "rsp"; ins"fstp" "t" mem−56 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(y), x, ext(d), tmp(f))

1882Example x87_y: x87_instx87_cx"y" 72 ExtFDouble Extended ex_tmp"f" TAtom"y" = ins"mov" "q" mem−16 "rbp"; reg"rax"; ins"mov" "q" reg"rax"; mem−8 "rsp"; ins"fld" "l" mem−8 "rsp"; ins"fstp" "t" mem−72 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t3), x, add, tmp(x), tmp(y))

1889Example x87_t3: x87_instx87_cx"t3" 88 Add Extended ex_tmp"x"; ex_tmp"y" TAtom"t3" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fadd" reg"st(1)"; reg"st"; ins"fstp" "t" mem−88 "rbp"; ins0"fstp" reg"st(0)"
Proof 1 step Qed
reflexivity

let(tmp(t4), x, sub, tmp(x), tmp(y))

1897Example x87_t4: x87_instx87_cx"t4" 88 Sub Extended ex_tmp"x"; ex_tmp"y" TAtom"t4" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fsub" reg"st(1)"; reg"st"; ins"fstp" "t" mem−88 "rbp"; ins0"fstp" reg"st(0)"
Proof 1 step Qed
reflexivity

let(tmp(t5), x, mul, tmp(x), tmp(y))

1905Example x87_t5: x87_instx87_cx"t5" 88 Mul Extended ex_tmp"x"; ex_tmp"y" TAtom"t5" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fmul" reg"st(1)"; reg"st"; ins"fstp" "t" mem−88 "rbp"; ins0"fstp" reg"st(0)"
Proof 1 step Qed
reflexivity

let(tmp(t6), x, div, tmp(x), tmp(y))

1913Example x87_t6: x87_instx87_cx"t6" 88 Div Extended ex_tmp"x"; ex_tmp"y" TAtom"t6" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fdiv" reg"st(1)"; reg"st"; ins"fstp" "t" mem−88 "rbp"; ins0"fstp" reg"st(0)"
Proof 1 step Qed
reflexivity

let(tmp(t7), x, neg, tmp(x))

1921Example x87_t7: x87_instx87_cx"t7" 88 Neg Extended ex_tmp"x" TAtom"t7" = ins"fld" "t" mem−56 "rbp"; ins0"fchs" [ ]; ins"fstp" "t" mem−88 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t8), x, copy, tmp(x))

1927Example x87_t8: x87_instx87_cx"t8" 88 Copy Extended ex_tmp"x" TAtom"t8" = ins"fld" "t" mem−56 "rbp"; ins"fstp" "t" mem−88 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t9), w, cmp(eq, x), tmp(x), tmp(y))

1933Example x87_t9: x87_instx87_cx"t9" 8 CmpEq Extended W ex_tmp"x"; ex_tmp"y" TAtom"t9" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)"; ins0"sete" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t10), w, cmp(ne, x), tmp(x), tmp(y))

1942Example x87_t10: x87_instx87_cx"t10" 8 CmpNe Extended W ex_tmp"x"; ex_tmp"y" TAtom"t10" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)"; ins0"setne" reg"al"; ins0"setp" reg"cl"; ins"or" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t11), w, cmp(lt, x), tmp(x), tmp(y))

1951Example x87_t11: x87_instx87_cx"t11" 8 CmpLt Extended W ex_tmp"x"; ex_tmp"y" TAtom"t11" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)"; ins0"setb" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t12), w, cmp(le, x), tmp(x), tmp(y))

1960Example x87_t12: x87_instx87_cx"t12" 8 CmpLe Extended W ex_tmp"x"; ex_tmp"y" TAtom"t12" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)"; ins0"setbe" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t13), w, cmp(gt, x), tmp(x), tmp(y))

1969Example x87_t13: x87_instx87_cx"t13" 8 CmpGt Extended W ex_tmp"x"; ex_tmp"y" TAtom"t13" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)"; ins0"seta" reg"al"; ins"movzb" "l" reg"al"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t14), w, cmp(ge, x), tmp(x), tmp(y))

1977Example x87_t14: x87_instx87_cx"t14" 8 CmpGe Extended W ex_tmp"x"; ex_tmp"y" TAtom"t14" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)"; ins0"setae" reg"al"; ins"movzb" "l" reg"al"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t15), w, cmp(o, x), tmp(x), tmp(y))

1985Example x87_t15: x87_instx87_cx"t15" 8 CmpOrd Extended W ex_tmp"x"; ex_tmp"y" TAtom"t15" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)"; ins0"setnp" reg"al"; ins"movzb" "l" reg"al"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t16), w, cmp(uo, x), tmp(x), tmp(y))

1993Example x87_t16: x87_instx87_cx"t16" 8 CmpUnord Extended W ex_tmp"x"; ex_tmp"y" TAtom"t16" = ins"fld" "t" mem−72 "rbp"; ins"fld" "t" mem−56 "rbp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)"; ins0"setp" reg"al"; ins"movzb" "l" reg"al"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t17), s, truncx, tmp(x))

2001Example x87_t17: x87_instx87_cx"t17" 8 Truncx Single ex_tmp"x" TAtom"t17" = ins"fld" "t" mem−56 "rbp"; ins"fstp" "s" mem−8 "rsp"; ins"mov" "l" mem−8 "rsp"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t18), d, truncx, tmp(x))

2008Example x87_t18: x87_instx87_cx"t18" 8 Truncx Double ex_tmp"x" TAtom"t18" = ins"fld" "t" mem−56 "rbp"; ins"fstp" "l" mem−8 "rsp"; ins"mov" "q" mem−8 "rsp"; reg"rax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t19), w, xtosi, tmp(x))

2015Example x87_t19: x87_instx87_cx"t19" 8 FloatToIntExtended Signed W ex_tmp"x" TAtom"t19" = ins"fld" "t" mem−56 "rbp"; ins"fisttp" "ll" mem−8 "rsp"; ins"mov" "l" mem−8 "rsp"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t20), l, xtosi, tmp(x))

2022Example x87_t20: x87_instx87_cx"t20" 8 FloatToIntExtended Signed L ex_tmp"x" TAtom"t20" = ins"fld" "t" mem−56 "rbp"; ins"fisttp" "ll" mem−8 "rsp"; ins"mov" "q" mem−8 "rsp"; reg"rax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t21), w, xtoui, tmp(x))

2029Example x87_t21: x87_instx87_cx"t21" 8 FloatToIntExtended Unsigned W ex_tmp"x" TAtom"t21" = ins"fld" "t" mem−56 "rbp"; ins"fisttp" "ll" mem−8 "rsp"; ins"mov" "l" mem−8 "rsp"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t22), l, xtoui, tmp(x))

2036Example x87_t22: x87_instx87_cx"t22" 8 FloatToIntExtended Unsigned L ex_tmp"x" TAtom"t22" = ins"fld" "t" mem−56 "rbp"; ins"mov" "l" imm1593835520; mem−12 "rsp"; ins"fld" "s" mem−12 "rsp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"ja" sym"1f"; ins"fsub" "s" mem−12 "rsp"; ins"fisttp" "ll" mem−8 "rsp"; ins"mov" "q" mem−8 "rsp"; reg"rax"; ins"btc" "q" imm63; reg"rax"; ins0"jmp" sym"2f"; label"1"; ins"fisttp" "ll" mem−8 "rsp"; ins"mov" "q" mem−8 "rsp"; reg"rax"; label"2"; ins"mov" "q" reg"rax"; mem−8 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t23), x, swtof, tmp(a))

2048Example x87_t23: x87_instx87_cx"t23" 72 IntToFloatW Signed Extended ex_tmp"a" TAtom"t23" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"movsl" "q" reg"eax"; reg"rax"; ins"mov" "q" reg"rax"; mem−8 "rsp"; ins"fild" "ll" mem−8 "rsp"; ins"fstp" "t" mem−72 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t24), x, uwtof, tmp(a))

2056Example x87_t24: x87_instx87_cx"t24" 72 IntToFloatW Unsigned Extended ex_tmp"a" TAtom"t24" = ins"mov" "l" mem−32 "rbp"; reg"eax"; ins"mov" "l" reg"eax"; reg"eax"; ins"mov" "q" reg"rax"; mem−8 "rsp"; ins"fild" "ll" mem−8 "rsp"; ins"fstp" "t" mem−72 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t25), x, sltof, tmp(c))

2064Example x87_t25: x87_instx87_cx"t25" 72 IntToFloatL Signed Extended ex_tmp"c" TAtom"t25" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"mov" "q" reg"rax"; mem−8 "rsp"; ins"fild" "ll" mem−8 "rsp"; ins"fstp" "t" mem−72 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t26), x, ultof, tmp(c))

2071Example x87_t26: x87_instx87_cx"t26" 72 IntToFloatL Unsigned Extended ex_tmp"c" TAtom"t26" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"mov" "q" reg"rax"; mem−8 "rsp"; ins"fild" "ll" mem−8 "rsp"; ins"test" "q" reg"rax"; reg"rax"; ins0"jns" sym"1f"; ins"mov" "l" imm1602224128; mem−12 "rsp"; ins"fadd" "s" mem−12 "rsp"; label"1"; ins"fstp" "t" mem−72 "rbp"
Proof 1 step Qed
reflexivity

let(tmp(t27), x, add, tmp(x), const(302222231531620438900736))

2080Example x87_t27: x87_instx87_cx"t27" 72 Add Extended ex_tmp"x"; Const302222231531620438900736 TAtom"t27" = ins"movabs" "q" imm−9223372036854775808; reg"rdx"; ins"mov" "q" reg"rdx"; mem−16 "rsp"; ins"mov" "w" imm16383; mem−8 "rsp"; ins"fld" "t" mem−16 "rsp"; ins"fld" "t" mem−56 "rbp"; ins0"fadd" reg"st(1)"; reg"st"; ins"fstp" "t" mem−72 "rbp"; ins0"fstp" reg"st(0)"
Proof 1 step Qed
reflexivity

let(tmp(t28), x, copy, const(906708199769027163193345))

2091Example x87_t28: x87_instx87_cx"t28" 72 Copy Extended Const906708199769027163193345 TAtom"t28" = ins"movabs" "q" imm−4611686018427387903; reg"rdx"; ins"mov" "q" reg"rdx"; mem−16 "rsp"; ins"mov" "w" imm49152; mem−8 "rsp"; ins"fld" "t" mem−16 "rsp"; ins"fstp" "t" mem−72 "rbp"
Proof 1 step Qed
reflexivity

Cases no Fil-C module reaches

These are what the Prolog predicates gave when called directly: the plain backend's alloc, classes and registers that the Fil-C backend does not ask for, and goals that fail, which are a todo here.

2106Definition direct_cx: ctx ≔

compute_op(alloc(16), l, tmp(a))

2114Example alloc_16: compute_opdirect_cx Alloc16 L ex_tmp"a" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"add" "q" imm15; reg"rax"; ins"and" "q" imm−16; reg"rax"; ins"sub" "q" reg"rax"; reg"rsp"; ins"mov" "q" reg"rsp"; reg"rax"
Proof 1 step Qed
reflexivity

compute_op(alloc(32), l, tmp(a))

2122Example alloc_32: compute_opdirect_cx Alloc32 L ex_tmp"a" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"add" "q" imm15; reg"rax"; ins"and" "q" imm−16; reg"rax"; ins"sub" "q" reg"rax"; reg"rsp"; ins"and" "q" imm−32; reg"rsp"; ins"mov" "q" reg"rsp"; reg"rax"
Proof 1 step Qed
reflexivity

compute_op(alloc(8), l, tmp(a))

2130Example alloc_8: compute_opdirect_cx Alloc8 L ex_tmp"a" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"add" "q" imm15; reg"rax"; ins"and" "q" imm−16; reg"rax"; ins"sub" "q" reg"rax"; reg"rsp"; ins"mov" "q" reg"rsp"; reg"rax"
Proof 1 step Qed
reflexivity

compute_op(and, s, tmp(a),tmp(b))

2138Example and_at_s: compute_opdirect_cx And Single ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"and" "l" reg"ecx"; reg"eax"
Proof 1 step Qed
reflexivity

compute_op(urem, d, tmp(a),tmp(b))

2145Example urem_at_d: compute_opdirect_cx Urem Double ex_tmp"a"; ex_tmp"b" = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"mov" "q" mem−8 "rbp"; reg"rcx"; ins"test" "q" reg"rcx"; reg"rcx"; ins0"sete" reg"dl"; ins"movzb" "l" reg"dl"; reg"edx"; ins"add" "q" reg"rdx"; reg"rcx"; ins"sub" "q" imm1; reg"rdx"; ins"and" "q" reg"rdx"; reg"rax"; ins"xor" "l" reg"edx"; reg"edx"; ins"div" "q" reg"rcx"; ins"mov" "q" reg"rdx"; reg"rax"
Proof 1 step Qed
reflexivity

compute_op(cmp(eq,w), x, tmp(a),tmp(b))

2156Example cmp_any_result_class: compute_opdirect_cx CmpEq W Extended ex_tmp"a"; ex_tmp"b" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"mov" "l" mem−8 "rbp"; reg"ecx"; ins"cmp" "l" reg"ecx"; reg"eax"; ins0"sete" reg"al"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

compute_op(ext(ub), d, tmp(a))

2164Example ext_ub_at_d: compute_opdirect_cx ExtUb Double ex_tmp"a" = ins"mov" "l" mem−24 "rbp"; reg"eax"; ins"movzb" "l" reg"al"; reg"eax"
Proof 1 step Qed
reflexivity

compute_op(add, l, tmp(a),const(9223372036854775808))

2170Example add_l_const_2_63: compute_opdirect_cx Add L ex_tmp"a"; Const9223372036854775808 = ins"mov" "q" mem−24 "rbp"; reg"rax"; ins"movabs" "q" imm−9223372036854775808; reg"rcx"; ins"add" "q" reg"rcx"; reg"rax"
Proof 1 step Qed
reflexivity

compute_op(add, p, tmp(a),tmp(b))

2178Example todo_add_p: ex_todocompute_opdirect_cx Add P ex_tmp"a"; ex_tmp"b" = true
Proof 1 step Qed
reflexivity

compute_op(add, w, tmp(a))

2182Example todo_add_one_argument: ex_todocompute_opdirect_cx Add W ex_tmp"a" = true
Proof 1 step Qed
reflexivity

compute_op(rem, s, tmp(a),tmp(b))

2186Example todo_rem_s: ex_todocompute_opdirect_cx Rem Single ex_tmp"a"; ex_tmp"b" = true
Proof 1 step Qed
reflexivity

compute_op(ext(sw), w, tmp(a))

2190Example todo_ext_sw_w: ex_todocompute_opdirect_cx ExtSw W ex_tmp"a" = true
Proof 1 step Qed
reflexivity

compute_op(cmp(lt,s), l, tmp(a),tmp(b))

2194Example todo_float_cmp_l: ex_todocompute_opdirect_cx CmpLt Single L ex_tmp"a"; ex_tmp"b" = true
Proof 1 step Qed
reflexivity

compute_op(cmp(lt,w), w, tmp(a),tmp(b))

2199Example todo_cmp_lt_w: ex_todocompute_opdirect_cx CmpLt W W ex_tmp"a"; ex_tmp"b" = true
Proof 1 step Qed
reflexivity

compute_op(stoui, s, tmp(a))

Proof 1 step Qed
reflexivity

compute_op(truncx, s, tmp(a))

2209Example todo_truncx: ex_todocompute_opdirect_cx Truncx Single ex_tmp"a" = true
Proof 1 step Qed
reflexivity

compute_op(add, w, tmp(nope),tmp(b))

2213Example todo_no_slot: ex_todocompute_opdirect_cx Add W ex_tmp"nope"; ex_tmp"b" = true
Proof 1 step Qed
reflexivity

store_insn(b, a)

2217Example store_b_a: store_insnWb "a" = ins"mov" "b" reg"al"; mem0 "rax"
Proof 1 step Qed
reflexivity

store_insn(b, c)

2223Example store_b_c: store_insnWb "c" = ins"mov" "b" reg"cl"; mem0 "rax"
Proof 1 step Qed
reflexivity

store_insn(h, c)

2229Example store_h_c: store_insnWh "c" = ins"mov" "w" reg"cx"; mem0 "rax"
Proof 1 step Qed
reflexivity

store_insn(w, r8)

2235Example store_w_r8: store_insnWw "r8" = ins"mov" "l" reg"r8d"; mem0 "rax"
Proof 1 step Qed
reflexivity

store_insn(l, si)

2241Example store_l_si: store_insnWl "si" = ins"mov" "q" reg"rsi"; mem0 "rax"
Proof 1 step Qed
reflexivity

store_insn(s, di)

2247Example store_s_di: store_insnWs "di" = ins"mov" "l" reg"edi"; mem0 "rax"
Proof 1 step Qed
reflexivity

store_insn(d, r9)

2253Example store_d_r9: store_insnWd "r9" = ins"mov" "q" reg"r9"; mem0 "rax"
Proof 1 step Qed
reflexivity

store_insn(b, si)

2259Example todo_store_b_si: ex_todostore_insnWb "si" = true
Proof 1 step Qed
reflexivity

store_insn(h, r8)

2263Example todo_store_h_r8: ex_todostore_insnWh "r8" = true
Proof 1 step Qed
reflexivity

store_insn(p, a)

2267Example todo_store_p: ex_todostore_insnWp "a" = true
Proof 1 step Qed
reflexivity

store_insn(x, a)

2271Example todo_store_x: ex_todostore_insnWx "a" = true
Proof 1 step Qed
reflexivity

load_insn(uw, x)

2275Example load_uw_x: load_insnLdNarrowUw Extended = ins"mov" "l" mem0 "rax"; reg"eax"
Proof 1 step Qed
reflexivity

load_insn(x, x)

2281Example todo_load_x: ex_todoload_insnLdX Extended = true
Proof 1 step Qed
reflexivity

load_insn(sw, s)

2285Example todo_load_sw_s: ex_todoload_insnLdNarrowSw Single = true
Proof 1 step Qed
reflexivity

load_insn(l, w)

2289Example todo_load_l_w: ex_todoload_insnLdL W = true
Proof 1 step Qed
reflexivity

load_insn(sb, s)

2293Example todo_load_sb_s: ex_todoload_insnLdNarrowSb Single = true
Proof 1 step Qed
reflexivity

cond_code(ult)

2297Example cond_ult: cond_codeUlt = Some"b"
Proof 1 step Qed
reflexivity

cond_code(sge)

2301Example cond_sge: cond_codeSge = Some"ge"
Proof 1 step Qed
reflexivity

cond_code(lt)

2305Example cond_lt: cond_codeLt = None
Proof 1 step Qed
reflexivity

float_condition(le)

2309Example fcond_le: float_conditionLe = ins0"setbe" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"
Proof 1 step Qed
reflexivity

float_condition(uo)

2315Example fcond_uo: float_conditionUnord = ins0"setp" reg"al"
Proof 1 step Qed
reflexivity

float_condition(slt)

2321Example todo_fcond_slt: ex_todofloat_conditionSlt = true
Proof 1 step Qed
reflexivity

reg_name(a, b)

2325Example reg8_a: reg8"a" = "al"
Proof 1 step Qed
reflexivity

reg_name(c, h)

2329Example reg16_c: reg16"c" = "cx"
Proof 1 step Qed
reflexivity

reg_name(d, b)

2333Example reg8_d: reg8"d" = "dl"
Proof 1 step Qed
reflexivity

reg_name(d, h)

2337Example reg16_d: reg16"d" = "dx"
Proof 1 step Qed
reflexivity

x87_inst(xtosi, d, tmp(a))

2341Example x87_xtosi_d: x87_instdirect_cx FloatToIntExtended Signed Double ex_tmp"a" TAtom"r" = ins"fld" "t" mem−24 "rbp"; ins"fisttp" "ll" mem−8 "rsp"; ins"mov" "q" mem−8 "rsp"; reg"rax"; ins"mov" "q" reg"rax"; mem−40 "rbp"
Proof 1 step Qed
reflexivity

x87_inst(copy, x, const(-1))

2348Example x87_copy_const: x87_instdirect_cx Copy Extended Const−1 TAtom"r" = ins"movabs" "q" imm−1; reg"rdx"; ins"mov" "q" reg"rdx"; mem−16 "rsp"; ins"mov" "w" imm65535; mem−8 "rsp"; ins"fld" "t" mem−16 "rsp"; ins"fstp" "t" mem−40 "rbp"
Proof 1 step Qed
reflexivity

x87_inst(cmp(lt,x), w, tmp(a),const(906708199769027163193345))

2356Example x87_cmp_const: x87_instdirect_cx CmpLt Extended W ex_tmp"a"; Const906708199769027163193345 TAtom"r" = ins"movabs" "q" imm−4611686018427387903; reg"rdx"; ins"mov" "q" reg"rdx"; mem−16 "rsp"; ins"mov" "w" imm49152; mem−8 "rsp"; ins"fld" "t" mem−16 "rsp"; ins"fld" "t" mem−24 "rbp"; ins0"fucomip" reg"st(1)"; reg"st"; ins0"fstp" reg"st(0)"; ins0"setb" reg"al"; ins0"setnp" reg"cl"; ins"and" "b" reg"cl"; reg"al"; ins"movzb" "l" reg"al"; reg"eax"; ins"mov" "q" reg"rax"; mem−40 "rbp"
Proof 1 step Qed
reflexivity

x87_inst(truncx, w, tmp(a))

2367Example todo_x87_truncx_w: ex_todox87_instdirect_cx Truncx W ex_tmp"a" TAtom"r" = true
Proof 1 step Qed
reflexivity

x87_inst(cmp(eq,x), l, tmp(a),tmp(b))

2371Example todo_x87_cmp_l: ex_todox87_instdirect_cx CmpEq Extended L ex_tmp"a"; ex_tmp"b" TAtom"r" = true
Proof 1 step Qed
reflexivity

x87_inst(add, w, tmp(a),tmp(b))

2376Example todo_x87_add_w: ex_todox87_instdirect_cx Add W ex_tmp"a"; ex_tmp"b" TAtom"r" = true
Proof 1 step Qed
reflexivity

x87_inst(ext(s), d, tmp(a))

2381Example todo_x87_ext_d: ex_todox87_instdirect_cx ExtFSingle Double ex_tmp"a" TAtom"r" = true
Proof 1 step Qed
reflexivity

x87_op(add, x)

2386Example x87_op_add_x: x87_opAdd Extended = true
Proof 1 step Qed
reflexivity

x87_op(add, d)

2390Example x87_op_add_d: x87_opAdd Double = false
Proof 1 step Qed
reflexivity

x87_op(cmp(lt,x), w)

2394Example x87_op_cmp_x: x87_opCmpLt Extended W = true
Proof 1 step Qed
reflexivity

x87_op(cmp(lt,d), w)

2398Example x87_op_cmp_d: x87_opCmpLt Double W = false
Proof 1 step Qed
reflexivity

x87_op(truncx, s)

2402Example x87_op_truncx: x87_opTruncx Single = true
Proof 1 step Qed
reflexivity

x87_op(truncd, s)

2406Example x87_op_truncd: x87_opTruncd Single = false
Proof 1 step Qed
reflexivity

x87_op(xtoui, l)

2410Example x87_op_xtoui: x87_opFloatToIntExtended Unsigned L = true
Proof 1 step Qed
reflexivity

x87_op(dtoui, l)

2414Example x87_op_dtoui: x87_opFloatToIntDouble Unsigned L = false
Proof 1 step Qed
reflexivity