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

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

Issue 1219943002: Expose SIMD.Float32x4 type to Javascript. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after
2427 __ jmp(instr->FalseLabel(chunk_)); 2427 __ jmp(instr->FalseLabel(chunk_));
2428 __ bind(&not_string); 2428 __ bind(&not_string);
2429 } 2429 }
2430 2430
2431 if (expected.Contains(ToBooleanStub::SYMBOL)) { 2431 if (expected.Contains(ToBooleanStub::SYMBOL)) {
2432 // Symbol value -> true. 2432 // Symbol value -> true.
2433 __ CmpInstanceType(map, SYMBOL_TYPE); 2433 __ CmpInstanceType(map, SYMBOL_TYPE);
2434 __ j(equal, instr->TrueLabel(chunk_)); 2434 __ j(equal, instr->TrueLabel(chunk_));
2435 } 2435 }
2436 2436
2437 if (expected.Contains(ToBooleanStub::SIMD_TYPE)) {
2438 // SIMD value -> true.
2439 __ CmpInstanceType(map, FLOAT32X4_TYPE);
2440 __ j(equal, instr->TrueLabel(chunk_));
2441 }
2442
2437 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { 2443 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) {
2438 // heap number -> false iff +0, -0, or NaN. 2444 // heap number -> false iff +0, -0, or NaN.
2439 Label not_heap_number; 2445 Label not_heap_number;
2440 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), 2446 __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
2441 factory()->heap_number_map()); 2447 factory()->heap_number_map());
2442 __ j(not_equal, &not_heap_number, Label::kNear); 2448 __ j(not_equal, &not_heap_number, Label::kNear);
2443 __ fldz(); 2449 __ fldz();
2444 __ fld_d(FieldOperand(reg, HeapNumber::kValueOffset)); 2450 __ fld_d(FieldOperand(reg, HeapNumber::kValueOffset));
2445 __ FCmp(); 2451 __ FCmp();
2446 __ j(zero, instr->FalseLabel(chunk_)); 2452 __ j(zero, instr->FalseLabel(chunk_));
(...skipping 3643 matching lines...) Expand 10 before | Expand all | Expand 10 after
6090 __ j(equal, true_label, true_distance); 6096 __ j(equal, true_label, true_distance);
6091 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); 6097 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input);
6092 __ j(below, false_label, false_distance); 6098 __ j(below, false_label, false_distance);
6093 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 6099 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE);
6094 __ j(above, false_label, false_distance); 6100 __ j(above, false_label, false_distance);
6095 // Check for undetectable objects => false. 6101 // Check for undetectable objects => false.
6096 __ test_b(FieldOperand(input, Map::kBitFieldOffset), 6102 __ test_b(FieldOperand(input, Map::kBitFieldOffset),
6097 1 << Map::kIsUndetectable); 6103 1 << Map::kIsUndetectable);
6098 final_branch_condition = zero; 6104 final_branch_condition = zero;
6099 6105
6106 } else if (String::Equals(type_name, factory()->float32x4_string())) {
6107 __ JumpIfSmi(input, false_label, false_distance);
6108 __ CmpObjectType(input, FLOAT32X4_TYPE, input);
6109 final_branch_condition = equal;
6110
6100 } else { 6111 } else {
6101 __ jmp(false_label, false_distance); 6112 __ jmp(false_label, false_distance);
6102 } 6113 }
6103 return final_branch_condition; 6114 return final_branch_condition;
6104 } 6115 }
6105 6116
6106 6117
6107 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { 6118 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
6108 Register temp = ToRegister(instr->temp()); 6119 Register temp = ToRegister(instr->temp());
6109 6120
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
6398 RecordSafepoint(Safepoint::kNoLazyDeopt); 6409 RecordSafepoint(Safepoint::kNoLazyDeopt);
6399 } 6410 }
6400 6411
6401 6412
6402 #undef __ 6413 #undef __
6403 6414
6404 } // namespace internal 6415 } // namespace internal
6405 } // namespace v8 6416 } // namespace v8
6406 6417
6407 #endif // V8_TARGET_ARCH_X87 6418 #endif // V8_TARGET_ARCH_X87
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698