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 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2205 addiu(at, zero_reg, -1); | 2205 addiu(at, zero_reg, -1); |
2206 dsrl(at, at, 1); // Load 2^62. | 2206 dsrl(at, at, 1); // Load 2^62. |
2207 dmfc1(result, scratch); | 2207 dmfc1(result, scratch); |
2208 xor_(result, result, at); | 2208 xor_(result, result, at); |
2209 Slt(result, zero_reg, result); | 2209 Slt(result, zero_reg, result); |
2210 } | 2210 } |
2211 | 2211 |
2212 bind(&fail); | 2212 bind(&fail); |
2213 } | 2213 } |
2214 | 2214 |
| 2215 void MacroAssembler::Madd_s(FPURegister fd, FPURegister fr, FPURegister fs, |
| 2216 FPURegister ft, FPURegister scratch) { |
| 2217 if (kArchVariant == kMips64r2) { |
| 2218 madd_s(fd, fr, fs, ft); |
| 2219 } else { |
| 2220 DCHECK(!fr.is(scratch) && !fs.is(scratch) && !ft.is(scratch)); |
| 2221 mul_s(scratch, fs, ft); |
| 2222 add_s(fd, fr, scratch); |
| 2223 } |
| 2224 } |
2215 | 2225 |
2216 void MacroAssembler::Madd_d(FPURegister fd, FPURegister fr, FPURegister fs, | 2226 void MacroAssembler::Madd_d(FPURegister fd, FPURegister fr, FPURegister fs, |
2217 FPURegister ft, FPURegister scratch) { | 2227 FPURegister ft, FPURegister scratch) { |
2218 if (0) { // TODO(plind): find reasonable arch-variant symbol names. | 2228 if (kArchVariant == kMips64r2) { |
2219 madd_d(fd, fr, fs, ft); | 2229 madd_d(fd, fr, fs, ft); |
2220 } else { | 2230 } else { |
2221 // Can not change source regs's value. | |
2222 DCHECK(!fr.is(scratch) && !fs.is(scratch) && !ft.is(scratch)); | 2231 DCHECK(!fr.is(scratch) && !fs.is(scratch) && !ft.is(scratch)); |
2223 mul_d(scratch, fs, ft); | 2232 mul_d(scratch, fs, ft); |
2224 add_d(fd, fr, scratch); | 2233 add_d(fd, fr, scratch); |
2225 } | 2234 } |
2226 } | 2235 } |
2227 | 2236 |
| 2237 void MacroAssembler::Msub_s(FPURegister fd, FPURegister fr, FPURegister fs, |
| 2238 FPURegister ft, FPURegister scratch) { |
| 2239 if (kArchVariant == kMips64r2) { |
| 2240 msub_s(fd, fr, fs, ft); |
| 2241 } else { |
| 2242 DCHECK(!fr.is(scratch) && !fs.is(scratch) && !ft.is(scratch)); |
| 2243 mul_s(scratch, fs, ft); |
| 2244 sub_s(fd, scratch, fr); |
| 2245 } |
| 2246 } |
| 2247 |
| 2248 void MacroAssembler::Msub_d(FPURegister fd, FPURegister fr, FPURegister fs, |
| 2249 FPURegister ft, FPURegister scratch) { |
| 2250 if (kArchVariant == kMips64r2) { |
| 2251 msub_d(fd, fr, fs, ft); |
| 2252 } else { |
| 2253 DCHECK(!fr.is(scratch) && !fs.is(scratch) && !ft.is(scratch)); |
| 2254 mul_d(scratch, fs, ft); |
| 2255 sub_d(fd, scratch, fr); |
| 2256 } |
| 2257 } |
2228 | 2258 |
2229 void MacroAssembler::BranchFCommon(SecondaryField sizeField, Label* target, | 2259 void MacroAssembler::BranchFCommon(SecondaryField sizeField, Label* target, |
2230 Label* nan, Condition cond, FPURegister cmp1, | 2260 Label* nan, Condition cond, FPURegister cmp1, |
2231 FPURegister cmp2, BranchDelaySlot bd) { | 2261 FPURegister cmp2, BranchDelaySlot bd) { |
2232 BlockTrampolinePoolScope block_trampoline_pool(this); | 2262 BlockTrampolinePoolScope block_trampoline_pool(this); |
2233 if (cond == al) { | 2263 if (cond == al) { |
2234 Branch(bd, target); | 2264 Branch(bd, target); |
2235 return; | 2265 return; |
2236 } | 2266 } |
2237 | 2267 |
(...skipping 4783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7021 if (mag.shift > 0) sra(result, result, mag.shift); | 7051 if (mag.shift > 0) sra(result, result, mag.shift); |
7022 srl(at, dividend, 31); | 7052 srl(at, dividend, 31); |
7023 Addu(result, result, Operand(at)); | 7053 Addu(result, result, Operand(at)); |
7024 } | 7054 } |
7025 | 7055 |
7026 | 7056 |
7027 } // namespace internal | 7057 } // namespace internal |
7028 } // namespace v8 | 7058 } // namespace v8 |
7029 | 7059 |
7030 #endif // V8_TARGET_ARCH_MIPS64 | 7060 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |