OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 5 #ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 V(Ldrb, Register&, rt, LDRB_w) \ | 36 V(Ldrb, Register&, rt, LDRB_w) \ |
37 V(Strb, Register&, rt, STRB_w) \ | 37 V(Strb, Register&, rt, STRB_w) \ |
38 V(Ldrsb, Register&, rt, rt.Is64Bits() ? LDRSB_x : LDRSB_w) \ | 38 V(Ldrsb, Register&, rt, rt.Is64Bits() ? LDRSB_x : LDRSB_w) \ |
39 V(Ldrh, Register&, rt, LDRH_w) \ | 39 V(Ldrh, Register&, rt, LDRH_w) \ |
40 V(Strh, Register&, rt, STRH_w) \ | 40 V(Strh, Register&, rt, STRH_w) \ |
41 V(Ldrsh, Register&, rt, rt.Is64Bits() ? LDRSH_x : LDRSH_w) \ | 41 V(Ldrsh, Register&, rt, rt.Is64Bits() ? LDRSH_x : LDRSH_w) \ |
42 V(Ldr, CPURegister&, rt, LoadOpFor(rt)) \ | 42 V(Ldr, CPURegister&, rt, LoadOpFor(rt)) \ |
43 V(Str, CPURegister&, rt, StoreOpFor(rt)) \ | 43 V(Str, CPURegister&, rt, StoreOpFor(rt)) \ |
44 V(Ldrsw, Register&, rt, LDRSW_x) | 44 V(Ldrsw, Register&, rt, LDRSW_x) |
45 | 45 |
| 46 #define LSPAIR_MACRO_LIST(V) \ |
| 47 V(Ldp, CPURegister&, rt, rt2, LoadPairOpFor(rt, rt2)) \ |
| 48 V(Stp, CPURegister&, rt, rt2, StorePairOpFor(rt, rt2)) \ |
| 49 V(Ldpsw, CPURegister&, rt, rt2, LDPSW_x) |
| 50 |
46 | 51 |
47 // ---------------------------------------------------------------------------- | 52 // ---------------------------------------------------------------------------- |
48 // Static helper functions | 53 // Static helper functions |
49 | 54 |
50 // Generate a MemOperand for loading a field from an object. | 55 // Generate a MemOperand for loading a field from an object. |
51 inline MemOperand FieldMemOperand(Register object, int offset); | 56 inline MemOperand FieldMemOperand(Register object, int offset); |
52 inline MemOperand UntagSmiFieldMemOperand(Register object, int offset); | 57 inline MemOperand UntagSmiFieldMemOperand(Register object, int offset); |
53 | 58 |
54 // Generate a MemOperand for loading a SMI from memory. | 59 // Generate a MemOperand for loading a SMI from memory. |
55 inline MemOperand UntagSmiMemOperand(Register object, int offset); | 60 inline MemOperand UntagSmiMemOperand(Register object, int offset); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // Load/store macros. | 259 // Load/store macros. |
255 #define DECLARE_FUNCTION(FN, REGTYPE, REG, OP) \ | 260 #define DECLARE_FUNCTION(FN, REGTYPE, REG, OP) \ |
256 inline void FN(const REGTYPE REG, const MemOperand& addr); | 261 inline void FN(const REGTYPE REG, const MemOperand& addr); |
257 LS_MACRO_LIST(DECLARE_FUNCTION) | 262 LS_MACRO_LIST(DECLARE_FUNCTION) |
258 #undef DECLARE_FUNCTION | 263 #undef DECLARE_FUNCTION |
259 | 264 |
260 void LoadStoreMacro(const CPURegister& rt, | 265 void LoadStoreMacro(const CPURegister& rt, |
261 const MemOperand& addr, | 266 const MemOperand& addr, |
262 LoadStoreOp op); | 267 LoadStoreOp op); |
263 | 268 |
| 269 #define DECLARE_FUNCTION(FN, REGTYPE, REG, REG2, OP) \ |
| 270 inline void FN(const REGTYPE REG, const REGTYPE REG2, const MemOperand& addr); |
| 271 LSPAIR_MACRO_LIST(DECLARE_FUNCTION) |
| 272 #undef DECLARE_FUNCTION |
| 273 |
| 274 void LoadStorePairMacro(const CPURegister& rt, const CPURegister& rt2, |
| 275 const MemOperand& addr, LoadStorePairOp op); |
| 276 |
264 // V8-specific load/store helpers. | 277 // V8-specific load/store helpers. |
265 void Load(const Register& rt, const MemOperand& addr, Representation r); | 278 void Load(const Register& rt, const MemOperand& addr, Representation r); |
266 void Store(const Register& rt, const MemOperand& addr, Representation r); | 279 void Store(const Register& rt, const MemOperand& addr, Representation r); |
267 | 280 |
268 enum AdrHint { | 281 enum AdrHint { |
269 // The target must be within the immediate range of adr. | 282 // The target must be within the immediate range of adr. |
270 kAdrNear, | 283 kAdrNear, |
271 // The target may be outside of the immediate range of adr. Additional | 284 // The target may be outside of the immediate range of adr. Additional |
272 // instructions may be emitted. | 285 // instructions may be emitted. |
273 kAdrFar | 286 kAdrFar |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 inline void Fsqrt(const FPRegister& fd, const FPRegister& fn); | 424 inline void Fsqrt(const FPRegister& fd, const FPRegister& fn); |
412 inline void Fsub(const FPRegister& fd, | 425 inline void Fsub(const FPRegister& fd, |
413 const FPRegister& fn, | 426 const FPRegister& fn, |
414 const FPRegister& fm); | 427 const FPRegister& fm); |
415 inline void Hint(SystemHint code); | 428 inline void Hint(SystemHint code); |
416 inline void Hlt(int code); | 429 inline void Hlt(int code); |
417 inline void Isb(); | 430 inline void Isb(); |
418 inline void Ldnp(const CPURegister& rt, | 431 inline void Ldnp(const CPURegister& rt, |
419 const CPURegister& rt2, | 432 const CPURegister& rt2, |
420 const MemOperand& src); | 433 const MemOperand& src); |
421 inline void Ldp(const CPURegister& rt, | |
422 const CPURegister& rt2, | |
423 const MemOperand& src); | |
424 inline void Ldpsw(const Register& rt, | |
425 const Register& rt2, | |
426 const MemOperand& src); | |
427 // Load a literal from the inline constant pool. | 434 // Load a literal from the inline constant pool. |
428 inline void Ldr(const CPURegister& rt, const Immediate& imm); | 435 inline void Ldr(const CPURegister& rt, const Immediate& imm); |
429 // Helper function for double immediate. | 436 // Helper function for double immediate. |
430 inline void Ldr(const CPURegister& rt, double imm); | 437 inline void Ldr(const CPURegister& rt, double imm); |
431 inline void Lsl(const Register& rd, const Register& rn, unsigned shift); | 438 inline void Lsl(const Register& rd, const Register& rn, unsigned shift); |
432 inline void Lsl(const Register& rd, const Register& rn, const Register& rm); | 439 inline void Lsl(const Register& rd, const Register& rn, const Register& rm); |
433 inline void Lsr(const Register& rd, const Register& rn, unsigned shift); | 440 inline void Lsr(const Register& rd, const Register& rn, unsigned shift); |
434 inline void Lsr(const Register& rd, const Register& rn, const Register& rm); | 441 inline void Lsr(const Register& rd, const Register& rn, const Register& rm); |
435 inline void Madd(const Register& rd, | 442 inline void Madd(const Register& rd, |
436 const Register& rn, | 443 const Register& rn, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 const Register& ra); | 483 const Register& ra); |
477 inline void Smull(const Register& rd, | 484 inline void Smull(const Register& rd, |
478 const Register& rn, | 485 const Register& rn, |
479 const Register& rm); | 486 const Register& rm); |
480 inline void Smulh(const Register& rd, | 487 inline void Smulh(const Register& rd, |
481 const Register& rn, | 488 const Register& rn, |
482 const Register& rm); | 489 const Register& rm); |
483 inline void Stnp(const CPURegister& rt, | 490 inline void Stnp(const CPURegister& rt, |
484 const CPURegister& rt2, | 491 const CPURegister& rt2, |
485 const MemOperand& dst); | 492 const MemOperand& dst); |
486 inline void Stp(const CPURegister& rt, | |
487 const CPURegister& rt2, | |
488 const MemOperand& dst); | |
489 inline void Sxtb(const Register& rd, const Register& rn); | 493 inline void Sxtb(const Register& rd, const Register& rn); |
490 inline void Sxth(const Register& rd, const Register& rn); | 494 inline void Sxth(const Register& rd, const Register& rn); |
491 inline void Sxtw(const Register& rd, const Register& rn); | 495 inline void Sxtw(const Register& rd, const Register& rn); |
492 void Tbnz(const Register& rt, unsigned bit_pos, Label* label); | 496 void Tbnz(const Register& rt, unsigned bit_pos, Label* label); |
493 void Tbz(const Register& rt, unsigned bit_pos, Label* label); | 497 void Tbz(const Register& rt, unsigned bit_pos, Label* label); |
494 inline void Ubfiz(const Register& rd, | 498 inline void Ubfiz(const Register& rd, |
495 const Register& rn, | 499 const Register& rn, |
496 unsigned lsb, | 500 unsigned lsb, |
497 unsigned width); | 501 unsigned width); |
498 inline void Ubfx(const Register& rd, | 502 inline void Ubfx(const Register& rd, |
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2350 #error "Unsupported option" | 2354 #error "Unsupported option" |
2351 #define CODE_COVERAGE_STRINGIFY(x) #x | 2355 #define CODE_COVERAGE_STRINGIFY(x) #x |
2352 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 2356 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
2353 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 2357 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
2354 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 2358 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
2355 #else | 2359 #else |
2356 #define ACCESS_MASM(masm) masm-> | 2360 #define ACCESS_MASM(masm) masm-> |
2357 #endif | 2361 #endif |
2358 | 2362 |
2359 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 2363 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
OLD | NEW |