&if_false, &fall_through);
__ JumpIfSmi(r3, if_false);
- Register map = r4;
- Register type_reg = r5;
- __ LoadP(map, FieldMemOperand(r3, HeapObject::kMapOffset));
- __ lbz(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
- __ subi(type_reg, type_reg, Operand(FIRST_SIMD_VALUE_TYPE));
- __ cmpli(type_reg, Operand(LAST_SIMD_VALUE_TYPE - FIRST_SIMD_VALUE_TYPE));
+ __ CompareObjectType(r3, r4, r4, SIMD128_VALUE_TYPE);
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
- Split(le, if_true, if_false, fall_through);
+ Split(eq, if_true, if_false, fall_through);
context()->Plug(if_true, if_false);
}
__ JumpIfSmi(r3, if_false);
__ CompareObjectType(r3, r3, r4, SYMBOL_TYPE);
Split(eq, if_true, if_false, fall_through);
- } else if (String::Equals(check, factory->float32x4_string())) {
- __ JumpIfSmi(r3, if_false);
- __ CompareObjectType(r3, r3, r4, FLOAT32X4_TYPE);
- Split(eq, if_true, if_false, fall_through);
- } else if (String::Equals(check, factory->int32x4_string())) {
- __ JumpIfSmi(r3, if_false);
- __ CompareObjectType(r3, r3, r4, INT32X4_TYPE);
- Split(eq, if_true, if_false, fall_through);
- } else if (String::Equals(check, factory->bool32x4_string())) {
- __ JumpIfSmi(r3, if_false);
- __ CompareObjectType(r3, r3, r4, BOOL32X4_TYPE);
- Split(eq, if_true, if_false, fall_through);
- } else if (String::Equals(check, factory->int16x8_string())) {
- __ JumpIfSmi(r3, if_false);
- __ CompareObjectType(r3, r3, r4, INT16X8_TYPE);
- Split(eq, if_true, if_false, fall_through);
- } else if (String::Equals(check, factory->bool16x8_string())) {
- __ JumpIfSmi(r3, if_false);
- __ CompareObjectType(r3, r3, r4, BOOL16X8_TYPE);
- Split(eq, if_true, if_false, fall_through);
- } else if (String::Equals(check, factory->int8x16_string())) {
- __ JumpIfSmi(r3, if_false);
- __ CompareObjectType(r3, r3, r4, INT8X16_TYPE);
- Split(eq, if_true, if_false, fall_through);
- } else if (String::Equals(check, factory->bool8x16_string())) {
- __ JumpIfSmi(r3, if_false);
- __ CompareObjectType(r3, r3, r4, BOOL8X16_TYPE);
- Split(eq, if_true, if_false, fall_through);
} else if (String::Equals(check, factory->boolean_string())) {
__ CompareRoot(r3, Heap::kTrueValueRootIndex);
__ beq(if_true);
__ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset));
__ andi(r0, r4, Operand(1 << Map::kIsUndetectable));
Split(eq, if_true, if_false, fall_through, cr0);
+// clang-format off
+#define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
+ } else if (String::Equals(check, factory->type##_string())) { \
+ __ JumpIfSmi(r3, if_false); \
+ __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); \
+ __ CompareRoot(r3, Heap::k##Type##MapRootIndex); \
+ Split(eq, if_true, if_false, fall_through);
+ SIMD128_TYPES(SIMD128_TYPE)
+#undef SIMD128_TYPE
+ // clang-format on
} else {
if (if_false != fall_through) __ b(if_false);
}
// They are both equal and they are not both Smis so both of them are not
// Smis. If it's not a heap number, then return equal.
if (cond == lt || cond == gt) {
- Label not_simd;
// Call runtime on identical JSObjects.
__ CompareObjectType(r3, r7, r7, FIRST_SPEC_OBJECT_TYPE);
__ bge(slow);
__ cmpi(r7, Operand(SYMBOL_TYPE));
__ beq(slow);
// Call runtime on identical SIMD values since we must throw a TypeError.
- __ cmpi(r7, Operand(FIRST_SIMD_VALUE_TYPE));
- __ blt(¬_simd);
- __ cmpi(r7, Operand(LAST_SIMD_VALUE_TYPE));
- __ ble(slow);
- __ bind(¬_simd);
+ __ cmpi(r7, Operand(SIMD128_VALUE_TYPE));
+ __ beq(slow);
if (is_strong(strength)) {
// Call the runtime on anything that is converted in the semantics, since
// we need to throw a TypeError. Smis have already been ruled out.
__ beq(&heap_number);
// Comparing JS objects with <=, >= is complicated.
if (cond != eq) {
- Label not_simd;
__ cmpi(r7, Operand(FIRST_SPEC_OBJECT_TYPE));
__ bge(slow);
// Call runtime on identical symbols since we need to throw a TypeError.
__ cmpi(r7, Operand(SYMBOL_TYPE));
__ beq(slow);
// Call runtime on identical SIMD values since we must throw a TypeError.
- __ cmpi(r7, Operand(FIRST_SIMD_VALUE_TYPE));
- __ blt(¬_simd);
- __ cmpi(r7, Operand(LAST_SIMD_VALUE_TYPE));
- __ ble(slow);
- __ bind(¬_simd);
+ __ cmpi(r7, Operand(SIMD128_VALUE_TYPE));
+ __ beq(slow);
if (is_strong(strength)) {
// Call the runtime on anything that is converted in the semantics,
// since we need to throw a TypeError. Smis and heap numbers have
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)) {
__ 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);