OLD | NEW |
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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
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 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2355 __ fstp(0); | 2355 __ fstp(0); |
2356 EmitFalseBranch(instr, no_condition); | 2356 EmitFalseBranch(instr, no_condition); |
2357 __ bind(&ok); | 2357 __ bind(&ok); |
2358 | 2358 |
2359 | 2359 |
2360 __ sub(esp, Immediate(kDoubleSize)); | 2360 __ sub(esp, Immediate(kDoubleSize)); |
2361 __ fstp_d(MemOperand(esp, 0)); | 2361 __ fstp_d(MemOperand(esp, 0)); |
2362 | 2362 |
2363 __ add(esp, Immediate(kDoubleSize)); | 2363 __ add(esp, Immediate(kDoubleSize)); |
2364 int offset = sizeof(kHoleNanUpper32); | 2364 int offset = sizeof(kHoleNanUpper32); |
2365 // x87 converts sNaN(0xfff7fffffff7ffff) to QNaN(0xfffffffffff7ffff), | 2365 __ cmp(MemOperand(esp, -offset), Immediate(kHoleNanUpper32)); |
2366 // so we check the upper with 0xffffffff for hole as a temporary fix. | |
2367 __ cmp(MemOperand(esp, -offset), Immediate(0xffffffff)); | |
2368 EmitBranch(instr, equal); | 2366 EmitBranch(instr, equal); |
2369 } | 2367 } |
2370 | 2368 |
2371 | 2369 |
2372 Condition LCodeGen::EmitIsString(Register input, | 2370 Condition LCodeGen::EmitIsString(Register input, |
2373 Register temp1, | 2371 Register temp1, |
2374 Label* is_not_string, | 2372 Label* is_not_string, |
2375 SmiCheck check_needed = INLINE_SMI_CHECK) { | 2373 SmiCheck check_needed = INLINE_SMI_CHECK) { |
2376 if (check_needed == INLINE_SMI_CHECK) { | 2374 if (check_needed == INLINE_SMI_CHECK) { |
2377 __ JumpIfSmi(input, is_not_string); | 2375 __ JumpIfSmi(input, is_not_string); |
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4098 instr->hydrogen()->key()->representation(), elements_kind, | 4096 instr->hydrogen()->key()->representation(), elements_kind, |
4099 instr->base_offset() + kPointerSize); | 4097 instr->base_offset() + kPointerSize); |
4100 | 4098 |
4101 Label no_special_nan_handling, done; | 4099 Label no_special_nan_handling, done; |
4102 X87Register value = ToX87Register(instr->value()); | 4100 X87Register value = ToX87Register(instr->value()); |
4103 X87Fxch(value); | 4101 X87Fxch(value); |
4104 __ lea(esp, Operand(esp, -kDoubleSize)); | 4102 __ lea(esp, Operand(esp, -kDoubleSize)); |
4105 __ fst_d(MemOperand(esp, 0)); | 4103 __ fst_d(MemOperand(esp, 0)); |
4106 __ lea(esp, Operand(esp, kDoubleSize)); | 4104 __ lea(esp, Operand(esp, kDoubleSize)); |
4107 int offset = sizeof(kHoleNanUpper32); | 4105 int offset = sizeof(kHoleNanUpper32); |
4108 // x87 converts sNaN(0xfff7fffffff7ffff) to QNaN(0xfffffffffff7ffff), | 4106 __ cmp(MemOperand(esp, -offset), Immediate(kHoleNanUpper32)); |
4109 // so we check the upper with 0xffffffff for hole as a temporary fix. | |
4110 __ cmp(MemOperand(esp, -offset), Immediate(0xffffffff)); | |
4111 __ j(not_equal, &no_special_nan_handling, Label::kNear); | 4107 __ j(not_equal, &no_special_nan_handling, Label::kNear); |
4112 __ mov(operand, Immediate(lower)); | 4108 __ mov(operand, Immediate(lower)); |
4113 __ mov(operand2, Immediate(upper)); | 4109 __ mov(operand2, Immediate(upper)); |
4114 __ jmp(&done, Label::kNear); | 4110 __ jmp(&done, Label::kNear); |
4115 | 4111 |
4116 __ bind(&no_special_nan_handling); | 4112 __ bind(&no_special_nan_handling); |
4117 __ fst_d(operand); | 4113 __ fst_d(operand); |
4118 __ bind(&done); | 4114 __ bind(&done); |
4119 } else { | 4115 } else { |
4120 Register value = ToRegister(instr->value()); | 4116 Register value = ToRegister(instr->value()); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4186 __ j(parity_odd, &no_special_nan_handling, Label::kNear); | 4182 __ j(parity_odd, &no_special_nan_handling, Label::kNear); |
4187 // All NaNs are Canonicalized to 0x7fffffffffffffff | 4183 // All NaNs are Canonicalized to 0x7fffffffffffffff |
4188 __ mov(double_store_operand, Immediate(0xffffffff)); | 4184 __ mov(double_store_operand, Immediate(0xffffffff)); |
4189 __ mov(double_store_operand2, Immediate(0x7fffffff)); | 4185 __ mov(double_store_operand2, Immediate(0x7fffffff)); |
4190 __ jmp(&done, Label::kNear); | 4186 __ jmp(&done, Label::kNear); |
4191 } else { | 4187 } else { |
4192 __ lea(esp, Operand(esp, -kDoubleSize)); | 4188 __ lea(esp, Operand(esp, -kDoubleSize)); |
4193 __ fst_d(MemOperand(esp, 0)); | 4189 __ fst_d(MemOperand(esp, 0)); |
4194 __ lea(esp, Operand(esp, kDoubleSize)); | 4190 __ lea(esp, Operand(esp, kDoubleSize)); |
4195 int offset = sizeof(kHoleNanUpper32); | 4191 int offset = sizeof(kHoleNanUpper32); |
4196 // x87 converts sNaN(0xfff7fffffff7ffff) to QNaN(0xfffffffffff7ffff), | 4192 __ cmp(MemOperand(esp, -offset), Immediate(kHoleNanUpper32)); |
4197 // so we check the upper with 0xffffffff for hole as a temporary fix. | |
4198 __ cmp(MemOperand(esp, -offset), Immediate(0xffffffff)); | |
4199 __ j(not_equal, &no_special_nan_handling, Label::kNear); | 4193 __ j(not_equal, &no_special_nan_handling, Label::kNear); |
4200 __ mov(double_store_operand, Immediate(lower)); | 4194 __ mov(double_store_operand, Immediate(lower)); |
4201 __ mov(double_store_operand2, Immediate(upper)); | 4195 __ mov(double_store_operand2, Immediate(upper)); |
4202 __ jmp(&done, Label::kNear); | 4196 __ jmp(&done, Label::kNear); |
4203 } | 4197 } |
4204 __ bind(&no_special_nan_handling); | 4198 __ bind(&no_special_nan_handling); |
4205 __ fst_d(double_store_operand); | 4199 __ fst_d(double_store_operand); |
4206 __ bind(&done); | 4200 __ bind(&done); |
4207 } | 4201 } |
4208 } | 4202 } |
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5872 __ bind(deferred->exit()); | 5866 __ bind(deferred->exit()); |
5873 __ bind(&done); | 5867 __ bind(&done); |
5874 } | 5868 } |
5875 | 5869 |
5876 #undef __ | 5870 #undef __ |
5877 | 5871 |
5878 } // namespace internal | 5872 } // namespace internal |
5879 } // namespace v8 | 5873 } // namespace v8 |
5880 | 5874 |
5881 #endif // V8_TARGET_ARCH_X87 | 5875 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |