Skip to content

Commit cc61e5e

Browse files
committed
Add XORPS
1 parent a378b8a commit cc61e5e

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

x86/proofs/decode.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ let decode_aux = new_definition `!pfxs rex l. decode_aux pfxs rex l =
397397
let sz = op_size T (rex_W rex) T pfxs in
398398
read_ModRM_operand rex sz l >>= \((reg,rm),l).
399399
SOME (CMOV (decode_condition c) reg rm,l)
400+
| [0x57:8] -> if has_pfxs pfxs then NONE else
401+
let sz = Lower_128 in
402+
read_ModRM rex l >>= \((reg,rm),l).
403+
SOME (XORPS (mmreg reg sz) (simd_of_RM sz rm), l)
400404
| [0x66:8] -> if has_unhandled_pfxs pfxs then NONE else
401405
let sz = Lower_128 in
402406
read_ModRM rex l >>= \((reg,rm),l).

x86/proofs/instruction.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ let instruction_INDUCTION,instruction_RECURSION = define_type
306306
| TZCNT operand operand
307307
| VPXOR operand operand operand
308308
| XCHG operand operand
309-
| XOR operand operand";;
309+
| XOR operand operand
310+
| XORPS operand operand";;
310311

311312
(* ------------------------------------------------------------------------- *)
312313
(* Some shorthands for addressing modes etc. *)

x86/proofs/simulator.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ let iclasses = iclasses @
279279
[0x66; 0x41; 0x0f; 0xef; 0xff]; (*PXOR (%_% xmm7) (%_% xmm15) *)
280280
[0x66; 0x0f; 0xdb; 0xd3]; (*PAND (%_% xmm2) (%_% xmm3) *)
281281
[0x66; 0x41; 0x0f; 0xdb; 0xff]; (*PAND (%_% xmm7) (%_% xmm15) *)
282+
[0x0f; 0x57; 0xd3]; (*XORPS (%_% xmm2) (%_% xmm3) *)
283+
[0x41; 0x0f; 0x57; 0xff]; (*XORPS (%_% xmm7) (%_% xmm15) *)
282284
[0x66; 0x0f; 0xfe; 0xd3]; (*PADDD (%_% xmm2) (%_% xmm3) *)
283285
[0x66; 0x41; 0x0f; 0xfe; 0xff]; (*PADDD (%_% xmm7) (%_% xmm15) *)
284286
[0x66; 0x0f; 0xd4; 0xd3]; (*PADDQ (%_% xmm2) (%_% xmm3) *)

x86/proofs/x86.ml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,12 @@ let x86_XOR = new_definition
13471347
OF := F ,,
13481348
UNDEFINED_VALUES[AF]) s`;;
13491349

1350+
let x86_XORPS = new_definition
1351+
`x86_XORPS dest src s =
1352+
let x = read src s in
1353+
let y = read dest s in
1354+
(dest := word_xor x y) s`;;
1355+
13501356
(* ------------------------------------------------------------------------- *)
13511357
(* State components of various sizes corresponding to GPRs. *)
13521358
(* We also have a generic one "GPR" mapping to a number in all cases. *)
@@ -1986,6 +1992,8 @@ let x86_execute = define
19861992
| 32 -> x86_XOR (OPERAND32 dest s) (OPERAND32 src s)
19871993
| 16 -> x86_XOR (OPERAND16 dest s) (OPERAND16 src s)
19881994
| 8 -> x86_XOR (OPERAND8 dest s) (OPERAND8 src s)) s
1995+
| XORPS dest src ->
1996+
x86_XORPS (OPERAND128_SSE dest s) (OPERAND128_SSE src s) s
19891997
| _ -> (\s'. F)`;;
19901998

19911999
(* ------------------------------------------------------------------------- *)
@@ -2708,7 +2716,7 @@ let X86_OPERATION_CLAUSES =
27082716
x86_PSHUFD_ALT; x86_PSRAD_ALT; x86_PUSH_ALT; x86_PXOR;
27092717
x86_RCL; x86_RCR; x86_RET; x86_ROL; x86_ROR;
27102718
x86_SAR; x86_SBB_ALT; x86_SET; x86_SHL; x86_SHLD; x86_SHR; x86_SHRD;
2711-
x86_STC; x86_SUB_ALT; x86_TEST; x86_TZCNT; x86_XCHG; x86_XOR;
2719+
x86_STC; x86_SUB_ALT; x86_TEST; x86_TZCNT; x86_XCHG; x86_XOR; x86_XORPS;
27122720
(*** AVX2 instructions ***)
27132721
x86_VPXOR;
27142722
(*** 32-bit backups since the ALT forms are 64-bit only ***)

0 commit comments

Comments
 (0)