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

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

Issue 1219943002: Expose SIMD.Float32x4 type to Javascript. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't install SIMD object without the simd flag. Created 5 years, 5 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 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 __ b(instr->FalseLabel(chunk_)); 2297 __ b(instr->FalseLabel(chunk_));
2298 __ bind(&not_string); 2298 __ bind(&not_string);
2299 } 2299 }
2300 2300
2301 if (expected.Contains(ToBooleanStub::SYMBOL)) { 2301 if (expected.Contains(ToBooleanStub::SYMBOL)) {
2302 // Symbol value -> true. 2302 // Symbol value -> true.
2303 __ CompareInstanceType(map, ip, SYMBOL_TYPE); 2303 __ CompareInstanceType(map, ip, SYMBOL_TYPE);
2304 __ beq(instr->TrueLabel(chunk_)); 2304 __ beq(instr->TrueLabel(chunk_));
2305 } 2305 }
2306 2306
2307 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) {
2308 // SIMD value -> true.
2309 __ CompareInstanceType(map, ip, FLOAT32X4_TYPE);
2310 __ beq(instr->TrueLabel(chunk_));
2311 }
2312
2307 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { 2313 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) {
2308 // heap number -> false iff +0, -0, or NaN. 2314 // heap number -> false iff +0, -0, or NaN.
2309 Label not_heap_number; 2315 Label not_heap_number;
2310 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); 2316 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex);
2311 __ bne(&not_heap_number); 2317 __ bne(&not_heap_number);
2312 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); 2318 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset));
2313 // Test the double value. Zero and NaN are false. 2319 // Test the double value. Zero and NaN are false.
2314 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); 2320 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7);
2315 __ mfcr(r0); 2321 __ mfcr(r0);
2316 __ andi(r0, r0, Operand(crZOrNaNBits)); 2322 __ andi(r0, r0, Operand(crZOrNaNBits));
(...skipping 3642 matching lines...) Expand 10 before | Expand all | Expand 10 after
5959 __ CompareRoot(input, Heap::kNullValueRootIndex); 5965 __ CompareRoot(input, Heap::kNullValueRootIndex);
5960 __ beq(true_label); 5966 __ beq(true_label);
5961 __ CheckObjectTypeRange(input, map, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, 5967 __ CheckObjectTypeRange(input, map, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE,
5962 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label); 5968 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label);
5963 // Check for undetectable objects => false. 5969 // Check for undetectable objects => false.
5964 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); 5970 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset));
5965 __ ExtractBit(r0, scratch, Map::kIsUndetectable); 5971 __ ExtractBit(r0, scratch, Map::kIsUndetectable);
5966 __ cmpi(r0, Operand::Zero()); 5972 __ cmpi(r0, Operand::Zero());
5967 final_branch_condition = eq; 5973 final_branch_condition = eq;
5968 5974
5975 } else if (String::Equals(type_name, factory->float32x4_string())) {
5976 __ JumpIfSmi(input, false_label);
5977 __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE);
5978 final_branch_condition = eq;
5979
5969 } else { 5980 } else {
5970 __ b(false_label); 5981 __ b(false_label);
5971 } 5982 }
5972 5983
5973 return final_branch_condition; 5984 return final_branch_condition;
5974 } 5985 }
5975 5986
5976 5987
5977 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { 5988 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
5978 Register temp1 = ToRegister(instr->temp()); 5989 Register temp1 = ToRegister(instr->temp());
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
6266 __ Push(scope_info); 6277 __ Push(scope_info);
6267 __ push(ToRegister(instr->function())); 6278 __ push(ToRegister(instr->function()));
6268 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6279 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6269 RecordSafepoint(Safepoint::kNoLazyDeopt); 6280 RecordSafepoint(Safepoint::kNoLazyDeopt);
6270 } 6281 }
6271 6282
6272 6283
6273 #undef __ 6284 #undef __
6274 } // namespace internal 6285 } // namespace internal
6275 } // namespace v8 6286 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698