Index: src/ppc/lithium-codegen-ppc.cc |
diff --git a/src/ppc/lithium-codegen-ppc.cc b/src/ppc/lithium-codegen-ppc.cc |
index 75023a2c415a11cfb0270dc8e78fb13d829fca6f..c30147c18ab3e236b88611a54912be6c92c2d295 100644 |
--- a/src/ppc/lithium-codegen-ppc.cc |
+++ b/src/ppc/lithium-codegen-ppc.cc |
@@ -2306,11 +2306,8 @@ void LCodeGen::DoBranch(LBranch* instr) { |
if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
// SIMD value -> true. |
Label not_simd; |
- __ CompareInstanceType(map, ip, FIRST_SIMD_VALUE_TYPE); |
- __ blt(¬_simd); |
- __ CompareInstanceType(map, ip, LAST_SIMD_VALUE_TYPE); |
- __ ble(instr->TrueLabel(chunk_)); |
- __ bind(¬_simd); |
+ __ CompareInstanceType(map, ip, SIMD128_VALUE_TYPE); |
+ __ beq(instr->TrueLabel(chunk_)); |
} |
if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
@@ -5953,40 +5950,16 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, Label* false_label, |
__ cmpi(r0, Operand::Zero()); |
final_branch_condition = eq; |
- } else if (String::Equals(type_name, factory->float32x4_string())) { |
- __ JumpIfSmi(input, false_label); |
- __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE); |
- final_branch_condition = eq; |
- |
- } else if (String::Equals(type_name, factory->int32x4_string())) { |
- __ JumpIfSmi(input, false_label); |
- __ CompareObjectType(input, scratch, no_reg, INT32X4_TYPE); |
- final_branch_condition = eq; |
- |
- } else if (String::Equals(type_name, factory->bool32x4_string())) { |
- __ JumpIfSmi(input, false_label); |
- __ CompareObjectType(input, scratch, no_reg, BOOL32X4_TYPE); |
- final_branch_condition = eq; |
- |
- } else if (String::Equals(type_name, factory->int16x8_string())) { |
- __ JumpIfSmi(input, false_label); |
- __ CompareObjectType(input, scratch, no_reg, INT16X8_TYPE); |
- final_branch_condition = eq; |
- |
- } else if (String::Equals(type_name, factory->bool16x8_string())) { |
- __ JumpIfSmi(input, false_label); |
- __ CompareObjectType(input, scratch, no_reg, BOOL16X8_TYPE); |
- final_branch_condition = eq; |
- |
- } else if (String::Equals(type_name, factory->int8x16_string())) { |
- __ JumpIfSmi(input, false_label); |
- __ CompareObjectType(input, scratch, no_reg, INT8X16_TYPE); |
- final_branch_condition = eq; |
- |
- } else if (String::Equals(type_name, factory->bool8x16_string())) { |
- __ JumpIfSmi(input, false_label); |
- __ CompareObjectType(input, scratch, no_reg, BOOL8X16_TYPE); |
+// clang-format off |
+#define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
+ } else if (String::Equals(type_name, factory->type##_string())) { \ |
+ __ JumpIfSmi(input, false_label); \ |
+ __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
+ __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \ |
final_branch_condition = eq; |
+ SIMD128_TYPES(SIMD128_TYPE) |
+#undef SIMD128_TYPE |
+ // clang-format on |
} else { |
__ b(false_label); |