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

Side by Side Diff: src/mips64/macro-assembler-mips64.h

Issue 1694833002: MIPS: Support r6 max, min floating point instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 8 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 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ 5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/globals.h" 9 #include "src/globals.h"
10 #include "src/mips64/assembler-mips64.h" 10 #include "src/mips64/assembler-mips64.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 Condition cond, 258 Condition cond,
259 Register reg, 259 Register reg,
260 const Operand& op); 260 const Operand& op);
261 261
262 // Swap two registers. If the scratch register is omitted then a slightly 262 // Swap two registers. If the scratch register is omitted then a slightly
263 // less efficient form using xor instead of mov is emitted. 263 // less efficient form using xor instead of mov is emitted.
264 void Swap(Register reg1, Register reg2, Register scratch = no_reg); 264 void Swap(Register reg1, Register reg2, Register scratch = no_reg);
265 265
266 void Call(Label* target); 266 void Call(Label* target);
267 267
268 void Move(Register dst, Handle<Object> handle) { li(dst, handle); } 268 inline void Move(Register dst, Handle<Object> handle) { li(dst, handle); }
269 void Move(Register dst, Smi* smi) { li(dst, Operand(smi)); } 269 inline void Move(Register dst, Smi* smi) { li(dst, Operand(smi)); }
270 270
271 inline void Move(Register dst, Register src) { 271 inline void Move(Register dst, Register src) {
272 if (!dst.is(src)) { 272 if (!dst.is(src)) {
273 mov(dst, src); 273 mov(dst, src);
274 } 274 }
275 } 275 }
276 276
277 inline void Move(FPURegister dst, FPURegister src) { 277 inline void Move_d(FPURegister dst, FPURegister src) {
278 if (!dst.is(src)) { 278 if (!dst.is(src)) {
279 mov_d(dst, src); 279 mov_d(dst, src);
280 } 280 }
281 } 281 }
282 282
283 inline void Move_s(FPURegister dst, FPURegister src) {
284 if (!dst.is(src)) {
285 mov_s(dst, src);
286 }
287 }
288
289 inline void Move(FPURegister dst, FPURegister src) { Move_d(dst, src); }
290
283 inline void Move(Register dst_low, Register dst_high, FPURegister src) { 291 inline void Move(Register dst_low, Register dst_high, FPURegister src) {
284 mfc1(dst_low, src); 292 mfc1(dst_low, src);
285 mfhc1(dst_high, src); 293 mfhc1(dst_high, src);
286 } 294 }
287 295
296 inline void Move(Register dst, FPURegister src) { dmfc1(dst, src); }
297
298 inline void Move(FPURegister dst, Register src) { dmtc1(src, dst); }
299
288 inline void FmoveHigh(Register dst_high, FPURegister src) { 300 inline void FmoveHigh(Register dst_high, FPURegister src) {
289 mfhc1(dst_high, src); 301 mfhc1(dst_high, src);
290 } 302 }
291 303
292 inline void FmoveHigh(FPURegister dst, Register src_high) { 304 inline void FmoveHigh(FPURegister dst, Register src_high) {
293 mthc1(src_high, dst); 305 mthc1(src_high, dst);
294 } 306 }
295 307
296 inline void FmoveLow(Register dst_low, FPURegister src) { 308 inline void FmoveLow(Register dst_low, FPURegister src) {
297 mfc1(dst_low, src); 309 mfc1(dst_low, src);
298 } 310 }
299 311
300 void FmoveLow(FPURegister dst, Register src_low); 312 void FmoveLow(FPURegister dst, Register src_low);
301 313
302 inline void Move(FPURegister dst, Register src_low, Register src_high) { 314 inline void Move(FPURegister dst, Register src_low, Register src_high) {
303 mtc1(src_low, dst); 315 mtc1(src_low, dst);
304 mthc1(src_high, dst); 316 mthc1(src_high, dst);
305 } 317 }
306 318
307 void Move(FPURegister dst, float imm); 319 void Move(FPURegister dst, float imm);
308 void Move(FPURegister dst, double imm); 320 void Move(FPURegister dst, double imm);
309 321
310 // Conditional move. 322 // Conditional move.
311 void Movz(Register rd, Register rs, Register rt); 323 void Movz(Register rd, Register rs, Register rt);
312 void Movn(Register rd, Register rs, Register rt); 324 void Movn(Register rd, Register rs, Register rt);
313 void Movt(Register rd, Register rs, uint16_t cc = 0); 325 void Movt(Register rd, Register rs, uint16_t cc = 0);
314 void Movf(Register rd, Register rs, uint16_t cc = 0); 326 void Movf(Register rd, Register rs, uint16_t cc = 0);
315 327
328 // Min, Max macros.
329 // On pre-r6 these functions may modify at and t8 registers.
330 void MinNaNCheck_d(FPURegister dst, FPURegister src1, FPURegister src2,
331 Label* nan = nullptr);
332 void MaxNaNCheck_d(FPURegister dst, FPURegister src1, FPURegister src2,
333 Label* nan = nullptr);
334 void MinNaNCheck_s(FPURegister dst, FPURegister src1, FPURegister src2,
335 Label* nan = nullptr);
336 void MaxNaNCheck_s(FPURegister dst, FPURegister src1, FPURegister src2,
337 Label* nan = nullptr);
338
316 void Clz(Register rd, Register rs); 339 void Clz(Register rd, Register rs);
317 340
318 // Jump unconditionally to given label. 341 // Jump unconditionally to given label.
319 // We NEED a nop in the branch delay slot, as it used by v8, for example in 342 // We NEED a nop in the branch delay slot, as it used by v8, for example in
320 // CodeGenerator::ProcessDeferred(). 343 // CodeGenerator::ProcessDeferred().
321 // Currently the branch delay slot is filled by the MacroAssembler. 344 // Currently the branch delay slot is filled by the MacroAssembler.
322 // Use rather b(Label) for code generation. 345 // Use rather b(Label) for code generation.
323 void jmp(Label* L) { 346 void jmp(Label* L) {
324 Branch(L); 347 Branch(L);
325 } 348 }
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) 2012 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__)
1990 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> 2013 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm->
1991 #else 2014 #else
1992 #define ACCESS_MASM(masm) masm-> 2015 #define ACCESS_MASM(masm) masm->
1993 #endif 2016 #endif
1994 2017
1995 } // namespace internal 2018 } // namespace internal
1996 } // namespace v8 2019 } // namespace v8
1997 2020
1998 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ 2021 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698