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, write to the Free Software
24 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 The GNU General Public License is contained in the file COPYING.
30 #ifndef __VEX_HOST_ARM_DEFS_H
31 #define __VEX_HOST_ARM_DEFS_H
33 #include "libvex_basictypes.h"
34 #include "libvex.h" // VexArch
35 #include "host_generic_regs.h" // HReg
37 extern UInt arm_hwcaps
;
40 /* --------- Registers. --------- */
42 #define ST_IN static inline
43 ST_IN HReg
hregARM_R4 ( void ) { return mkHReg(False
, HRcInt32
, 4, 0); }
44 ST_IN HReg
hregARM_R5 ( void ) { return mkHReg(False
, HRcInt32
, 5, 1); }
45 ST_IN HReg
hregARM_R6 ( void ) { return mkHReg(False
, HRcInt32
, 6, 2); }
46 ST_IN HReg
hregARM_R7 ( void ) { return mkHReg(False
, HRcInt32
, 7, 3); }
47 ST_IN HReg
hregARM_R10 ( void ) { return mkHReg(False
, HRcInt32
, 10, 4); }
48 ST_IN HReg
hregARM_R11 ( void ) { return mkHReg(False
, HRcInt32
, 11, 5); }
50 ST_IN HReg
hregARM_R0 ( void ) { return mkHReg(False
, HRcInt32
, 0, 6); }
51 ST_IN HReg
hregARM_R1 ( void ) { return mkHReg(False
, HRcInt32
, 1, 7); }
52 ST_IN HReg
hregARM_R2 ( void ) { return mkHReg(False
, HRcInt32
, 2, 8); }
53 ST_IN HReg
hregARM_R3 ( void ) { return mkHReg(False
, HRcInt32
, 3, 9); }
54 ST_IN HReg
hregARM_R9 ( void ) { return mkHReg(False
, HRcInt32
, 9, 10); }
56 ST_IN HReg
hregARM_D8 ( void ) { return mkHReg(False
, HRcFlt64
, 8, 11); }
57 ST_IN HReg
hregARM_D9 ( void ) { return mkHReg(False
, HRcFlt64
, 9, 12); }
58 ST_IN HReg
hregARM_D10 ( void ) { return mkHReg(False
, HRcFlt64
, 10, 13); }
59 ST_IN HReg
hregARM_D11 ( void ) { return mkHReg(False
, HRcFlt64
, 11, 14); }
60 ST_IN HReg
hregARM_D12 ( void ) { return mkHReg(False
, HRcFlt64
, 12, 15); }
62 ST_IN HReg
hregARM_S26 ( void ) { return mkHReg(False
, HRcFlt32
, 26, 16); }
63 ST_IN HReg
hregARM_S27 ( void ) { return mkHReg(False
, HRcFlt32
, 27, 17); }
64 ST_IN HReg
hregARM_S28 ( void ) { return mkHReg(False
, HRcFlt32
, 28, 18); }
65 ST_IN HReg
hregARM_S29 ( void ) { return mkHReg(False
, HRcFlt32
, 29, 19); }
66 ST_IN HReg
hregARM_S30 ( void ) { return mkHReg(False
, HRcFlt32
, 30, 20); }
68 ST_IN HReg
hregARM_Q8 ( void ) { return mkHReg(False
, HRcVec128
, 8, 21); }
69 ST_IN HReg
hregARM_Q9 ( void ) { return mkHReg(False
, HRcVec128
, 9, 22); }
70 ST_IN HReg
hregARM_Q10 ( void ) { return mkHReg(False
, HRcVec128
, 10, 23); }
71 ST_IN HReg
hregARM_Q11 ( void ) { return mkHReg(False
, HRcVec128
, 11, 24); }
72 ST_IN HReg
hregARM_Q12 ( void ) { return mkHReg(False
, HRcVec128
, 12, 25); }
74 ST_IN HReg
hregARM_R8 ( void ) { return mkHReg(False
, HRcInt32
, 8, 26); }
75 ST_IN HReg
hregARM_R12 ( void ) { return mkHReg(False
, HRcInt32
, 12, 27); }
76 ST_IN HReg
hregARM_R13 ( void ) { return mkHReg(False
, HRcInt32
, 13, 28); }
77 ST_IN HReg
hregARM_R14 ( void ) { return mkHReg(False
, HRcInt32
, 14, 29); }
78 ST_IN HReg
hregARM_R15 ( void ) { return mkHReg(False
, HRcInt32
, 15, 30); }
79 ST_IN HReg
hregARM_Q13 ( void ) { return mkHReg(False
, HRcVec128
, 13, 31); }
80 ST_IN HReg
hregARM_Q14 ( void ) { return mkHReg(False
, HRcVec128
, 14, 32); }
81 ST_IN HReg
hregARM_Q15 ( void ) { return mkHReg(False
, HRcVec128
, 15, 33); }
84 extern UInt
ppHRegARM ( HReg
);
86 /* Number of registers used arg passing in function calls */
87 #define ARM_N_ARGREGS 4 /* r0, r1, r2, r3 */
90 /* --------- Condition codes. --------- */
94 ARMcc_EQ
= 0, /* equal : Z=1 */
95 ARMcc_NE
= 1, /* not equal : Z=0 */
97 ARMcc_HS
= 2, /* >=u (higher or same) : C=1 */
98 ARMcc_LO
= 3, /* <u (lower) : C=0 */
100 ARMcc_MI
= 4, /* minus (negative) : N=1 */
101 ARMcc_PL
= 5, /* plus (zero or +ve) : N=0 */
103 ARMcc_VS
= 6, /* overflow : V=1 */
104 ARMcc_VC
= 7, /* no overflow : V=0 */
106 ARMcc_HI
= 8, /* >u (higher) : C=1 && Z=0 */
107 ARMcc_LS
= 9, /* <=u (lower or same) : C=0 || Z=1 */
109 ARMcc_GE
= 10, /* >=s (signed greater or equal) : N=V */
110 ARMcc_LT
= 11, /* <s (signed less than) : N!=V */
112 ARMcc_GT
= 12, /* >s (signed greater) : Z=0 && N=V */
113 ARMcc_LE
= 13, /* <=s (signed less or equal) : Z=1 || N!=V */
115 ARMcc_AL
= 14, /* always (unconditional) */
116 ARMcc_NV
= 15 /* never (basically undefined meaning), deprecated */
120 extern const HChar
* showARMCondCode ( ARMCondCode
);
124 /* --------- Memory address expressions (amodes). --------- */
126 /* --- Addressing Mode 1 --- */
129 ARMam1_RI
=1, /* reg +/- imm12 */
130 ARMam1_RRS
/* reg1 + (reg2 << 0, 1 2 or 3) */
140 Int simm13
; /* -4095 .. +4095 */
145 UInt shift
; /* 0, 1 2 or 3 */
151 extern ARMAMode1
* ARMAMode1_RI ( HReg reg
, Int simm13
);
152 extern ARMAMode1
* ARMAMode1_RRS ( HReg base
, HReg index
, UInt shift
);
154 extern void ppARMAMode1 ( ARMAMode1
* );
157 /* --- Addressing Mode 2 --- */
160 ARMam2_RI
=3, /* reg +/- imm8 */
161 ARMam2_RR
/* reg1 + reg2 */
171 Int simm9
; /* -255 .. 255 */
181 extern ARMAMode2
* ARMAMode2_RI ( HReg reg
, Int simm9
);
182 extern ARMAMode2
* ARMAMode2_RR ( HReg base
, HReg index
);
184 extern void ppARMAMode2 ( ARMAMode2
* );
187 /* --- Addressing Mode suitable for VFP --- */
188 /* The simm11 is encoded as 8 bits + 1 sign bit,
189 so can only be 0 % 4. */
193 Int simm11
; /* -1020, -1016 .. 1016, 1020 */
197 extern ARMAModeV
* mkARMAModeV ( HReg reg
, Int simm11
);
199 extern void ppARMAModeV ( ARMAModeV
* );
201 /* --- Addressing Mode suitable for Neon --- */
226 extern ARMAModeN
* mkARMAModeN_RR ( HReg
, HReg
);
227 extern ARMAModeN
* mkARMAModeN_R ( HReg
);
228 extern void ppARMAModeN ( ARMAModeN
* );
230 /* --------- Reg or imm-8x4 operands --------- */
231 /* a.k.a (a very restricted form of) Shifter Operand,
232 in the ARM parlance. */
236 ARMri84_I84
=7, /* imm8 `ror` (2 * imm4) */
256 extern ARMRI84
* ARMRI84_I84 ( UShort imm8
, UShort imm4
);
257 extern ARMRI84
* ARMRI84_R ( HReg
);
259 extern void ppARMRI84 ( ARMRI84
* );
262 /* --------- Reg or imm5 operands --------- */
265 ARMri5_I5
=9, /* imm5, 1 .. 31 only (no zero!) */
284 extern ARMRI5
* ARMRI5_I5 ( UInt imm5
);
285 extern ARMRI5
* ARMRI5_R ( HReg
);
287 extern void ppARMRI5 ( ARMRI5
* );
289 /* -------- Neon Immediate operand -------- */
291 /* imm8 = abcdefgh, B = NOT(b);
293 type | value (64bit binary)
294 -----+-------------------------------------------------------------------------
295 0 | 00000000 00000000 00000000 abcdefgh 00000000 00000000 00000000 abcdefgh
296 1 | 00000000 00000000 abcdefgh 00000000 00000000 00000000 abcdefgh 00000000
297 2 | 00000000 abcdefgh 00000000 00000000 00000000 abcdefgh 00000000 00000000
298 3 | abcdefgh 00000000 00000000 00000000 abcdefgh 00000000 00000000 00000000
299 4 | 00000000 abcdefgh 00000000 abcdefgh 00000000 abcdefgh 00000000 abcdefgh
300 5 | abcdefgh 00000000 abcdefgh 00000000 abcdefgh 00000000 abcdefgh 00000000
301 6 | abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh
302 7 | 00000000 00000000 abcdefgh 11111111 00000000 00000000 abcdefgh 11111111
303 8 | 00000000 abcdefgh 11111111 11111111 00000000 abcdefgh 11111111 11111111
304 9 | aaaaaaaa bbbbbbbb cccccccc dddddddd eeeeeeee ffffffff gggggggg hhhhhhhh
305 10 | aBbbbbbc defgh000 00000000 00000000 aBbbbbbc defgh000 00000000 00000000
306 -----+-------------------------------------------------------------------------
309 (-1)^S * 2^exp * mantissa
310 where S = a, exp = UInt(B:c:d) - 3, mantissa = (16 + UInt(e:f:g:h)) / 16
320 extern ARMNImm
* ARMNImm_TI ( UInt type
, UInt imm8
);
321 extern ULong
ARMNImm_to_Imm64 ( ARMNImm
* );
322 extern ARMNImm
* Imm64_to_ARMNImm ( ULong
);
324 extern void ppARMNImm ( ARMNImm
* );
326 /* ------ Neon Register or Scalar Operand ------ */
343 extern ARMNRS
* mkARMNRS(ARMNRS_tag
, HReg reg
, UInt index
);
344 extern void ppARMNRS ( ARMNRS
* );
346 /* --------- Instructions. --------- */
351 ARMalu_ADD
=20, /* plain 32-bit add */
352 ARMalu_ADDS
, /* 32-bit add, and set the flags */
353 ARMalu_ADC
, /* 32-bit add with carry */
354 ARMalu_SUB
, /* plain 32-bit subtract */
355 ARMalu_SUBS
, /* 32-bit subtract, and set the flags */
356 ARMalu_SBC
, /* 32-bit subtract with carry */
364 extern const HChar
* showARMAluOp ( ARMAluOp op
);
375 extern const HChar
* showARMShiftOp ( ARMShiftOp op
);
386 extern const HChar
* showARMUnaryOp ( ARMUnaryOp op
);
397 extern const HChar
* showARMMulOp ( ARMMulOp op
);
409 extern const HChar
* showARMVfpOp ( ARMVfpOp op
);
421 extern const HChar
* showARMVfpUnaryOp ( ARMVfpUnaryOp op
);
482 ARMneon_VSAL
, /* Yah, not SAR but SAL */
513 ARMneon_VCVTFtoFixedU
,
514 ARMneon_VCVTFtoFixedS
,
515 ARMneon_VCVTFixedUtoF
,
516 ARMneon_VCVTFixedStoF
,
517 ARMneon_VCVTF16toF32
,
518 ARMneon_VCVTF32toF16
,
551 extern const HChar
* showARMNeonBinOp ( ARMNeonBinOp op
);
552 extern const HChar
* showARMNeonUnOp ( ARMNeonUnOp op
);
553 extern const HChar
* showARMNeonUnOpS ( ARMNeonUnOpS op
);
554 extern const HChar
* showARMNeonShiftOp ( ARMNeonShiftOp op
);
555 extern const HChar
* showARMNeonDualOp ( ARMNeonDualOp op
);
556 extern const HChar
* showARMNeonBinOpDataType ( ARMNeonBinOp op
);
557 extern const HChar
* showARMNeonUnOpDataType ( ARMNeonUnOp op
);
558 extern const HChar
* showARMNeonUnOpSDataType ( ARMNeonUnOpS op
);
559 extern const HChar
* showARMNeonShiftOpDataType ( ARMNeonShiftOp op
);
560 extern const HChar
* showARMNeonDualOpDataType ( ARMNeonDualOp op
);
575 ARMin_XDirect
, /* direct transfer to GA */
576 ARMin_XIndir
, /* indirect transfer to GA */
577 ARMin_XAssisted
, /* assisted transfer to GA */
612 ARMin_NShl64
, // special case 64-bit shift of Dreg by immediate
615 /* This is not a NEON instruction. Actually there is no corresponding
616 instruction in ARM instruction set at all. We need this one to
617 generate spill/reload of 128-bit registers since current register
618 allocator demands them to consist of no more than two instructions.
619 We will split this instruction into 2 or 3 ARM instructions on the
621 NOTE: source and destination registers should be different! */
623 ARMin_EvCheck
, /* Event check */
624 ARMin_ProfInc
/* 64-bit profile counter increment */
628 /* Destinations are on the LEFT (first operand) */
634 /* ADD/SUB/AND/OR/XOR, vanilla ALU op */
641 /* SHL/SHR/SAR, 2nd arg is reg or imm */
654 /* CMP/TST; subtract/and, discard result, set NZCV */
660 /* MOV dst, src -- reg-reg (or reg-imm8x4) move */
665 /* Pseudo-insn; make a 32-bit immediate */
670 /* 32-bit load or store, may be conditional */
672 ARMCondCode cc
; /* ARMcc_NV is not allowed */
677 /* 16-bit load or store, may be conditional */
679 ARMCondCode cc
; /* ARMcc_NV is not allowed */
685 /* 8-bit (unsigned) load or store, may be conditional */
687 ARMCondCode cc
; /* ARMcc_NV is not allowed */
692 /* 8-bit signed load, may be conditional */
694 ARMCondCode cc
; /* ARMcc_NV is not allowed */
698 /* Update the guest R15T value, then exit requesting to chain
699 to it. May be conditional. Urr, use of Addr32 implicitly
700 assumes that wordsize(guest) == wordsize(host). */
702 Addr32 dstGA
; /* next guest address */
703 ARMAMode1
* amR15T
; /* amode in guest state for R15T */
704 ARMCondCode cond
; /* can be ARMcc_AL */
705 Bool toFastEP
; /* chain to the slow or fast point? */
707 /* Boring transfer to a guest address not known at JIT time.
708 Not chainable. May be conditional. */
712 ARMCondCode cond
; /* can be ARMcc_AL */
714 /* Assisted transfer to a guest address, most general case.
715 Not chainable. May be conditional. */
719 ARMCondCode cond
; /* can be ARMcc_AL */
722 /* Mov src to dst on the given condition, which may not
729 /* Pseudo-insn. Call target (an absolute address), on given
730 condition (which could be ARMcc_AL). */
734 Int nArgRegs
; /* # regs carrying args: 0 .. 4 */
735 RetLoc rloc
; /* where the return value will be */
737 /* (PLAIN) 32 * 32 -> 32: r0 = r2 * r3
738 (ZX) 32 *u 32 -> 64: r1:r0 = r2 *u r3
739 (SX) 32 *s 32 -> 64: r1:r0 = r2 *s r3
740 Why hardwired registers? Because the ARM ARM specifies
741 (eg for straight MUL) the result (Rd) and the left arg (Rm)
742 may not be the same register. That's not a constraint we
743 can enforce in the register allocator (without mucho extra
744 complexity). Hence hardwire it. At least using caller-saves
745 registers, which are less likely to be in use. */
749 /* LDREX{,H,B} r2, [r4] and
750 LDREXD r2, r3, [r4] (on LE hosts, transferred value is r3:r2)
751 Again, hardwired registers since this is not performance
752 critical, and there are possibly constraints on the
753 registers that we can't express in the register allocator.*/
755 Int szB
; /* 1, 2, 4 or 8 */
757 /* STREX{,H,B} r0, r2, [r4] and
758 STREXD r0, r2, r3, [r4] (on LE hosts, transferred value is r3:r2)
759 r0 = SC( [r4] = r2 ) (8, 16, 32 bit transfers)
760 r0 = SC( [r4] = r3:r2) (64 bit transfers)
761 Ditto comment re fixed registers. */
763 Int szB
; /* 1, 2, 4 or 8 */
765 /* VFP INSTRUCTIONS */
766 /* 64-bit Fp load/store */
772 /* 32-bit Fp load/store */
778 /* 64-bit FP binary arithmetic */
785 /* 32-bit FP binary arithmetic */
792 /* 64-bit FP unary, also reg-reg move */
798 /* 32-bit FP unary, also reg-reg move */
804 /* 64-bit FP compare and move results to CPSR (FCMPD;FMSTAT) */
809 /* 64-bit FP mov src to dst on the given condition, which may
816 /* 32-bit FP mov src to dst on the given condition, which may
823 /* Convert between 32-bit and 64-bit FP values (both ways).
826 Bool sToD
; /* True: F32->F64. False: F64->F32 */
830 /* Transfer a NEON Q reg to/from two D registers (VMOV x 2) */
837 /* Transfer a VFP D reg to/from two integer registers (VMOV) */
844 /* Transfer a VFP S reg to/from an integer register (VMOV) */
850 /* Convert between 32-bit ints and 64-bit FP values (both ways
851 and both signednesses). (FSITOD, FUITOD, FTOSID, FTOUID) */
853 Bool iToD
; /* True: I32->F64. False: F64->I32 */
854 Bool syned
; /* True: I32 is signed. False: I32 is unsigned */
858 /* Round a F32 or F64 value to the nearest integral value,
859 according to the FPSCR.RM. For ARM >= V8 hosts only. */
865 /* Do Min/Max of F32 or F64 values, propagating the numerical arg
866 if the other is a qNaN. For ARM >= V8 hosts only. */
874 /* Move a 32-bit value to/from the FPSCR (FMXR, FMRX) */
879 /* Mem fence. An insn which fences all loads and stores as
880 much as possible before continuing. On ARM we emit the
882 mcr 15,0,r0,c7,c10,4 (DSB)
883 mcr 15,0,r0,c7,c10,5 (DMB)
884 mcr 15,0,r0,c7,c5,4 (ISB)
885 which is probably total overkill, but better safe than
890 /* A CLREX instruction. */
893 /* Neon data processing instruction: 3 registers of the same
922 UInt amt
; /* 1..63 only */
948 /* Takes two arguments and modifies them both. */
960 /* 128-bit Neon move src to dst on the given condition, which
961 may not be ARMcc_AL. */
974 ARMAMode1
* amCounter
;
975 ARMAMode1
* amFailAddr
;
978 /* No fields. The address of the counter to inc is
979 installed later, post-translation, by patching it in,
980 as it is not known at translation time. */
987 extern ARMInstr
* ARMInstr_Alu ( ARMAluOp
, HReg
, HReg
, ARMRI84
* );
988 extern ARMInstr
* ARMInstr_Shift ( ARMShiftOp
, HReg
, HReg
, ARMRI5
* );
989 extern ARMInstr
* ARMInstr_Unary ( ARMUnaryOp
, HReg
, HReg
);
990 extern ARMInstr
* ARMInstr_CmpOrTst ( Bool isCmp
, HReg
, ARMRI84
* );
991 extern ARMInstr
* ARMInstr_Mov ( HReg
, ARMRI84
* );
992 extern ARMInstr
* ARMInstr_Imm32 ( HReg
, UInt
);
993 extern ARMInstr
* ARMInstr_LdSt32 ( ARMCondCode
,
994 Bool isLoad
, HReg
, ARMAMode1
* );
995 extern ARMInstr
* ARMInstr_LdSt16 ( ARMCondCode
,
996 Bool isLoad
, Bool signedLoad
,
998 extern ARMInstr
* ARMInstr_LdSt8U ( ARMCondCode
,
999 Bool isLoad
, HReg
, ARMAMode1
* );
1000 extern ARMInstr
* ARMInstr_Ld8S ( ARMCondCode
, HReg
, ARMAMode2
* );
1001 extern ARMInstr
* ARMInstr_XDirect ( Addr32 dstGA
, ARMAMode1
* amR15T
,
1002 ARMCondCode cond
, Bool toFastEP
);
1003 extern ARMInstr
* ARMInstr_XIndir ( HReg dstGA
, ARMAMode1
* amR15T
,
1005 extern ARMInstr
* ARMInstr_XAssisted ( HReg dstGA
, ARMAMode1
* amR15T
,
1006 ARMCondCode cond
, IRJumpKind jk
);
1007 extern ARMInstr
* ARMInstr_CMov ( ARMCondCode
, HReg dst
, ARMRI84
* src
);
1008 extern ARMInstr
* ARMInstr_Call ( ARMCondCode
, Addr32
, Int nArgRegs
,
1010 extern ARMInstr
* ARMInstr_Mul ( ARMMulOp op
);
1011 extern ARMInstr
* ARMInstr_LdrEX ( Int szB
);
1012 extern ARMInstr
* ARMInstr_StrEX ( Int szB
);
1013 extern ARMInstr
* ARMInstr_VLdStD ( Bool isLoad
, HReg
, ARMAModeV
* );
1014 extern ARMInstr
* ARMInstr_VLdStS ( Bool isLoad
, HReg
, ARMAModeV
* );
1015 extern ARMInstr
* ARMInstr_VAluD ( ARMVfpOp op
, HReg
, HReg
, HReg
);
1016 extern ARMInstr
* ARMInstr_VAluS ( ARMVfpOp op
, HReg
, HReg
, HReg
);
1017 extern ARMInstr
* ARMInstr_VUnaryD ( ARMVfpUnaryOp
, HReg dst
, HReg src
);
1018 extern ARMInstr
* ARMInstr_VUnaryS ( ARMVfpUnaryOp
, HReg dst
, HReg src
);
1019 extern ARMInstr
* ARMInstr_VCmpD ( HReg argL
, HReg argR
);
1020 extern ARMInstr
* ARMInstr_VCMovD ( ARMCondCode
, HReg dst
, HReg src
);
1021 extern ARMInstr
* ARMInstr_VCMovS ( ARMCondCode
, HReg dst
, HReg src
);
1022 extern ARMInstr
* ARMInstr_VCvtSD ( Bool sToD
, HReg dst
, HReg src
);
1023 extern ARMInstr
* ARMInstr_VXferQ ( Bool toQ
, HReg qD
, HReg dHi
, HReg dLo
);
1024 extern ARMInstr
* ARMInstr_VXferD ( Bool toD
, HReg dD
, HReg rHi
, HReg rLo
);
1025 extern ARMInstr
* ARMInstr_VXferS ( Bool toS
, HReg fD
, HReg rLo
);
1026 extern ARMInstr
* ARMInstr_VCvtID ( Bool iToD
, Bool syned
,
1027 HReg dst
, HReg src
);
1028 extern ARMInstr
* ARMInstr_VRIntR ( Bool isF64
, HReg dst
, HReg src
);
1029 extern ARMInstr
* ARMInstr_VMinMaxNum ( Bool isF64
, Bool isMax
,
1030 HReg dst
, HReg srcL
, HReg srcR
);
1031 extern ARMInstr
* ARMInstr_FPSCR ( Bool toFPSCR
, HReg iReg
);
1032 extern ARMInstr
* ARMInstr_MFence ( void );
1033 extern ARMInstr
* ARMInstr_CLREX ( void );
1034 extern ARMInstr
* ARMInstr_NLdStQ ( Bool isLoad
, HReg
, ARMAModeN
* );
1035 extern ARMInstr
* ARMInstr_NLdStD ( Bool isLoad
, HReg
, ARMAModeN
* );
1036 extern ARMInstr
* ARMInstr_NUnary ( ARMNeonUnOp
, HReg
, HReg
, UInt
, Bool
);
1037 extern ARMInstr
* ARMInstr_NUnaryS ( ARMNeonUnOpS
, ARMNRS
*, ARMNRS
*,
1039 extern ARMInstr
* ARMInstr_NDual ( ARMNeonDualOp
, HReg
, HReg
, UInt
, Bool
);
1040 extern ARMInstr
* ARMInstr_NBinary ( ARMNeonBinOp
, HReg
, HReg
, HReg
,
1042 extern ARMInstr
* ARMInstr_NShift ( ARMNeonShiftOp
, HReg
, HReg
, HReg
,
1044 extern ARMInstr
* ARMInstr_NShl64 ( HReg
, HReg
, UInt
);
1045 extern ARMInstr
* ARMInstr_NeonImm ( HReg
, ARMNImm
* );
1046 extern ARMInstr
* ARMInstr_NCMovQ ( ARMCondCode
, HReg
, HReg
);
1047 extern ARMInstr
* ARMInstr_Add32 ( HReg rD
, HReg rN
, UInt imm32
);
1048 extern ARMInstr
* ARMInstr_EvCheck ( ARMAMode1
* amCounter
,
1049 ARMAMode1
* amFailAddr
);
1050 extern ARMInstr
* ARMInstr_ProfInc ( void );
1052 extern void ppARMInstr ( const ARMInstr
* );
1055 /* Some functions that insulate the register allocator from details
1056 of the underlying instruction set. */
1057 extern void getRegUsage_ARMInstr ( HRegUsage
*, const ARMInstr
*, Bool
);
1058 extern void mapRegs_ARMInstr ( HRegRemap
*, ARMInstr
*, Bool
);
1059 extern Int
emit_ARMInstr ( /*MB_MOD*/Bool
* is_profInc
,
1060 UChar
* buf
, Int nbuf
, const ARMInstr
* i
,
1062 VexEndness endness_host
,
1063 const void* disp_cp_chain_me_to_slowEP
,
1064 const void* disp_cp_chain_me_to_fastEP
,
1065 const void* disp_cp_xindir
,
1066 const void* disp_cp_xassisted
);
1068 extern void genSpill_ARM ( /*OUT*/HInstr
** i1
, /*OUT*/HInstr
** i2
,
1069 HReg rreg
, Int offset
, Bool
);
1070 extern void genReload_ARM ( /*OUT*/HInstr
** i1
, /*OUT*/HInstr
** i2
,
1071 HReg rreg
, Int offset
, Bool
);
1072 extern ARMInstr
* genMove_ARM(HReg from
, HReg to
, Bool
);
1074 extern const RRegUniverse
* getRRegUniverse_ARM ( void );
1076 extern HInstrArray
* iselSB_ARM ( const IRSB
*,
1080 Int offs_Host_EvC_Counter
,
1081 Int offs_Host_EvC_FailAddr
,
1082 Bool chainingAllowed
,
1086 /* How big is an event check? This is kind of a kludge because it
1087 depends on the offsets of host_EvC_FAILADDR and
1088 host_EvC_COUNTER. */
1089 extern Int
evCheckSzB_ARM (void);
1091 /* Perform a chaining and unchaining of an XDirect jump. */
1092 extern VexInvalRange
chainXDirect_ARM ( VexEndness endness_host
,
1093 void* place_to_chain
,
1094 const void* disp_cp_chain_me_EXPECTED
,
1095 const void* place_to_jump_to
);
1097 extern VexInvalRange
unchainXDirect_ARM ( VexEndness endness_host
,
1098 void* place_to_unchain
,
1099 const void* place_to_jump_to_EXPECTED
,
1100 const void* disp_cp_chain_me
);
1102 /* Patch the counter location into an existing ProfInc point. */
1103 extern VexInvalRange
patchProfInc_ARM ( VexEndness endness_host
,
1104 void* place_to_patch
,
1105 const ULong
* location_of_counter
);
1108 #endif /* ndef __VEX_HOST_ARM_DEFS_H */
1110 /*---------------------------------------------------------------*/
1111 /*--- end host_arm_defs.h ---*/
1112 /*---------------------------------------------------------------*/