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

Unified Diff: src/arm64/lithium-codegen-arm64.cc

Issue 1273353003: [simd.js] Single SIMD128_VALUE_TYPE for all Simd128Values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix slow check failures. REBASE. Created 5 years, 4 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
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc
index c4be83277a805fa51045443d99aa8f4a556d20c3..eb2e99a9de16ca53d0478b28d344d60d70f9855d 100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -1933,12 +1933,8 @@ void LCodeGen::DoBranch(LBranch* instr) {
if (expected.Contains(ToBooleanStub::SIMD_VALUE)) {
// SIMD value -> true.
- Label not_simd;
- __ CompareInstanceType(map, scratch, FIRST_SIMD_VALUE_TYPE);
- __ B(lt, &not_simd);
- __ CompareInstanceType(map, scratch, LAST_SIMD_VALUE_TYPE);
- __ B(le, true_label);
- __ Bind(&not_simd);
+ __ CompareInstanceType(map, scratch, SIMD128_VALUE_TYPE);
+ __ B(eq, true_label);
}
if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) {
@@ -5997,68 +5993,19 @@ void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
__ Ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset));
EmitTestAndBranch(instr, eq, scratch, 1 << Map::kIsUndetectable);
- } else if (String::Equals(type_name, factory->float32x4_string())) {
- DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL));
- Register map = ToRegister(instr->temp1());
- Register scratch = ToRegister(instr->temp2());
-
- __ JumpIfSmi(value, false_label);
- __ CompareObjectType(value, map, scratch, FLOAT32X4_TYPE);
- EmitBranch(instr, eq);
-
- } else if (String::Equals(type_name, factory->int32x4_string())) {
- DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL));
- Register map = ToRegister(instr->temp1());
- Register scratch = ToRegister(instr->temp2());
-
- __ JumpIfSmi(value, false_label);
- __ CompareObjectType(value, map, scratch, INT32X4_TYPE);
- EmitBranch(instr, eq);
-
- } else if (String::Equals(type_name, factory->bool32x4_string())) {
- DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL));
- Register map = ToRegister(instr->temp1());
- Register scratch = ToRegister(instr->temp2());
-
- __ JumpIfSmi(value, false_label);
- __ CompareObjectType(value, map, scratch, BOOL32X4_TYPE);
- EmitBranch(instr, eq);
-
- } else if (String::Equals(type_name, factory->int16x8_string())) {
- DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL));
- Register map = ToRegister(instr->temp1());
- Register scratch = ToRegister(instr->temp2());
-
- __ JumpIfSmi(value, false_label);
- __ CompareObjectType(value, map, scratch, INT16X8_TYPE);
- EmitBranch(instr, eq);
-
- } else if (String::Equals(type_name, factory->bool16x8_string())) {
- DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL));
- Register map = ToRegister(instr->temp1());
- Register scratch = ToRegister(instr->temp2());
-
- __ JumpIfSmi(value, false_label);
- __ CompareObjectType(value, map, scratch, BOOL16X8_TYPE);
- EmitBranch(instr, eq);
-
- } else if (String::Equals(type_name, factory->int8x16_string())) {
- DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL));
- Register map = ToRegister(instr->temp1());
- Register scratch = ToRegister(instr->temp2());
-
- __ JumpIfSmi(value, false_label);
- __ CompareObjectType(value, map, scratch, INT8X16_TYPE);
- EmitBranch(instr, eq);
-
- } else if (String::Equals(type_name, factory->bool8x16_string())) {
- DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL));
- Register map = ToRegister(instr->temp1());
- Register scratch = ToRegister(instr->temp2());
-
- __ JumpIfSmi(value, false_label);
- __ CompareObjectType(value, map, scratch, BOOL8X16_TYPE);
+// clang-format off
+#define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
+ } else if (String::Equals(type_name, factory->type##_string())) { \
+ DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); \
+ Register map = ToRegister(instr->temp1()); \
+ \
+ __ JumpIfSmi(value, false_label); \
+ __ Ldr(map, FieldMemOperand(value, HeapObject::kMapOffset)); \
+ __ CompareRoot(map, Heap::k##Type##MapRootIndex); \
EmitBranch(instr, eq);
+ SIMD128_TYPES(SIMD128_TYPE)
+#undef SIMD128_TYPE
+ // clang-format on
} else {
__ B(false_label);
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698