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

Side by Side Diff: src/ppc/lithium-codegen-ppc.cc

Issue 1250733005: SIMD.js Add the other SIMD Phase 1 types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 } 2300 }
2301 2301
2302 if (expected.Contains(ToBooleanStub::SYMBOL)) { 2302 if (expected.Contains(ToBooleanStub::SYMBOL)) {
2303 // Symbol value -> true. 2303 // Symbol value -> true.
2304 __ CompareInstanceType(map, ip, SYMBOL_TYPE); 2304 __ CompareInstanceType(map, ip, SYMBOL_TYPE);
2305 __ beq(instr->TrueLabel(chunk_)); 2305 __ beq(instr->TrueLabel(chunk_));
2306 } 2306 }
2307 2307
2308 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { 2308 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) {
2309 // SIMD value -> true. 2309 // SIMD value -> true.
2310 __ CompareInstanceType(map, ip, FLOAT32X4_TYPE); 2310 Label not_simd;
2311 __ beq(instr->TrueLabel(chunk_)); 2311 __ CompareInstanceType(map, ip, FIRST_SIMD128_VALUE_TYPE);
2312 __ blt(&not_simd);
2313 __ CompareInstanceType(map, ip, LAST_SIMD128_VALUE_TYPE);
2314 __ ble(instr->TrueLabel(chunk_));
2315 __ bind(&not_simd);
2312 } 2316 }
2313 2317
2314 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { 2318 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) {
2315 // heap number -> false iff +0, -0, or NaN. 2319 // heap number -> false iff +0, -0, or NaN.
2316 Label not_heap_number; 2320 Label not_heap_number;
2317 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); 2321 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex);
2318 __ bne(&not_heap_number); 2322 __ bne(&not_heap_number);
2319 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); 2323 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset));
2320 // Test the double value. Zero and NaN are false. 2324 // Test the double value. Zero and NaN are false.
2321 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); 2325 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7);
(...skipping 3670 matching lines...) Expand 10 before | Expand all | Expand 10 after
5992 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); 5996 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset));
5993 __ ExtractBit(r0, scratch, Map::kIsUndetectable); 5997 __ ExtractBit(r0, scratch, Map::kIsUndetectable);
5994 __ cmpi(r0, Operand::Zero()); 5998 __ cmpi(r0, Operand::Zero());
5995 final_branch_condition = eq; 5999 final_branch_condition = eq;
5996 6000
5997 } else if (String::Equals(type_name, factory->float32x4_string())) { 6001 } else if (String::Equals(type_name, factory->float32x4_string())) {
5998 __ JumpIfSmi(input, false_label); 6002 __ JumpIfSmi(input, false_label);
5999 __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE); 6003 __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE);
6000 final_branch_condition = eq; 6004 final_branch_condition = eq;
6001 6005
6006 } else if (String::Equals(type_name, factory->int32x4_string())) {
6007 __ JumpIfSmi(input, false_label);
6008 __ CompareObjectType(input, scratch, no_reg, INT32X4_TYPE);
6009 final_branch_condition = eq;
6010
6011 } else if (String::Equals(type_name, factory->bool32x4_string())) {
6012 __ JumpIfSmi(input, false_label);
6013 __ CompareObjectType(input, scratch, no_reg, BOOL32X4_TYPE);
6014 final_branch_condition = eq;
6015
6016 } else if (String::Equals(type_name, factory->int16x8_string())) {
6017 __ JumpIfSmi(input, false_label);
6018 __ CompareObjectType(input, scratch, no_reg, INT16X8_TYPE);
6019 final_branch_condition = eq;
6020
6021 } else if (String::Equals(type_name, factory->bool16x8_string())) {
6022 __ JumpIfSmi(input, false_label);
6023 __ CompareObjectType(input, scratch, no_reg, BOOL16X8_TYPE);
6024 final_branch_condition = eq;
6025
6026 } else if (String::Equals(type_name, factory->int8x16_string())) {
6027 __ JumpIfSmi(input, false_label);
6028 __ CompareObjectType(input, scratch, no_reg, INT8X16_TYPE);
6029 final_branch_condition = eq;
6030
6031 } else if (String::Equals(type_name, factory->bool8x16_string())) {
6032 __ JumpIfSmi(input, false_label);
6033 __ CompareObjectType(input, scratch, no_reg, BOOL8X16_TYPE);
6034 final_branch_condition = eq;
6035
6002 } else { 6036 } else {
6003 __ b(false_label); 6037 __ b(false_label);
6004 } 6038 }
6005 6039
6006 return final_branch_condition; 6040 return final_branch_condition;
6007 } 6041 }
6008 6042
6009 6043
6010 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { 6044 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
6011 Register temp1 = ToRegister(instr->temp()); 6045 Register temp1 = ToRegister(instr->temp());
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
6299 __ Push(scope_info); 6333 __ Push(scope_info);
6300 __ push(ToRegister(instr->function())); 6334 __ push(ToRegister(instr->function()));
6301 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6335 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6302 RecordSafepoint(Safepoint::kNoLazyDeopt); 6336 RecordSafepoint(Safepoint::kNoLazyDeopt);
6303 } 6337 }
6304 6338
6305 6339
6306 #undef __ 6340 #undef __
6307 } // namespace internal 6341 } // namespace internal
6308 } // namespace v8 6342 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698