Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1130)

Unified Diff: src/wasm/wasm-opcodes.h

Issue 2700813002: [V8] Implement SIMD Boolean vector types to allow mask registers. (Closed)
Patch Set: Remove stray DCHECK. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/wasm/wasm-opcodes.h
diff --git a/src/wasm/wasm-opcodes.h b/src/wasm/wasm-opcodes.h
index ad16439572f6a55059afbbd94fa1c92ad2f3555a..319b2a925f7a5a7f5b3cdc65244624b7988f1347 100644
--- a/src/wasm/wasm-opcodes.h
+++ b/src/wasm/wasm-opcodes.h
@@ -21,7 +21,10 @@ enum ValueTypeCode {
kLocalI64 = 0x7e,
kLocalF32 = 0x7d,
kLocalF64 = 0x7c,
- kLocalS128 = 0x7b
+ kLocalS128 = 0x7b,
+ kLocalS4 = 0x7a,
bbudge 2017/02/17 23:39:56 Changed these to kLocalS1xN to match MachineType.
+ kLocalS8 = 0x79,
+ kLocalS16 = 0x78
};
// Type code for multi-value block types.
@@ -36,6 +39,9 @@ const ValueType kWasmI64 = MachineRepresentation::kWord64;
const ValueType kWasmF32 = MachineRepresentation::kFloat32;
const ValueType kWasmF64 = MachineRepresentation::kFloat64;
const ValueType kWasmS128 = MachineRepresentation::kSimd128;
+const ValueType kWasmS4 = MachineRepresentation::kSimdBool4;
+const ValueType kWasmS8 = MachineRepresentation::kSimdBool8;
+const ValueType kWasmS16 = MachineRepresentation::kSimdBool16;
const ValueType kWasmVar = MachineRepresentation::kTagged;
typedef Signature<ValueType> FunctionSig;
@@ -288,12 +294,12 @@ const WasmCodePosition kNoCodePosition = -1;
V(F32x4Max, 0xe50d, s_ss) \
V(F32x4MinNum, 0xe50e, s_ss) \
V(F32x4MaxNum, 0xe50f, s_ss) \
- V(F32x4Eq, 0xe510, s_ss) \
- V(F32x4Ne, 0xe511, s_ss) \
- V(F32x4Lt, 0xe512, s_ss) \
- V(F32x4Le, 0xe513, s_ss) \
- V(F32x4Gt, 0xe514, s_ss) \
- V(F32x4Ge, 0xe515, s_ss) \
+ V(F32x4Eq, 0xe510, s4_ss) \
+ V(F32x4Ne, 0xe511, s4_ss) \
bradnelson 2017/02/16 23:18:30 Maybe b4 or sb4 Maybe...
bbudge 2017/02/17 23:39:56 Changing sN to s1xN to match other renamings. Usin
+ V(F32x4Lt, 0xe512, s4_ss) \
+ V(F32x4Le, 0xe513, s4_ss) \
+ V(F32x4Gt, 0xe514, s4_ss) \
+ V(F32x4Ge, 0xe515, s4_ss) \
V(F32x4SConvertI32x4, 0xe519, s_s) \
V(F32x4UConvertI32x4, 0xe51a, s_s) \
V(I32x4Splat, 0xe51b, s_i) \
@@ -303,19 +309,19 @@ const WasmCodePosition kNoCodePosition = -1;
V(I32x4Mul, 0xe521, s_ss) \
V(I32x4MinS, 0xe522, s_ss) \
V(I32x4MaxS, 0xe523, s_ss) \
- V(I32x4Eq, 0xe526, s_ss) \
- V(I32x4Ne, 0xe527, s_ss) \
- V(I32x4LtS, 0xe528, s_ss) \
- V(I32x4LeS, 0xe529, s_ss) \
- V(I32x4GtS, 0xe52a, s_ss) \
- V(I32x4GeS, 0xe52b, s_ss) \
+ V(I32x4Eq, 0xe526, s4_ss) \
+ V(I32x4Ne, 0xe527, s4_ss) \
+ V(I32x4LtS, 0xe528, s4_ss) \
+ V(I32x4LeS, 0xe529, s4_ss) \
+ V(I32x4GtS, 0xe52a, s4_ss) \
+ V(I32x4GeS, 0xe52b, s4_ss) \
V(I32x4SConvertF32x4, 0xe52f, s_s) \
V(I32x4MinU, 0xe530, s_ss) \
V(I32x4MaxU, 0xe531, s_ss) \
- V(I32x4LtU, 0xe533, s_ss) \
- V(I32x4LeU, 0xe534, s_ss) \
- V(I32x4GtU, 0xe535, s_ss) \
- V(I32x4GeU, 0xe536, s_ss) \
+ V(I32x4LtU, 0xe533, s4_ss) \
+ V(I32x4LeU, 0xe534, s4_ss) \
+ V(I32x4GtU, 0xe535, s4_ss) \
+ V(I32x4GeU, 0xe536, s4_ss) \
V(I32x4UConvertF32x4, 0xe537, s_s) \
V(I16x8Splat, 0xe538, s_i) \
V(I16x8Neg, 0xe53b, s_s) \
@@ -326,20 +332,20 @@ const WasmCodePosition kNoCodePosition = -1;
V(I16x8Mul, 0xe540, s_ss) \
V(I16x8MinS, 0xe541, s_ss) \
V(I16x8MaxS, 0xe542, s_ss) \
- V(I16x8Eq, 0xe545, s_ss) \
- V(I16x8Ne, 0xe546, s_ss) \
- V(I16x8LtS, 0xe547, s_ss) \
- V(I16x8LeS, 0xe548, s_ss) \
- V(I16x8GtS, 0xe549, s_ss) \
- V(I16x8GeS, 0xe54a, s_ss) \
+ V(I16x8Eq, 0xe545, s8_ss) \
+ V(I16x8Ne, 0xe546, s8_ss) \
+ V(I16x8LtS, 0xe547, s8_ss) \
+ V(I16x8LeS, 0xe548, s8_ss) \
+ V(I16x8GtS, 0xe549, s8_ss) \
+ V(I16x8GeS, 0xe54a, s8_ss) \
V(I16x8AddSaturateU, 0xe54e, s_ss) \
V(I16x8SubSaturateU, 0xe54f, s_ss) \
V(I16x8MinU, 0xe550, s_ss) \
V(I16x8MaxU, 0xe551, s_ss) \
- V(I16x8LtU, 0xe553, s_ss) \
- V(I16x8LeU, 0xe554, s_ss) \
- V(I16x8GtU, 0xe555, s_ss) \
- V(I16x8GeU, 0xe556, s_ss) \
+ V(I16x8LtU, 0xe553, s8_ss) \
+ V(I16x8LeU, 0xe554, s8_ss) \
+ V(I16x8GtU, 0xe555, s8_ss) \
+ V(I16x8GeU, 0xe556, s8_ss) \
V(I8x16Splat, 0xe557, s_i) \
V(I8x16Neg, 0xe55a, s_s) \
V(I8x16Add, 0xe55b, s_ss) \
@@ -349,31 +355,31 @@ const WasmCodePosition kNoCodePosition = -1;
V(I8x16Mul, 0xe55f, s_ss) \
V(I8x16MinS, 0xe560, s_ss) \
V(I8x16MaxS, 0xe561, s_ss) \
- V(I8x16Eq, 0xe564, s_ss) \
- V(I8x16Ne, 0xe565, s_ss) \
- V(I8x16LtS, 0xe566, s_ss) \
- V(I8x16LeS, 0xe567, s_ss) \
- V(I8x16GtS, 0xe568, s_ss) \
- V(I8x16GeS, 0xe569, s_ss) \
+ V(I8x16Eq, 0xe564, s16_ss) \
+ V(I8x16Ne, 0xe565, s16_ss) \
+ V(I8x16LtS, 0xe566, s16_ss) \
+ V(I8x16LeS, 0xe567, s16_ss) \
+ V(I8x16GtS, 0xe568, s16_ss) \
+ V(I8x16GeS, 0xe569, s16_ss) \
V(I8x16AddSaturateU, 0xe56d, s_ss) \
V(I8x16SubSaturateU, 0xe56e, s_ss) \
V(I8x16MinU, 0xe56f, s_ss) \
V(I8x16MaxU, 0xe570, s_ss) \
- V(I8x16LtU, 0xe572, s_ss) \
- V(I8x16LeU, 0xe573, s_ss) \
- V(I8x16GtU, 0xe574, s_ss) \
- V(I8x16GeU, 0xe575, s_ss) \
+ V(I8x16LtU, 0xe572, s16_ss) \
+ V(I8x16LeU, 0xe573, s16_ss) \
+ V(I8x16GtU, 0xe574, s16_ss) \
+ V(I8x16GeU, 0xe575, s16_ss) \
V(S128And, 0xe576, s_ss) \
V(S128Or, 0xe577, s_ss) \
V(S128Xor, 0xe578, s_ss) \
V(S128Not, 0xe579, s_s) \
- V(S32x4Select, 0xe52c, s_sss) \
+ V(S32x4Select, 0xe52c, s_s4ss) \
V(S32x4Swizzle, 0xe52d, s_s) \
V(S32x4Shuffle, 0xe52e, s_ss) \
- V(S16x8Select, 0xe54b, s_sss) \
+ V(S16x8Select, 0xe54b, s_s8ss) \
V(S16x8Swizzle, 0xe54c, s_s) \
V(S16x8Shuffle, 0xe54d, s_ss) \
- V(S8x16Select, 0xe56a, s_sss) \
+ V(S8x16Select, 0xe56a, s_s16ss) \
V(S8x16Swizzle, 0xe56b, s_s) \
V(S8x16Shuffle, 0xe56c, s_ss)
@@ -477,13 +483,19 @@ const WasmCodePosition kNoCodePosition = -1;
V(f_if, kWasmF32, kWasmI32, kWasmF32) \
V(l_il, kWasmI64, kWasmI32, kWasmI64)
-#define FOREACH_SIMD_SIGNATURE(V) \
- V(s_s, kWasmS128, kWasmS128) \
- V(s_f, kWasmS128, kWasmF32) \
- V(s_ss, kWasmS128, kWasmS128, kWasmS128) \
- V(s_sss, kWasmS128, kWasmS128, kWasmS128, kWasmS128) \
- V(s_i, kWasmS128, kWasmI32) \
- V(s_si, kWasmS128, kWasmS128, kWasmI32)
+#define FOREACH_SIMD_SIGNATURE(V) \
+ V(s_s, kWasmS128, kWasmS128) \
+ V(s_f, kWasmS128, kWasmF32) \
+ V(s_ss, kWasmS128, kWasmS128, kWasmS128) \
+ V(s4_ss, kWasmS4, kWasmS128, kWasmS128) \
+ V(s8_ss, kWasmS8, kWasmS128, kWasmS128) \
+ V(s16_ss, kWasmS16, kWasmS128, kWasmS128) \
+ V(s_i, kWasmS128, kWasmI32) \
+ V(s_si, kWasmS128, kWasmS128, kWasmI32) \
+ V(i_s, kWasmI32, kWasmS128) \
+ V(s_s4ss, kWasmS128, kWasmS4, kWasmS128, kWasmS128) \
+ V(s_s8ss, kWasmS128, kWasmS8, kWasmS128, kWasmS128) \
+ V(s_s16ss, kWasmS128, kWasmS16, kWasmS128, kWasmS128)
#define FOREACH_PREFIX(V) \
V(Simd, 0xe5) \
@@ -547,6 +559,12 @@ class V8_EXPORT_PRIVATE WasmOpcodes {
return kLocalF64;
case kWasmS128:
return kLocalS128;
+ case kWasmS4:
+ return kLocalS4;
+ case kWasmS8:
+ return kLocalS8;
+ case kWasmS16:
+ return kLocalS16;
case kWasmStmt:
return kLocalVoid;
default:
@@ -567,6 +585,12 @@ class V8_EXPORT_PRIVATE WasmOpcodes {
return MachineType::Float64();
case kWasmS128:
return MachineType::Simd128();
+ case kWasmS4:
+ return MachineType::SimdBool4();
+ case kWasmS8:
+ return MachineType::SimdBool8();
+ case kWasmS16:
+ return MachineType::SimdBool16();
case kWasmStmt:
return MachineType::None();
default:
@@ -598,6 +622,12 @@ class V8_EXPORT_PRIVATE WasmOpcodes {
return kWasmF64;
} else if (type == MachineType::Simd128()) {
return kWasmS128;
+ } else if (type == MachineType::SimdBool4()) {
+ return kWasmS4;
+ } else if (type == MachineType::SimdBool8()) {
+ return kWasmS8;
+ } else if (type == MachineType::SimdBool16()) {
+ return kWasmS16;
} else {
UNREACHABLE();
return kWasmI32;
@@ -642,6 +672,9 @@ class V8_EXPORT_PRIVATE WasmOpcodes {
case kWasmF64:
return 'd';
case kWasmS128:
+ case kWasmS4:
+ case kWasmS8:
+ case kWasmS16:
return 's';
case kWasmStmt:
return 'v';
@@ -664,6 +697,12 @@ class V8_EXPORT_PRIVATE WasmOpcodes {
return "f64";
case kWasmS128:
return "s128";
+ case kWasmS4:
+ return "s4";
+ case kWasmS8:
+ return "s8";
+ case kWasmS16:
+ return "s16";
case kWasmStmt:
return "<stmt>";
case kWasmVar:

Powered by Google App Engine
This is Rietveld 408576698