1 /*---------------------------------------------------------------*/
2 /*--- begin host_arm_defs.h ---*/
3 /*---------------------------------------------------------------*/
6 This file is part of Valgrind, a dynamic binary instrumentation
9 Copyright (C) 2004-2017 OpenWorks LLP
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version.
17 This program is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, see <http://www.gnu.org/licenses/>.
25 The GNU General Public License is contained in the file COPYING.
28 #ifndef __VEX_HOST_ARM_DEFS_H
29 #define __VEX_HOST_ARM_DEFS_H
31 #include "libvex_basictypes.h"
32 #include "libvex.h" // VexArch
33 #include "host_generic_regs.h" // HReg
35 extern UInt arm_hwcaps
;
38 /* --------- Registers. --------- */
40 #define ST_IN static inline
41 ST_IN HReg
hregARM_R4 ( void ) { return mkHReg(False
, HRcInt32
, 4, 0); }
42 ST_IN HReg
hregARM_R5 ( void ) { return mkHReg(False
, HRcInt32
, 5, 1); }
43 ST_IN HReg
hregARM_R6 ( void ) { return mkHReg(False
, HRcInt32
, 6, 2); }
44 ST_IN HReg
hregARM_R7 ( void ) { return mkHReg(False
, HRcInt32
, 7, 3); }
45 ST_IN HReg
hregARM_R10 ( void ) { return mkHReg(False
, HRcInt32
, 10, 4); }
46 ST_IN HReg
hregARM_R11 ( void ) { return mkHReg(False
, HRcInt32
, 11, 5); }
48 ST_IN HReg
hregARM_R0 ( void ) { return mkHReg(False
, HRcInt32
, 0, 6); }
49 ST_IN HReg
hregARM_R1 ( void ) { return mkHReg(False
, HRcInt32
, 1, 7); }
50 ST_IN HReg
hregARM_R2 ( void ) { return mkHReg(False
, HRcInt32
, 2, 8); }
51 ST_IN HReg
hregARM_R3 ( void ) { return mkHReg(False
, HRcInt32
, 3, 9); }
52 ST_IN HReg
hregARM_R9 ( void ) { return mkHReg(False
, HRcInt32
, 9, 10); }
54 ST_IN HReg
hregARM_D8 ( void ) { return mkHReg(False
, HRcFlt64
, 8, 11); }
55 ST_IN HReg
hregARM_D9 ( void ) { return mkHReg(False
, HRcFlt64
, 9, 12); }
56 ST_IN HReg
hregARM_D10 ( void ) { return mkHReg(False
, HRcFlt64
, 10, 13); }
57 ST_IN HReg
hregARM_D11 ( void ) { return mkHReg(False
, HRcFlt64
, 11, 14); }
58 ST_IN HReg
hregARM_D12 ( void ) { return mkHReg(False
, HRcFlt64
, 12, 15); }
60 ST_IN HReg
hregARM_S26 ( void ) { return mkHReg(False
, HRcFlt32
, 26, 16); }
61 ST_IN HReg
hregARM_S27 ( void ) { return mkHReg(False
, HRcFlt32
, 27, 17); }
62 ST_IN HReg
hregARM_S28 ( void ) { return mkHReg(False
, HRcFlt32
, 28, 18); }
63 ST_IN HReg
hregARM_S29 ( void ) { return mkHReg(False
, HRcFlt32
, 29, 19); }
64 ST_IN HReg
hregARM_S30 ( void ) { return mkHReg(False
, HRcFlt32
, 30, 20); }
66 ST_IN HReg
hregARM_Q8 ( void ) { return mkHReg(False
, HRcVec128
, 8, 21); }
67 ST_IN HReg
hregARM_Q9 ( void ) { return mkHReg(False
, HRcVec128
, 9, 22); }
68 ST_IN HReg
hregARM_Q10 ( void ) { return mkHReg(False
, HRcVec128
, 10, 23); }
69 ST_IN HReg
hregARM_Q11 ( void ) { return mkHReg(False
, HRcVec128
, 11, 24); }
70 ST_IN HReg
hregARM_Q12 ( void ) { return mkHReg(False
, HRcVec128
, 12, 25); }
72 ST_IN HReg
hregARM_R8 ( void ) { return mkHReg(False
, HRcInt32
, 8, 26); }
73 ST_IN HReg
hregARM_R12 ( void ) { return mkHReg(False
, HRcInt32
, 12, 27); }
74 ST_IN HReg
hregARM_R13 ( void ) { return mkHReg(False
, HRcInt32
, 13, 28); }
75 ST_IN HReg
hregARM_R14 ( void ) { return mkHReg(False
, HRcInt32
, 14, 29); }
76 ST_IN HReg
hregARM_R15 ( void ) { return mkHReg(False
, HRcInt32
, 15, 30); }
77 ST_IN HReg
hregARM_Q13 ( void ) { return mkHReg(False
, HRcVec128
, 13, 31); }
78 ST_IN HReg
hregARM_Q14 ( void ) { return mkHReg(False
, HRcVec128
, 14, 32); }
79 ST_IN HReg
hregARM_Q15 ( void ) { return mkHReg(False
, HRcVec128
, 15, 33); }
82 extern UInt
ppHRegARM ( HReg
);
84 /* Number of registers used arg passing in function calls */
85 #define ARM_N_ARGREGS 4 /* r0, r1, r2, r3 */
88 /* --------- Condition codes. --------- */
92 ARMcc_EQ
= 0, /* equal : Z=1 */
93 ARMcc_NE
= 1, /* not equal : Z=0 */
95 ARMcc_HS
= 2, /* >=u (higher or same) : C=1 */
96 ARMcc_LO
= 3, /* <u (lower) : C=0 */
98 ARMcc_MI
= 4, /* minus (negative) : N=1 */
99 ARMcc_PL
= 5, /* plus (zero or +ve) : N=0 */
101 ARMcc_VS
= 6, /* overflow : V=1 */
102 ARMcc_VC
= 7, /* no overflow : V=0 */
104 ARMcc_HI
= 8, /* >u (higher) : C=1 && Z=0 */
105 ARMcc_LS
= 9, /* <=u (lower or same) : C=0 || Z=1 */
107 ARMcc_GE
= 10, /* >=s (signed greater or equal) : N=V */
108 ARMcc_LT
= 11, /* <s (signed less than) : N!=V */
110 ARMcc_GT
= 12, /* >s (signed greater) : Z=0 && N=V */
111 ARMcc_LE
= 13, /* <=s (signed less or equal) : Z=1 || N!=V */
113 ARMcc_AL
= 14, /* always (unconditional) */
114 ARMcc_NV
= 15 /* never (basically undefined meaning), deprecated */
118 extern const HChar
* showARMCondCode ( ARMCondCode
);
122 /* --------- Memory address expressions (amodes). --------- */
124 /* --- Addressing Mode 1 --- */
127 ARMam1_RI
=1, /* reg +/- imm12 */
128 ARMam1_RRS
/* reg1 + (reg2 << 0, 1 2 or 3) */
138 Int simm13
; /* -4095 .. +4095 */
143 UInt shift
; /* 0, 1 2 or 3 */
149 extern ARMAMode1
* ARMAMode1_RI ( HReg reg
, Int simm13
);
150 extern ARMAMode1
* ARMAMode1_RRS ( HReg base
, HReg index
, UInt shift
);
152 extern void ppARMAMode1 ( ARMAMode1
* );
155 /* --- Addressing Mode 2 --- */
158 ARMam2_RI
=3, /* reg +/- imm8 */
159 ARMam2_RR
/* reg1 + reg2 */
169 Int simm9
; /* -255 .. 255 */
179 extern ARMAMode2
* ARMAMode2_RI ( HReg reg
, Int simm9
);
180 extern ARMAMode2
* ARMAMode2_RR ( HReg base
, HReg index
);
182 extern void ppARMAMode2 ( ARMAMode2
* );
185 /* --- Addressing Mode suitable for VFP --- */
186 /* The simm11 is encoded as 8 bits + 1 sign bit,
187 so can only be 0 % 4. */
191 Int simm11
; /* -1020, -1016 .. 1016, 1020 */
195 extern ARMAModeV
* mkARMAModeV ( HReg reg
, Int simm11
);
197 extern void ppARMAModeV ( ARMAModeV
* );
199 /* --- Addressing Mode suitable for Neon --- */
224 extern ARMAModeN
* mkARMAModeN_RR ( HReg
, HReg
);
225 extern ARMAModeN
* mkARMAModeN_R ( HReg
);
226 extern void ppARMAModeN ( ARMAModeN
* );
228 /* --------- Reg or imm-8x4 operands --------- */
229 /* a.k.a (a very restricted form of) Shifter Operand,
230 in the ARM parlance. */
234 ARMri84_I84
=7, /* imm8 `ror` (2 * imm4) */
254 extern ARMRI84
* ARMRI84_I84 ( UShort imm8
, UShort imm4
);
255 extern ARMRI84
* ARMRI84_R ( HReg
);
257 extern void ppARMRI84 ( ARMRI84
* );
260 /* --------- Reg or imm5 operands --------- */
263 ARMri5_I5
=9, /* imm5, 1 .. 31 only (no zero!) */
282 extern ARMRI5
* ARMRI5_I5 ( UInt imm5
);
283 extern ARMRI5
* ARMRI5_R ( HReg
);
285 extern void ppARMRI5 ( ARMRI5
* );
287 /* -------- Neon Immediate operand -------- */
289 /* imm8 = abcdefgh, B = NOT(b);
291 type | value (64bit binary)
292 -----+-------------------------------------------------------------------------
293 0 | 00000000 00000000 00000000 abcdefgh 00000000 00000000 00000000 abcdefgh
294 1 | 00000000 00000000 abcdefgh 00000000 00000000 00000000 abcdefgh 00000000
295 2 | 00000000 abcdefgh 00000000 00000000 00000000 abcdefgh 00000000 00000000
296 3 | abcdefgh 00000000 00000000 00000000 abcdefgh 00000000 00000000 00000000
297 4 | 00000000 abcdefgh 00000000 abcdefgh 00000000 abcdefgh 00000000 abcdefgh
298 5 | abcdefgh 00000000 abcdefgh 00000000 abcdefgh 00000000 abcdefgh 00000000
299 6 | abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh
300 7 | 00000000 00000000 abcdefgh 11111111 00000000 00000000 abcdefgh 11111111
301 8 | 00000000 abcdefgh 11111111 11111111 00000000 abcdefgh 11111111 11111111
302 9 | aaaaaaaa bbbbbbbb cccccccc dddddddd eeeeeeee ffffffff gggggggg hhhhhhhh
303 10 | aBbbbbbc defgh000 00000000 00000000 aBbbbbbc defgh000 00000000 00000000
304 -----+-------------------------------------------------------------------------
307 (-1)^S * 2^exp * mantissa
308 where S = a, exp = UInt(B:c:d) - 3, mantissa = (16 + UInt(e:f:g:h)) / 16
318 extern ARMNImm
* ARMNImm_TI ( UInt type
, UInt imm8
);
319 extern ULong
ARMNImm_to_Imm64 ( ARMNImm
* );
320 extern ARMNImm
* Imm64_to_ARMNImm ( ULong
);
322 extern void ppARMNImm ( ARMNImm
* );
324 /* ------ Neon Register or Scalar Operand ------ */
341 extern ARMNRS
* mkARMNRS(ARMNRS_tag
, HReg reg
, UInt index
);
342 extern void ppARMNRS ( ARMNRS
* );
344 /* --------- Instructions. --------- */
349 ARMalu_ADD
=20, /* plain 32-bit add */
350 ARMalu_ADDS
, /* 32-bit add, and set the flags */
351 ARMalu_ADC
, /* 32-bit add with carry */
352 ARMalu_SUB
, /* plain 32-bit subtract */
353 ARMalu_SUBS
, /* 32-bit subtract, and set the flags */
354 ARMalu_SBC
, /* 32-bit subtract with carry */
362 extern const HChar
* showARMAluOp ( ARMAluOp op
);
373 extern const HChar
* showARMShiftOp ( ARMShiftOp op
);
384 extern const HChar
* showARMUnaryOp ( ARMUnaryOp op
);
395 extern const HChar
* showARMMulOp ( ARMMulOp op
);
407 extern const HChar
* showARMVfpOp ( ARMVfpOp op
);
419 extern const HChar
* showARMVfpUnaryOp ( ARMVfpUnaryOp op
);
480 ARMneon_VSAL
, /* Yah, not SAR but SAL */
511 ARMneon_VCVTFtoFixedU
,
512 ARMneon_VCVTFtoFixedS
,
513 ARMneon_VCVTFixedUtoF
,
514 ARMneon_VCVTFixedStoF
,
515 ARMneon_VCVTF16toF32
,
516 ARMneon_VCVTF32toF16
,
549 extern const HChar
* showARMNeonBinOp ( ARMNeonBinOp op
);
550 extern const HChar
* showARMNeonUnOp ( ARMNeonUnOp op
);
551 extern const HChar
* showARMNeonUnOpS ( ARMNeonUnOpS op
);
552 extern const HChar
* showARMNeonShiftOp ( ARMNeonShiftOp op
);
553 extern const HChar
* showARMNeonDualOp ( ARMNeonDualOp op
);
554 extern const HChar
* showARMNeonBinOpDataType ( ARMNeonBinOp op
);
555 extern const HChar
* showARMNeonUnOpDataType ( ARMNeonUnOp op
);
556 extern const HChar
* showARMNeonUnOpSDataType ( ARMNeonUnOpS op
);
557 extern const HChar
* showARMNeonShiftOpDataType ( ARMNeonShiftOp op
);
558 extern const HChar
* showARMNeonDualOpDataType ( ARMNeonDualOp op
);
573 ARMin_XDirect
, /* direct transfer to GA */
574 ARMin_XIndir
, /* indirect transfer to GA */
575 ARMin_XAssisted
, /* assisted transfer to GA */
610 ARMin_NShl64
, // special case 64-bit shift of Dreg by immediate
613 /* This is not a NEON instruction. Actually there is no corresponding
614 instruction in ARM instruction set at all. We need this one to
615 generate spill/reload of 128-bit registers since current register
616 allocator demands them to consist of no more than two instructions.
617 We will split this instruction into 2 or 3 ARM instructions on the
619 NOTE: source and destination registers should be different! */
621 ARMin_EvCheck
, /* Event check */
622 ARMin_ProfInc
/* 64-bit profile counter increment */
626 /* Destinations are on the LEFT (first operand) */
632 /* ADD/SUB/AND/OR/XOR, vanilla ALU op */
639 /* SHL/SHR/SAR, 2nd arg is reg or imm */
652 /* CMP/TST; subtract/and, discard result, set NZCV */
658 /* MOV dst, src -- reg-reg (or reg-imm8x4) move */
663 /* Pseudo-insn; make a 32-bit immediate */
668 /* 32-bit load or store, may be conditional */
670 ARMCondCode cc
; /* ARMcc_NV is not allowed */
675 /* 16-bit load or store, may be conditional */
677 ARMCondCode cc
; /* ARMcc_NV is not allowed */
683 /* 8-bit (unsigned) load or store, may be conditional */
685 ARMCondCode cc
; /* ARMcc_NV is not allowed */
690 /* 8-bit signed load, may be conditional */
692 ARMCondCode cc
; /* ARMcc_NV is not allowed */
696 /* Update the guest R15T value, then exit requesting to chain
697 to it. May be conditional. Urr, use of Addr32 implicitly
698 assumes that wordsize(guest) == wordsize(host). */
700 Addr32 dstGA
; /* next guest address */
701 ARMAMode1
* amR15T
; /* amode in guest state for R15T */
702 ARMCondCode cond
; /* can be ARMcc_AL */
703 Bool toFastEP
; /* chain to the slow or fast point? */
705 /* Boring transfer to a guest address not known at JIT time.
706 Not chainable. May be conditional. */
710 ARMCondCode cond
; /* can be ARMcc_AL */
712 /* Assisted transfer to a guest address, most general case.
713 Not chainable. May be conditional. */
717 ARMCondCode cond
; /* can be ARMcc_AL */
720 /* Mov src to dst on the given condition, which may not
727 /* Pseudo-insn. Call target (an absolute address), on given
728 condition (which could be ARMcc_AL). */
732 Int nArgRegs
; /* # regs carrying args: 0 .. 4 */
733 RetLoc rloc
; /* where the return value will be */
735 /* (PLAIN) 32 * 32 -> 32: r0 = r2 * r3
736 (ZX) 32 *u 32 -> 64: r1:r0 = r2 *u r3
737 (SX) 32 *s 32 -> 64: r1:r0 = r2 *s r3
738 Why hardwired registers? Because the ARM ARM specifies
739 (eg for straight MUL) the result (Rd) and the left arg (Rm)
740 may not be the same register. That's not a constraint we
741 can enforce in the register allocator (without mucho extra
742 complexity). Hence hardwire it. At least using caller-saves
743 registers, which are less likely to be in use. */
747 /* LDREX{,H,B} r2, [r4] and
748 LDREXD r2, r3, [r4] (on LE hosts, transferred value is r3:r2)
749 Again, hardwired registers since this is not performance
750 critical, and there are possibly constraints on the
751 registers that we can't express in the register allocator.*/
753 Int szB
; /* 1, 2, 4 or 8 */
755 /* STREX{,H,B} r0, r2, [r4] and
756 STREXD r0, r2, r3, [r4] (on LE hosts, transferred value is r3:r2)
757 r0 = SC( [r4] = r2 ) (8, 16, 32 bit transfers)
758 r0 = SC( [r4] = r3:r2) (64 bit transfers)
759 Ditto comment re fixed registers. */
761 Int szB
; /* 1, 2, 4 or 8 */
763 /* VFP INSTRUCTIONS */
764 /* 64-bit Fp load/store */
770 /* 32-bit Fp load/store */
776 /* 64-bit FP binary arithmetic */
783 /* 32-bit FP binary arithmetic */
790 /* 64-bit FP unary, also reg-reg move */
796 /* 32-bit FP unary, also reg-reg move */
802 /* 64-bit FP compare and move results to CPSR (FCMPD;FMSTAT) */
807 /* 64-bit FP mov src to dst on the given condition, which may
814 /* 32-bit FP mov src to dst on the given condition, which may
821 /* Convert between 32-bit and 64-bit FP values (both ways).
824 Bool sToD
; /* True: F32->F64. False: F64->F32 */
828 /* Transfer a NEON Q reg to/from two D registers (VMOV x 2) */
835 /* Transfer a VFP D reg to/from two integer registers (VMOV) */
842 /* Transfer a VFP S reg to/from an integer register (VMOV) */
848 /* Convert between 32-bit ints and 64-bit FP values (both ways
849 and both signednesses). (FSITOD, FUITOD, FTOSID, FTOUID) */
851 Bool iToD
; /* True: I32->F64. False: F64->I32 */
852 Bool syned
; /* True: I32 is signed. False: I32 is unsigned */
856 /* Round a F32 or F64 value to the nearest integral value,
857 according to the FPSCR.RM. For ARM >= V8 hosts only. */
863 /* Do Min/Max of F32 or F64 values, propagating the numerical arg
864 if the other is a qNaN. For ARM >= V8 hosts only. */
872 /* Move a 32-bit value to/from the FPSCR (FMXR, FMRX) */
877 /* Mem fence. An insn which fences all loads and stores as
878 much as possible before continuing. On ARM we emit the
880 mcr 15,0,r0,c7,c10,4 (DSB)
881 mcr 15,0,r0,c7,c10,5 (DMB)
882 mcr 15,0,r0,c7,c5,4 (ISB)
883 which is probably total overkill, but better safe than
888 /* A CLREX instruction. */
891 /* Neon data processing instruction: 3 registers of the same
920 UInt amt
; /* 1..63 only */
946 /* Takes two arguments and modifies them both. */
958 /* 128-bit Neon move src to dst on the given condition, which
959 may not be ARMcc_AL. */
972 ARMAMode1
* amCounter
;
973 ARMAMode1
* amFailAddr
;
976 /* No fields. The address of the counter to inc is
977 installed later, post-translation, by patching it in,
978 as it is not known at translation time. */
985 extern ARMInstr
* ARMInstr_Alu ( ARMAluOp
, HReg
, HReg
, ARMRI84
* );
986 extern ARMInstr
* ARMInstr_Shift ( ARMShiftOp
, HReg
, HReg
, ARMRI5
* );
987 extern ARMInstr
* ARMInstr_Unary ( ARMUnaryOp
, HReg
, HReg
);
988 extern ARMInstr
* ARMInstr_CmpOrTst ( Bool isCmp
, HReg
, ARMRI84
* );
989 extern ARMInstr
* ARMInstr_Mov ( HReg
, ARMRI84
* );
990 extern ARMInstr
* ARMInstr_Imm32 ( HReg
, UInt
);
991 extern ARMInstr
* ARMInstr_LdSt32 ( ARMCondCode
,
992 Bool isLoad
, HReg
, ARMAMode1
* );
993 extern ARMInstr
* ARMInstr_LdSt16 ( ARMCondCode
,
994 Bool isLoad
, Bool signedLoad
,
996 extern ARMInstr
* ARMInstr_LdSt8U ( ARMCondCode
,
997 Bool isLoad
, HReg
, ARMAMode1
* );
998 extern ARMInstr
* ARMInstr_Ld8S ( ARMCondCode
, HReg
, ARMAMode2
* );
999 extern ARMInstr
* ARMInstr_XDirect ( Addr32 dstGA
, ARMAMode1
* amR15T
,
1000 ARMCondCode cond
, Bool toFastEP
);
1001 extern ARMInstr
* ARMInstr_XIndir ( HReg dstGA
, ARMAMode1
* amR15T
,
1003 extern ARMInstr
* ARMInstr_XAssisted ( HReg dstGA
, ARMAMode1
* amR15T
,
1004 ARMCondCode cond
, IRJumpKind jk
);
1005 extern ARMInstr
* ARMInstr_CMov ( ARMCondCode
, HReg dst
, ARMRI84
* src
);
1006 extern ARMInstr
* ARMInstr_Call ( ARMCondCode
, Addr32
, Int nArgRegs
,
1008 extern ARMInstr
* ARMInstr_Mul ( ARMMulOp op
);
1009 extern ARMInstr
* ARMInstr_LdrEX ( Int szB
);
1010 extern ARMInstr
* ARMInstr_StrEX ( Int szB
);
1011 extern ARMInstr
* ARMInstr_VLdStD ( Bool isLoad
, HReg
, ARMAModeV
* );
1012 extern ARMInstr
* ARMInstr_VLdStS ( Bool isLoad
, HReg
, ARMAModeV
* );
1013 extern ARMInstr
* ARMInstr_VAluD ( ARMVfpOp op
, HReg
, HReg
, HReg
);
1014 extern ARMInstr
* ARMInstr_VAluS ( ARMVfpOp op
, HReg
, HReg
, HReg
);
1015 extern ARMInstr
* ARMInstr_VUnaryD ( ARMVfpUnaryOp
, HReg dst
, HReg src
);
1016 extern ARMInstr
* ARMInstr_VUnaryS ( ARMVfpUnaryOp
, HReg dst
, HReg src
);
1017 extern ARMInstr
* ARMInstr_VCmpD ( HReg argL
, HReg argR
);
1018 extern ARMInstr
* ARMInstr_VCMovD ( ARMCondCode
, HReg dst
, HReg src
);
1019 extern ARMInstr
* ARMInstr_VCMovS ( ARMCondCode
, HReg dst
, HReg src
);
1020 extern ARMInstr
* ARMInstr_VCvtSD ( Bool sToD
, HReg dst
, HReg src
);
1021 extern ARMInstr
* ARMInstr_VXferQ ( Bool toQ
, HReg qD
, HReg dHi
, HReg dLo
);
1022 extern ARMInstr
* ARMInstr_VXferD ( Bool toD
, HReg dD
, HReg rHi
, HReg rLo
);
1023 extern ARMInstr
* ARMInstr_VXferS ( Bool toS
, HReg fD
, HReg rLo
);
1024 extern ARMInstr
* ARMInstr_VCvtID ( Bool iToD
, Bool syned
,
1025 HReg dst
, HReg src
);
1026 extern ARMInstr
* ARMInstr_VRIntR ( Bool isF64
, HReg dst
, HReg src
);
1027 extern ARMInstr
* ARMInstr_VMinMaxNum ( Bool isF64
, Bool isMax
,
1028 HReg dst
, HReg srcL
, HReg srcR
);
1029 extern ARMInstr
* ARMInstr_FPSCR ( Bool toFPSCR
, HReg iReg
);
1030 extern ARMInstr
* ARMInstr_MFence ( void );
1031 extern ARMInstr
* ARMInstr_CLREX ( void );
1032 extern ARMInstr
* ARMInstr_NLdStQ ( Bool isLoad
, HReg
, ARMAModeN
* );
1033 extern ARMInstr
* ARMInstr_NLdStD ( Bool isLoad
, HReg
, ARMAModeN
* );
1034 extern ARMInstr
* ARMInstr_NUnary ( ARMNeonUnOp
, HReg
, HReg
, UInt
, Bool
);
1035 extern ARMInstr
* ARMInstr_NUnaryS ( ARMNeonUnOpS
, ARMNRS
*, ARMNRS
*,
1037 extern ARMInstr
* ARMInstr_NDual ( ARMNeonDualOp
, HReg
, HReg
, UInt
, Bool
);
1038 extern ARMInstr
* ARMInstr_NBinary ( ARMNeonBinOp
, HReg
, HReg
, HReg
,
1040 extern ARMInstr
* ARMInstr_NShift ( ARMNeonShiftOp
, HReg
, HReg
, HReg
,
1042 extern ARMInstr
* ARMInstr_NShl64 ( HReg
, HReg
, UInt
);
1043 extern ARMInstr
* ARMInstr_NeonImm ( HReg
, ARMNImm
* );
1044 extern ARMInstr
* ARMInstr_NCMovQ ( ARMCondCode
, HReg
, HReg
);
1045 extern ARMInstr
* ARMInstr_Add32 ( HReg rD
, HReg rN
, UInt imm32
);
1046 extern ARMInstr
* ARMInstr_EvCheck ( ARMAMode1
* amCounter
,
1047 ARMAMode1
* amFailAddr
);
1048 extern ARMInstr
* ARMInstr_ProfInc ( void );
1050 extern void ppARMInstr ( const ARMInstr
* );
1053 /* Some functions that insulate the register allocator from details
1054 of the underlying instruction set. */
1055 extern void getRegUsage_ARMInstr ( HRegUsage
*, const ARMInstr
*, Bool
);
1056 extern void mapRegs_ARMInstr ( HRegRemap
*, ARMInstr
*, Bool
);
1057 extern Int
emit_ARMInstr ( /*MB_MOD*/Bool
* is_profInc
,
1058 UChar
* buf
, Int nbuf
, const ARMInstr
* i
,
1060 VexEndness endness_host
,
1061 const void* disp_cp_chain_me_to_slowEP
,
1062 const void* disp_cp_chain_me_to_fastEP
,
1063 const void* disp_cp_xindir
,
1064 const void* disp_cp_xassisted
);
1066 extern void genSpill_ARM ( /*OUT*/HInstr
** i1
, /*OUT*/HInstr
** i2
,
1067 HReg rreg
, Int offset
, Bool
);
1068 extern void genReload_ARM ( /*OUT*/HInstr
** i1
, /*OUT*/HInstr
** i2
,
1069 HReg rreg
, Int offset
, Bool
);
1070 extern ARMInstr
* genMove_ARM(HReg from
, HReg to
, Bool
);
1072 extern const RRegUniverse
* getRRegUniverse_ARM ( void );
1074 extern HInstrArray
* iselSB_ARM ( const IRSB
*,
1078 Int offs_Host_EvC_Counter
,
1079 Int offs_Host_EvC_FailAddr
,
1080 Bool chainingAllowed
,
1084 /* How big is an event check? This is kind of a kludge because it
1085 depends on the offsets of host_EvC_FAILADDR and
1086 host_EvC_COUNTER. */
1087 extern Int
evCheckSzB_ARM (void);
1089 /* Perform a chaining and unchaining of an XDirect jump. */
1090 extern VexInvalRange
chainXDirect_ARM ( VexEndness endness_host
,
1091 void* place_to_chain
,
1092 const void* disp_cp_chain_me_EXPECTED
,
1093 const void* place_to_jump_to
);
1095 extern VexInvalRange
unchainXDirect_ARM ( VexEndness endness_host
,
1096 void* place_to_unchain
,
1097 const void* place_to_jump_to_EXPECTED
,
1098 const void* disp_cp_chain_me
);
1100 /* Patch the counter location into an existing ProfInc point. */
1101 extern VexInvalRange
patchProfInc_ARM ( VexEndness endness_host
,
1102 void* place_to_patch
,
1103 const ULong
* location_of_counter
);
1106 #endif /* ndef __VEX_HOST_ARM_DEFS_H */
1108 /*---------------------------------------------------------------*/
1109 /*--- end host_arm_defs.h ---*/
1110 /*---------------------------------------------------------------*/