Skip to content

Commit 83590eb

Browse files
authored
Remove duplicate VEX prefix (ocaml-flambda#3963)
remove duplicate prefix
1 parent de0296d commit 83590eb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

backend/x86_binary_emitter.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ let emit_MOV b dst src =
867867
assert false
868868

869869
let emit_vex3 buf ~rexr ~rexx ~rexb ~vex_m ~vex_w ~vex_v ~vex_l ~vex_p =
870-
buf_int8 buf 0xC4;
870+
buf_int8 buf 0xC4; (* We only emit 3-byte VEX instructions. *)
871871
buf_int8 buf (((lnot rexr) lsl 7) lor
872872
((lnot rexx) lsl 6) lor
873873
((lnot rexb) lsl 5) lor
@@ -971,7 +971,6 @@ let emit_simd b (instr : Amd64_simd_instrs.instr) args =
971971
emit_legacy_prefix prefix;
972972
emit_mod_rm_reg b (mk_rex rex) (legacy_escape escape) rm reg
973973
| Reg, Vex { vex_m; vex_w; vex_l; vex_p } ->
974-
buf_int8 b 0xC4; (* We only emit 3-byte VEX instructions. *)
975974
let rm, vex_v, reg = rm_vexv_reg () in
976975
emit_vex_rm_reg b [instr.enc.opcode] rm reg
977976
~vex_m:(vex_map vex_m) ~vex_w ~vex_v ~vex_l ~vex_p:(vex_prefix vex_p)

tools/simdgen/simdgen.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(* *)
1313
(**************************************************************************)
1414

15-
(* Parses [amd64.csv] and outputs [X86_simd_defs.instr] definitions.
15+
(* Parses [amd64.csv] and outputs [Amd64_simd_defs.instr] definitions.
1616
1717
[amd64.csv] was retrieved from https://github.com/GregoryComer/x86-csv
1818
(commit c638bbbaa17f0c81abaa7e84a968335c985542fa) and manually modified.

0 commit comments

Comments
 (0)