Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.
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
6 changes: 3 additions & 3 deletions interpreter/binary/encode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,9 @@ let encode m =
| SimdShift V128Op.(I64x2 ShrU) -> simd_op 0xcdl
| SimdShift (_) -> assert false

| SimdBitmask V128Op.(I8x16 Bitmask) -> simd_op 0x64l
| SimdBitmask V128Op.(I16x8 Bitmask) -> simd_op 0x84l
| SimdBitmask V128Op.(I32x4 Bitmask) -> simd_op 0xa4l
| SimdBitmask Simd.I8x16 -> simd_op 0x64l
| SimdBitmask Simd.I16x8 -> simd_op 0x84l
| SimdBitmask Simd.I32x4 -> simd_op 0xa4l
| SimdBitmask (_) -> assert false

| _ -> assert false
Expand Down
8 changes: 4 additions & 4 deletions interpreter/exec/eval_simd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ module SimdOp (SXX : Simd.S) (Value : ValueType with type t = SXX.t) = struct
| _ -> failwith "unimplemented shr_u"
in fun v s -> to_value (f (of_value 1 v) (of_arg I32Value.of_value 2 s))

let bitmaskop (op : bitmaskop) v =
let bitmaskop (op : Simd.shape) v =
let f = match op with
| I8x16 Bitmask -> SXX.I8x16.bitmask
| I16x8 Bitmask -> SXX.I16x8.bitmask
| I32x4 Bitmask -> SXX.I32x4.bitmask
| Simd.I8x16 -> SXX.I8x16.bitmask
| Simd.I16x8 -> SXX.I16x8.bitmask
| Simd.I32x4 -> SXX.I32x4.bitmask
| _ -> assert false
in I32 (f (of_value 1 v))

Expand Down
2 changes: 1 addition & 1 deletion interpreter/exec/eval_simd.mli
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ val cvtop : Ast.V128Op.cvtop -> value -> value

val eval_ternop : Ast.V128Op.ternop -> value -> value -> value -> value
val eval_shiftop : Ast.V128Op.shiftop -> value -> value -> value
val eval_bitmaskop : Ast.V128Op.bitmaskop -> value -> value
val eval_bitmaskop : Simd.shape -> value -> value
val eval_extractop : Ast.V128Op.extractop -> value -> value
val eval_replaceop : Ast.V128Op.replaceop -> value -> value -> value
5 changes: 1 addition & 4 deletions interpreter/syntax/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ struct
type replaceop = (int, int, int, int, int, int, int) v128op
type shift = Shl | ShrS | ShrU
type shiftop = (shift, shift, shift, shift, shift, shift, shift) v128op
type bitmask = Bitmask
type bitmaskop = (bitmask, bitmask, bitmask, bitmask, bitmask, bitmask, bitmask) v128op
end

module I32Op = IntOp
Expand All @@ -106,7 +104,6 @@ type replaceop = V128Op.replaceop
(* Ternary operators only exist for V128 types for now *)
type ternop = V128Op.ternop
type shiftop = V128Op.shiftop
type bitmaskop = V128Op.bitmaskop

type 'a memop =
{ty : value_type; align : int; offset : Memory.offset; sz : 'a option}
Expand Down Expand Up @@ -161,7 +158,7 @@ and instr' =
| SimdExtract of extractop (* extract lane from v128 value *)
| SimdReplace of replaceop (* replace lane of v128 value *)
| SimdShift of shiftop (* shifts for v128 value *)
| SimdBitmask of bitmaskop (* bitmask for v128 value *)
| SimdBitmask of Simd.shape (* bitmask for v128 value *)


(* Globals & Functions *)
Expand Down
6 changes: 3 additions & 3 deletions interpreter/syntax/operators.ml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ let i8x16_ge_s = Binary (V128 V128Op.(I8x16 GeS))
let i8x16_ge_u = Binary (V128 V128Op.(I8x16 GeU))
let i8x16_neg = Unary (V128 V128Op.(I8x16 Neg))
let i8x16_any_true = Test (V128 V128Op.(I8x16 AnyTrue))
let i8x16_bitmask = SimdBitmask V128Op.(I8x16 Bitmask)
let i8x16_bitmask = SimdBitmask Simd.I8x16
let i8x16_all_true = Test (V128 V128Op.(I8x16 AllTrue))
let i8x16_narrow_i16x8_s = Binary (V128 V128Op.(I8x16 NarrowS))
let i8x16_narrow_i16x8_u = Binary (V128 V128Op.(I8x16 NarrowU))
Expand Down Expand Up @@ -306,7 +306,7 @@ let i16x8_ge_s = Binary (V128 V128Op.(I16x8 GeS))
let i16x8_ge_u = Binary (V128 V128Op.(I16x8 GeU))
let i16x8_neg = Unary (V128 V128Op.(I16x8 Neg))
let i16x8_any_true = Test (V128 V128Op.(I16x8 AnyTrue))
let i16x8_bitmask = SimdBitmask V128Op.(I16x8 Bitmask)
let i16x8_bitmask = SimdBitmask Simd.I16x8
let i16x8_all_true = Test (V128 V128Op.(I16x8 AllTrue))
let i16x8_narrow_i32x4_s = Binary (V128 V128Op.(I16x8 NarrowS))
let i16x8_narrow_i32x4_u = Binary (V128 V128Op.(I16x8 NarrowU))
Expand Down Expand Up @@ -343,7 +343,7 @@ let i32x4_ge_u = Binary (V128 V128Op.(I32x4 GeU))
let i32x4_abs = Unary (V128 V128Op.(I32x4 Abs))
let i32x4_neg = Unary (V128 V128Op.(I32x4 Neg))
let i32x4_any_true = Test (V128 V128Op.(I32x4 AnyTrue))
let i32x4_bitmask = SimdBitmask V128Op.(I32x4 Bitmask)
let i32x4_bitmask = SimdBitmask Simd.I32x4
let i32x4_all_true = Test (V128 V128Op.(I32x4 AllTrue))
let i32x4_widen_low_i16x8_s = Unary (V128 V128Op.(I32x4 WidenLowS))
let i32x4_widen_high_i16x8_s = Unary (V128 V128Op.(I32x4 WidenHighS))
Expand Down
6 changes: 3 additions & 3 deletions interpreter/text/arrange.ml
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ struct
| _ -> assert false

let bitmaskop = function
| I8x16 Bitmask -> "i8x16.bitmask"
| I16x8 Bitmask -> "i16x8.bitmask"
| I32x4 Bitmask -> "i32x4.bitmask"
| Simd.I8x16 -> "i8x16.bitmask"
| Simd.I16x8 -> "i16x8.bitmask"
| Simd.I32x4 -> "i32x4.bitmask"
| _ -> assert false

end
Expand Down