OLD | NEW |
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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_PPC | 8 #if V8_TARGET_ARCH_PPC |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2201 MovDoubleToInt64(scratch1, scratch2, input); | 2201 MovDoubleToInt64(scratch1, scratch2, input); |
2202 Label done; | 2202 Label done; |
2203 cmpi(scratch2, Operand::Zero()); | 2203 cmpi(scratch2, Operand::Zero()); |
2204 bne(&done); | 2204 bne(&done); |
2205 lis(scratch2, Operand(SIGN_EXT_IMM16(0x8000))); | 2205 lis(scratch2, Operand(SIGN_EXT_IMM16(0x8000))); |
2206 cmp(scratch1, scratch2); | 2206 cmp(scratch1, scratch2); |
2207 bind(&done); | 2207 bind(&done); |
2208 #endif | 2208 #endif |
2209 } | 2209 } |
2210 | 2210 |
2211 void MacroAssembler::TestHeapNumberIsMinusZero(Register input, | |
2212 Register scratch1, | |
2213 Register scratch2) { | |
2214 #if V8_TARGET_ARCH_PPC64 | |
2215 LoadP(scratch1, FieldMemOperand(input, HeapNumber::kValueOffset)); | |
2216 rotldi(scratch1, scratch1, 1); | |
2217 cmpi(scratch1, Operand(1)); | |
2218 #else | |
2219 lwz(scratch1, FieldMemOperand(input, HeapNumber::kExponentOffset)); | |
2220 lwz(scratch2, FieldMemOperand(input, HeapNumber::kMantissaOffset)); | |
2221 Label done; | |
2222 cmpi(scratch2, Operand::Zero()); | |
2223 bne(&done); | |
2224 lis(scratch2, Operand(SIGN_EXT_IMM16(0x8000))); | |
2225 cmp(scratch1, scratch2); | |
2226 bind(&done); | |
2227 #endif | |
2228 } | |
2229 | |
2230 void MacroAssembler::TestDoubleSign(DoubleRegister input, Register scratch) { | 2211 void MacroAssembler::TestDoubleSign(DoubleRegister input, Register scratch) { |
2231 #if V8_TARGET_ARCH_PPC64 | 2212 #if V8_TARGET_ARCH_PPC64 |
2232 MovDoubleToInt64(scratch, input); | 2213 MovDoubleToInt64(scratch, input); |
2233 #else | 2214 #else |
2234 MovDoubleHighToInt(scratch, input); | 2215 MovDoubleHighToInt(scratch, input); |
2235 #endif | 2216 #endif |
2236 cmpi(scratch, Operand::Zero()); | 2217 cmpi(scratch, Operand::Zero()); |
2237 } | 2218 } |
2238 | 2219 |
2239 void MacroAssembler::TestHeapNumberSign(Register input, Register scratch) { | 2220 void MacroAssembler::TestHeapNumberSign(Register input, Register scratch) { |
(...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4411 } | 4392 } |
4412 if (mag.shift > 0) srawi(result, result, mag.shift); | 4393 if (mag.shift > 0) srawi(result, result, mag.shift); |
4413 ExtractBit(r0, dividend, 31); | 4394 ExtractBit(r0, dividend, 31); |
4414 add(result, result, r0); | 4395 add(result, result, r0); |
4415 } | 4396 } |
4416 | 4397 |
4417 } // namespace internal | 4398 } // namespace internal |
4418 } // namespace v8 | 4399 } // namespace v8 |
4419 | 4400 |
4420 #endif // V8_TARGET_ARCH_PPC | 4401 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |