Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Progress so far:
- [x] Load-op memory operands on x86, opt-in `-fload-op`. This is the first
approved trusted-base change ([#5](https://github.com/AananthV/CompCert/issues/5),
[ledger](faster-compcert/TRUSTED_BASE.md)).
- [x] Model x86 shift-count masking (approved trusted-base change, opt-in
`-fshift-mask`; [#11](https://github.com/AananthV/CompCert/issues/11)).
- [x] Retroactive review of the round-1 trusted-base changes
([#10](https://github.com/AananthV/CompCert/issues/10)).
- [ ] Opt-in libm builtins (`sqrt`, `floor`) and unaligned 64-bit accesses:
these need changes to the trusted model.
- [x] Fix the Loadfwd compile-time/memory blow-up on large functions (65 GB →
Expand Down
1 change: 1 addition & 0 deletions driver/Clflags.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ let option_flooprotate = ref true
let option_flicm = ref true
let option_fivwiden = ref true
let option_floadop = ref false
let option_fshiftmask = ref false
let option_fifconversion = ref true
let option_Obranchless = ref false
let option_falignfunctions = ref (None: int option)
Expand Down
4 changes: 4 additions & 0 deletions driver/Compopts.v
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Parameter optim_ivwiden: unit -> bool.
(** Flag -fload-op. For memory operands in arithmetic instructions. *)
Parameter optim_loadop: unit -> bool.

(** Flag -fshift-mask. For dropping the masking of the count of
variable shifts, which the x86 hardware performs. *)
Parameter optim_shiftmask: unit -> bool.

(** Flag -fredundancy. For dead code elimination. *)
Parameter optim_redundancy: unit -> bool.

Expand Down
2 changes: 2 additions & 0 deletions driver/Driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ Processing options:
-floadfwd Perform global forwarding of stored and loaded values [on]
-fredundancy Perform redundancy elimination [on]
-fload-op Use memory operands in arithmetic instructions [off]
-fshift-mask Rely on the hardware masking of variable shift counts [off]
-finline Perform inlining of functions [on]
-finline-functions-called-once Integrate functions only required by their
single caller [on]
Expand Down Expand Up @@ -399,6 +400,7 @@ let cmdline_actions =
@ f_opt "licm" option_flicm
@ f_opt "iv-widen" option_fivwiden
@ f_opt "load-op" option_floadop
@ f_opt "shift-mask" option_fshiftmask
@ f_opt "redundancy" option_fredundancy
@ f_opt "inline" option_finline
@ f_opt "inline-functions-called-once" option_finline_functions_called_once
Expand Down
2 changes: 2 additions & 0 deletions extraction/extraction.v
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Extract Constant Compopts.optim_loadfwd =>
"fun _ -> !Clflags.option_floadfwd".
Extract Constant Compopts.optim_loadop =>
"fun _ -> !Clflags.option_floadop".
Extract Constant Compopts.optim_shiftmask =>
"fun _ -> !Clflags.option_fshiftmask".
Extract Constant Compopts.optim_redundancy =>
"fun _ -> !Clflags.option_fredundancy".
Extract Constant Compopts.thumb =>
Expand Down
2 changes: 2 additions & 0 deletions faster-compcert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Changes, each fully proved:

| new pass `Loadop`: x86 arithmetic with memory operands (#5; **trusted-base change**, see [TRUSTED_BASE.md](TRUSTED_BASE.md)) | `-fload-op` (off by default) | gemm 0.91x, nbody 0.96x, spectral 0.97x |

| x86 shift-count masking in the Asm model, plus masked-shift selection (#11; **trusted-base change**) | `-fshift-mask` (off by default) | nsievebits 0.94x |

Verification:

- No new axioms. The only new entries in `Print Assumptions` are three flags
Expand Down
27 changes: 27 additions & 0 deletions faster-compcert/REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -1147,3 +1147,30 @@ nearly every candidate unsafe: nbody had 1 fusion instead of 9.
one instruction in between, including gemm's `A[i][k]`.
- Commuted operands and accumulators (`t = load; t = t + x`) are not
handled.

---

## 17. Second trusted-base change: x86 shift-count masking (issue #11)

**Trusted part.** The six variable-count shifts in `x86/Asm.v` now mask their
count to 5 or 6 bits, as the hardware does (ledger entry 4). The new semantics
is a strict refinement of the old one, which was undefined for large counts.
The differential test against the extracted new semantics gives 0 mismatches
and is defined on 100% of the tests (previously 6-13%). The approval and the
exact text were checked character for character against the proposal.

**Verified part.**
- New masked-shift operators, plus a selection rule behind `-fshift-mask`
(off by default). It turns `x << (y & 31)`, and the low word of a 64-bit
`y & 31`, into the masked operator. The second form is what nsievebits
has: `1 << i % NBITS` with a `size_t` `NBITS`.
- Asmgen emits the plain `%cl` shift.
- Existing shifts use the refined instructions through a lemma that the masked
result is at least as defined as the unmasked one.

**Results.**
- Without the flag, the generated code is byte-identical on all 136 files.
- With the flag, only nsievebits changes: both `andq $31,%rcx` instructions
are gone. It runs **−6.3%** (interleaved timing, 94.1 → 88.2 ms).
- 154 tests pass with and without the flag.
- Proofs check on all six targets.
31 changes: 31 additions & 0 deletions faster-compcert/TRUSTED_BASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,34 @@ sequence with 3 seeds:

**Revert.** Remove the xor-emitting lines in `TargetPrinter.ml` and
`Asmexpand.ml`.

## 4. x86 shift-count masking (#11)

- **Approved:** by the owner, 2026-10-22, for exactly the proposal on #11.
- **Merged in:** "x86: model shift-count masking; optional masked-shift selection".
- **Flag:** the semantic refinement is unconditional. The optimization that
uses it is behind `-fshift-mask`, off by default.

**Assumption.** In `x86/Asm.v`, the variable-count shifts mask their count:
```coq
| Psall_rcl rd => Next (nextinstr_nf (rs#rd <- (Val.shl rs#rd (Val.and rs#RCX (Vint (Int.repr 31)))))) m
(* likewise Pshrl_rcl (Val.shru) and Psarl_rcl (Val.shr) with 31;
Psalq_rcl (Val.shll), Pshrq_rcl (Val.shrlu) and Psarq_rcl (Val.shrl) with 63 *)
```
Before this change these shifts were `Val.shl rs#rd rs#RCX` etc., which is
undefined for counts of 32 (or 64) and above.

**Justification.** Intel SDM Vol. 2, SAL/SAR/SHL/SHR: the count is masked to
5 bits (6 with REX.W). This is a refinement: for counts that were defined
before, the new semantics agrees with the old.

**Validation.** `harness/asm_difftest/` group `shift`, against the extracted new
semantics:
- all counts 0..255, with garbage in bits 8..63 of `%rcx`;
- about 20,000 tests per instruction, 3 seeds;
- 0 mismatches, and defined in 100% of the tests. Under the old semantics, only
6-13% were defined.

**Revert.** Restore the six cases. Then remove the masked operators
(`Oshlmask`, …), their selection rules and the `-fshift-mask` flag.

4 changes: 1 addition & 3 deletions faster-compcert/harness/asm_difftest/Extract.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From compcert Require Import Coqlib Values.
From compcert Require Import Coqlib.
From Coq Require Import ExtrOcamlBasic ExtrOcamlNativeString.
Require Import Semantics.
Extraction Inline Coqlib.proj_sumbool.
Expand All @@ -9,6 +9,4 @@ Extraction "difftest_sem.ml"
sem_addsd sem_subsd sem_mulsd sem_divsd sem_addl sem_xorl sem_andl sem_orl
(* register instructions (#10, #11) *)
run_regs sem_fsqrt vint vlong vfloat_bits vsingle_bits res_of_val
(* used by the proposed shift semantics of #11 in check_regs.ml *)
Val.and Val.shl Val.shru Val.shr Val.shll Val.shrlu Val.shrl
int64_of_Z Z_of_int64 int_of_Z Z_of_int.
9 changes: 4 additions & 5 deletions faster-compcert/harness/asm_difftest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ semantics extracted to OCaml. The tree must be built (`make proof`).
| `loadop` | #5 | `Paddd_fm Psubd_fm Pmuld_fm Pdivd_fm Paddl_rm Pxorl_rm Pandl_rm Porl_rm` |
| `zx` | #10 | `Psallzx_ri Pshrlzx_ri Pandlzx_ri` |
| `cvt` | #10 | `Pcvtsi2sd_fr Pcvtsi2ss_fr Pcvtsl2sd_fr Pcvtsl2ss_fr Pcvtss2sd_ff Pcvtsd2ss_ff`, and `sqrtsd` (from `__builtin_fsqrt`), with the `xorpd`/`xorps` printed before them |
| `shift` | #11 | `Psall_rcl Pshrl_rcl Psarl_rcl Psalq_rcl Pshrq_rcl Psarq_rcl`, against both `Asm.v` and the masked semantics proposed in #11 |
| `shift` | #11 | `Psall_rcl Pshrl_rcl Psarl_rcl Psalq_rcl Pshrq_rcl Psarq_rcl`, whose count is masked in `Asm.v` since #11 |

For example, `run.sh . 20000 0x1 shift` runs only the shifts.
The script exits 1 if any group fails. Scratch files go to
Expand Down Expand Up @@ -63,10 +63,9 @@ The reference is always the extracted Coq semantics (`Asm.exec_instr`,
(failure);
- **undef**: the model gives `Vundef`, so there is no constraint.

For `shift`, the same is done with `proposed_rcl`, the semantics
proposed in #11 (`Val.shl rd (Val.and rcx 31)`, ...). It is written
in OCaml from the extracted `Val` operations, and `Asm.v` is not
changed.
For `shift`, `Asm.v` masks the count since #11
(`Val.shl rd (Val.and rcx 31)`, ...), so the model must be defined on
every test: an undef result is a failure there.
A test also fails (`regs` column) if any register other than the
destination changed. For `cvt`, whose semantics uses `nextinstr`, it
also fails if a flag changed. The `wrong-kind:undef` column runs the
Expand Down
43 changes: 10 additions & 33 deletions faster-compcert/harness/asm_difftest/check_regs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
match the model is defined and equals the hardware bit for bit,
MISMATCH the model is defined and differs from the hardware,
undef the model gives [Vundef] (no constraint on the hardware).
For the shifts by %cl, the same is done for the masked semantics
proposed in #11 ([proposed_rcl] below; Asm.v is not changed).
Since #11, Asm.v masks the count of the shifts by %cl as the hardware
does, so for them the model must be defined on every test: an undef
result is a failure.

Independently of the model, the test fails if a register other than
the destination changed, and, for the conversions (whose semantics
Expand All @@ -37,22 +38,6 @@ let lo32 x = Stdlib.Int64.logand x 0xffffffffL
let hi32 x = Stdlib.Int64.shift_right_logical x 32
let z = z_of_uint64

(* The proposed semantics of #11, written with the extracted [Val]
operations exactly as in the proposal:
Psall_rcl rd => rs#rd <- Val.shl rs#rd (Val.and rs#RCX (Vint (Int.repr 31)))
etc., with 63 for the 64-bit forms. *)
let proposed_rcl name (vrd: val0) (vrcx: val0) : val0 =
let m31 = Val.coq_and vrcx (vint (z 31L))
and m63 = Val.coq_and vrcx (vint (z 63L)) in
match name with
| "sall_rcl" -> Val.shl vrd m31
| "shrl_rcl" -> Val.shru vrd m31
| "sarl_rcl" -> Val.shr vrd m31
| "salq_rcl" -> Val.shll vrd m63
| "shrq_rcl" -> Val.shrlu vrd m63
| "sarq_rcl" -> Val.shrl vrd m63
| s -> failwith s

(* The instruction of Asm.v, with its source operand in [src]. *)
let instr name imm src =
let n = int_of_Z (z imm) in
Expand Down Expand Up @@ -126,14 +111,13 @@ let classify kind r (v: val0 option) =
type stats = {
mutable tests: int;
mutable ok: int; mutable bad: int; mutable undef: int; (* Asm.v *)
mutable pok: int; mutable pbad: int; mutable pundef: int; (* #11 proposal *)
mutable regs: int; (* other registers or flags changed *)
mutable other_in: int; (* wrong-kind inputs giving Vundef / tested *)
mutable other_undef: int;
mutable info: int; (* see [info] below *)
mutable info_of: int;
}
let new_stats () = { tests = 0; ok = 0; bad = 0; undef = 0; pok = 0; pbad = 0; pundef = 0;
let new_stats () = { tests = 0; ok = 0; bad = 0; undef = 0;
regs = 0; other_in = 0; other_undef = 0; info = 0; info_of = 0 }

(* Inputs of a kind the compiler never produces for this instruction:
Expand Down Expand Up @@ -176,14 +160,9 @@ let () =
let where = Printf.sprintf "[%s] a=%Lx b=%Lx hw=%Lx" text a b r in
(match classify kind r (run_model name imm same vd vs) with
| Match -> s.ok <- s.ok + 1
| Undef -> s.undef <- s.undef + 1
| Undef -> s.undef <- s.undef + 1;
if g = Shift then report "UNDEF %s %s\n" name where
| Mismatch m -> s.bad <- s.bad + 1; report "MISMATCH %s %s model=%s\n" name where m);
if g = Shift then
(match classify kind r (Some (proposed_rcl name vd vs)) with
| Match -> s.pok <- s.pok + 1
| Undef -> s.pundef <- s.pundef + 1
| Mismatch m -> s.pbad <- s.pbad + 1;
report "MISMATCH(#11 proposal) %s %s model=%s\n" name where m);
if others_kept = 0 || (g = Cvt && flags_kept = 0) then begin
s.regs <- s.regs + 1;
report "REGS %s %s: other registers kept=%d, flags kept=%d\n"
Expand Down Expand Up @@ -212,20 +191,18 @@ let () =
| _ -> ()))
done
with End_of_file -> ());
Printf.printf "%-9s %7s | %-27s | %-27s | %5s | %-15s | %s\n" "instr" "tests"
"Asm.v: match MISMATCH undef" "#11 prop.: match MISM undef" "regs" "wrong-kind:undef" "info";
Printf.printf "%-9s %7s | %-27s | %5s | %-15s | %s\n" "instr" "tests"
"Asm.v: match MISMATCH undef" "regs" "wrong-kind:undef" "info";
List.iter (fun k ->
match Hashtbl.find_opt tbl k with
| None -> ()
| Some s ->
let prop = if group_of k = Shift
then Printf.sprintf "%9d %6d %6d" s.pok s.pbad s.pundef else "" in
let info = match group_of k with
| Zx -> Printf.sprintf "upper 32 zeroed %d/%d" s.info s.info_of
| Shift when not (is_q k) -> Printf.sprintf "upper 32 zeroed %d/%d" s.info s.info_of
| Cvt -> Printf.sprintf "upper lanes zero after xor %d/%d" s.info s.info_of
| _ -> "" in
Printf.printf "%-9s %7d | %8d %8d %8d | %-27s | %5d | %7d/%-7d | %s\n" k s.tests
s.ok s.bad s.undef prop s.regs s.other_undef s.other_in info)
Printf.printf "%-9s %7d | %8d %8d %8d | %5d | %7d/%-7d | %s\n" k s.tests
s.ok s.bad s.undef s.regs s.other_undef s.other_in info)
names;
exit (if !failures = 0 then 0 else 1)
1 change: 1 addition & 0 deletions faster-compcert/results/axioms-faster-compcert.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Compopts.optim_loadfwd
Compopts.optim_loadop
Compopts.optim_looprot
Compopts.optim_redundancy
Compopts.optim_shiftmask
Compopts.optim_tailcalls
Compopts.propagate_float_constants
Compopts.va_strict
Expand Down
12 changes: 6 additions & 6 deletions x86/Asm.v
Original file line number Diff line number Diff line change
Expand Up @@ -824,25 +824,25 @@ Definition exec_instr (f: function) (i: instruction) (rs: regset) (m: mem) : out
| Pnotq rd =>
Next (nextinstr_nf (rs#rd <- (Val.notl rs#rd))) m
| Psall_rcl rd =>
Next (nextinstr_nf (rs#rd <- (Val.shl rs#rd rs#RCX))) m
Next (nextinstr_nf (rs#rd <- (Val.shl rs#rd (Val.and rs#RCX (Vint (Int.repr 31)))))) m
| Psalq_rcl rd =>
Next (nextinstr_nf (rs#rd <- (Val.shll rs#rd rs#RCX))) m
Next (nextinstr_nf (rs#rd <- (Val.shll rs#rd (Val.and rs#RCX (Vint (Int.repr 63)))))) m
| Psall_ri rd n =>
Next (nextinstr_nf (rs#rd <- (Val.shl rs#rd (Vint n)))) m
| Psalq_ri rd n =>
Next (nextinstr_nf (rs#rd <- (Val.shll rs#rd (Vint n)))) m
| Pshrl_rcl rd =>
Next (nextinstr_nf (rs#rd <- (Val.shru rs#rd rs#RCX))) m
Next (nextinstr_nf (rs#rd <- (Val.shru rs#rd (Val.and rs#RCX (Vint (Int.repr 31)))))) m
| Pshrq_rcl rd =>
Next (nextinstr_nf (rs#rd <- (Val.shrlu rs#rd rs#RCX))) m
Next (nextinstr_nf (rs#rd <- (Val.shrlu rs#rd (Val.and rs#RCX (Vint (Int.repr 63)))))) m
| Pshrl_ri rd n =>
Next (nextinstr_nf (rs#rd <- (Val.shru rs#rd (Vint n)))) m
| Pshrq_ri rd n =>
Next (nextinstr_nf (rs#rd <- (Val.shrlu rs#rd (Vint n)))) m
| Psarl_rcl rd =>
Next (nextinstr_nf (rs#rd <- (Val.shr rs#rd rs#RCX))) m
Next (nextinstr_nf (rs#rd <- (Val.shr rs#rd (Val.and rs#RCX (Vint (Int.repr 31)))))) m
| Psarq_rcl rd =>
Next (nextinstr_nf (rs#rd <- (Val.shrl rs#rd rs#RCX))) m
Next (nextinstr_nf (rs#rd <- (Val.shrl rs#rd (Val.and rs#RCX (Vint (Int.repr 63)))))) m
| Psarl_ri rd n =>
Next (nextinstr_nf (rs#rd <- (Val.shr rs#rd (Vint n)))) m
| Psarq_ri rd n =>
Expand Down
26 changes: 26 additions & 0 deletions x86/Asmgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,32 @@ Definition transl_op
assertion (mreg_eq a1 res);
do r <- ireg_of res; do r2 <- ireg_of a2;
transl_sel c args r r2 k
(* The hardware masks the count of a shift by [%cl], so the masked
shifts are plain shifts by [%cl]. *)
| Oshlmask, a1 :: a2 :: nil =>
assertion (mreg_eq a1 res);
assertion (mreg_eq a2 CX);
do r <- ireg_of res; OK (Psall_rcl r :: k)
| Oshrmask, a1 :: a2 :: nil =>
assertion (mreg_eq a1 res);
assertion (mreg_eq a2 CX);
do r <- ireg_of res; OK (Psarl_rcl r :: k)
| Oshrumask, a1 :: a2 :: nil =>
assertion (mreg_eq a1 res);
assertion (mreg_eq a2 CX);
do r <- ireg_of res; OK (Pshrl_rcl r :: k)
| Oshllmask, a1 :: a2 :: nil =>
assertion (mreg_eq a1 res);
assertion (mreg_eq a2 CX);
do r <- ireg_of res; OK (Psalq_rcl r :: k)
| Oshrlmask, a1 :: a2 :: nil =>
assertion (mreg_eq a1 res);
assertion (mreg_eq a2 CX);
do r <- ireg_of res; OK (Psarq_rcl r :: k)
| Oshrlumask, a1 :: a2 :: nil =>
assertion (mreg_eq a1 res);
assertion (mreg_eq a2 CX);
do r <- ireg_of res; OK (Pshrq_rcl r :: k)
| _, _ =>
Error(msg "Asmgen.transl_op")
end.
Expand Down
53 changes: 52 additions & 1 deletion x86/Asmgenproof1.v
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,57 @@ Ltac TranslOp :=
[ apply exec_straight_one; [ simpl; eauto | auto ]
| split; [ Simplifs | intros; Simplifs ]].

(** Shifts by [%cl]: the count is masked as by the hardware. This
refines the unmasked shifts of [Op], and is the semantics of the
masked shifts of [Op]. *)

Remark mask_small:
forall i n logn, Int.is_power2 n = Some logn ->
Int.ltu i n = true -> Int.and i (Int.sub n Int.one) = i.
Proof.
intros. rewrite <- (Int.modu_and i n logn) by auto.
unfold Int.ltu in H0. destruct (zlt (Int.unsigned i) (Int.unsigned n)); try discriminate.
unfold Int.modu. rewrite Z.mod_small. apply Int.repr_unsigned.
generalize (Int.unsigned_range i); lia.
Qed.

Remark mask31_small:
forall i, Int.ltu i Int.iwordsize = true -> Int.and i (Int.repr 31) = i.
Proof.
intros. exact (mask_small i Int.iwordsize (Int.repr 5) (eq_refl _) H).
Qed.

Remark mask63_small:
forall i, Int.ltu i Int64.iwordsize' = true -> Int.and i (Int.repr 63) = i.
Proof.
intros. exact (mask_small i Int64.iwordsize' (Int.repr 6) (eq_refl _) H).
Qed.

Lemma shift_mask_lessdef:
forall x y,
Val.lessdef (Val.shl x y) (Val.shl x (Val.and y (Vint (Int.repr 31))))
/\ Val.lessdef (Val.shr x y) (Val.shr x (Val.and y (Vint (Int.repr 31))))
/\ Val.lessdef (Val.shru x y) (Val.shru x (Val.and y (Vint (Int.repr 31))))
/\ Val.lessdef (Val.shll x y) (Val.shll x (Val.and y (Vint (Int.repr 63))))
/\ Val.lessdef (Val.shrl x y) (Val.shrl x (Val.and y (Vint (Int.repr 63))))
/\ Val.lessdef (Val.shrlu x y) (Val.shrlu x (Val.and y (Vint (Int.repr 63)))).
Proof.
intros. destruct x; destruct y; simpl; intuition auto.
- destruct (Int.ltu i0 Int.iwordsize) eqn:L; auto. rewrite mask31_small, L by auto; auto.
- destruct (Int.ltu i0 Int.iwordsize) eqn:L; auto. rewrite mask31_small, L by auto; auto.
- destruct (Int.ltu i0 Int.iwordsize) eqn:L; auto. rewrite mask31_small, L by auto; auto.
- destruct (Int.ltu i0 Int64.iwordsize') eqn:L; auto. rewrite mask63_small, L by auto; auto.
- destruct (Int.ltu i0 Int64.iwordsize') eqn:L; auto. rewrite mask63_small, L by auto; auto.
- destruct (Int.ltu i0 Int64.iwordsize') eqn:L; auto. rewrite mask63_small, L by auto; auto.
Qed.

Ltac TranslShift :=
econstructor; split;
[ apply exec_straight_one; [ simpl; eauto | auto ]
| split; [ rewrite nextinstr_nf_inv by auto with asmgen; rewrite Pregmap.gss;
edestruct shift_mask_lessdef as (? & ? & ? & ? & ? & ?); eassumption
| intros; Simplifs ]].

Lemma transl_op_correct:
forall op args res k c (rs: regset) m v,
transl_op op args res k = OK c ->
Expand All @@ -1329,7 +1380,7 @@ Transparent destroyed_by_op.
intros [rs' [A [B C]]]. subst v. exists rs'; auto.
}

destruct op; simpl in TR; ArgsInv; simpl in EV; try (inv EV); try (apply SAME; TranslOp; fail).
destruct op; simpl in TR; ArgsInv; simpl in EV; try (inv EV); try (apply SAME; TranslOp; fail); try (TranslShift; fail).
(* move *)
exploit mk_mov_correct; eauto. intros [rs2 [A [B C]]].
apply SAME. exists rs2. eauto.
Expand Down
Loading