barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1 | /* |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 2 | * Copyright (C) 2009, 2010 University of Szeged |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY |
| 15 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 17 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR |
| 18 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 19 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 20 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 21 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 22 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 | */ |
| 26 | |
| 27 | #ifndef ARMAssembler_h |
| 28 | #define ARMAssembler_h |
| 29 | |
mjs@apple.com | cc66821 | 2010-01-04 11:38:56 +0000 | [diff] [blame] | 30 | #if ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 31 | |
| 32 | #include "AssemblerBufferWithConstantPool.h" |
fpizlo@apple.com | 0f25ee8 | 2012-03-01 05:46:20 +0000 | [diff] [blame] | 33 | #include "JITCompilationEffort.h" |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 34 | #include <wtf/Assertions.h> |
| 35 | namespace JSC { |
| 36 | |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 37 | typedef uint32_t ARMWord; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 38 | |
oliver@apple.com | c3a5b8c | 2013-07-25 04:01:38 +0000 | [diff] [blame] | 39 | #define FOR_EACH_CPU_REGISTER(V) \ |
| 40 | FOR_EACH_CPU_GPREGISTER(V) \ |
| 41 | FOR_EACH_CPU_SPECIAL_REGISTER(V) \ |
| 42 | FOR_EACH_CPU_FPREGISTER(V) |
| 43 | |
| 44 | #define FOR_EACH_CPU_GPREGISTER(V) \ |
| 45 | V(void*, r0) \ |
| 46 | V(void*, r1) \ |
| 47 | V(void*, r2) \ |
| 48 | V(void*, r3) \ |
| 49 | V(void*, r4) \ |
| 50 | V(void*, r5) \ |
| 51 | V(void*, r6) \ |
| 52 | V(void*, r7) \ |
| 53 | V(void*, r8) \ |
| 54 | V(void*, r9) \ |
| 55 | V(void*, r10) \ |
mark.lam@apple.com | 595d64d | 2014-11-13 16:43:05 +0000 | [diff] [blame] | 56 | V(void*, fp) \ |
oliver@apple.com | c3a5b8c | 2013-07-25 04:01:38 +0000 | [diff] [blame] | 57 | V(void*, ip) \ |
| 58 | V(void*, sp) \ |
| 59 | V(void*, lr) \ |
mark.lam@apple.com | 595d64d | 2014-11-13 16:43:05 +0000 | [diff] [blame] | 60 | V(void*, pc) \ |
oliver@apple.com | c3a5b8c | 2013-07-25 04:01:38 +0000 | [diff] [blame] | 61 | |
| 62 | #define FOR_EACH_CPU_SPECIAL_REGISTER(V) \ |
| 63 | V(void*, apsr) \ |
| 64 | V(void*, fpscr) \ |
| 65 | |
| 66 | #define FOR_EACH_CPU_FPREGISTER(V) \ |
| 67 | V(double, d0) \ |
| 68 | V(double, d1) \ |
| 69 | V(double, d2) \ |
| 70 | V(double, d3) \ |
| 71 | V(double, d4) \ |
| 72 | V(double, d5) \ |
| 73 | V(double, d6) \ |
| 74 | V(double, d7) \ |
| 75 | V(double, d8) \ |
| 76 | V(double, d9) \ |
| 77 | V(double, d10) \ |
| 78 | V(double, d11) \ |
| 79 | V(double, d12) \ |
| 80 | V(double, d13) \ |
| 81 | V(double, d14) \ |
mark.lam@apple.com | 595d64d | 2014-11-13 16:43:05 +0000 | [diff] [blame] | 82 | V(double, d15) \ |
| 83 | V(double, d16) \ |
| 84 | V(double, d17) \ |
| 85 | V(double, d18) \ |
| 86 | V(double, d19) \ |
| 87 | V(double, d20) \ |
| 88 | V(double, d21) \ |
| 89 | V(double, d22) \ |
| 90 | V(double, d23) \ |
| 91 | V(double, d24) \ |
| 92 | V(double, d25) \ |
| 93 | V(double, d26) \ |
| 94 | V(double, d27) \ |
| 95 | V(double, d28) \ |
| 96 | V(double, d29) \ |
| 97 | V(double, d30) \ |
| 98 | V(double, d31) \ |
| 99 | |
| 100 | namespace ARMRegisters { |
| 101 | |
| 102 | typedef enum { |
| 103 | #define DECLARE_REGISTER(_type, _regName) _regName, |
| 104 | FOR_EACH_CPU_GPREGISTER(DECLARE_REGISTER) |
| 105 | #undef DECLARE_REGISTER |
| 106 | |
| 107 | // Pseudonyms for some of the registers. |
| 108 | S0 = r6, |
| 109 | r11 = fp, // frame pointer |
| 110 | r12 = ip, S1 = ip, |
| 111 | r13 = sp, |
| 112 | r14 = lr, |
| 113 | r15 = pc |
| 114 | } RegisterID; |
| 115 | |
| 116 | typedef enum { |
| 117 | #define DECLARE_REGISTER(_type, _regName) _regName, |
| 118 | FOR_EACH_CPU_FPREGISTER(DECLARE_REGISTER) |
| 119 | #undef DECLARE_REGISTER |
| 120 | |
| 121 | // Pseudonyms for some of the registers. |
| 122 | SD0 = d7, /* Same as thumb assembler. */ |
| 123 | } FPRegisterID; |
| 124 | |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 125 | } // namespace ARMRegisters |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 126 | |
| 127 | class ARMAssembler { |
| 128 | public: |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 129 | typedef ARMRegisters::RegisterID RegisterID; |
| 130 | typedef ARMRegisters::FPRegisterID FPRegisterID; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 131 | typedef AssemblerBufferWithConstantPool<2048, 4, 4, ARMAssembler> ARMBuffer; |
barraclough@apple.com | 0ec8712 | 2011-05-02 01:04:17 +0000 | [diff] [blame] | 132 | typedef SegmentedVector<AssemblerLabel, 64> Jumps; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 133 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 134 | ARMAssembler() |
| 135 | : m_indexOfTailOfLastWatchpoint(1) |
| 136 | { |
| 137 | } |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 138 | |
commit-queue@webkit.org | 30a6a70 | 2013-10-22 15:51:51 +0000 | [diff] [blame] | 139 | ARMBuffer& buffer() { return m_buffer; } |
| 140 | |
basile_clement@apple.com | 38ddaa7 | 2015-09-04 18:00:24 +0000 | [diff] [blame] | 141 | static constexpr RegisterID firstRegister() { return ARMRegisters::r0; } |
| 142 | static constexpr RegisterID lastRegister() { return ARMRegisters::r15; } |
rgabor@webkit.org | ebfd250 | 2013-11-11 18:14:47 +0000 | [diff] [blame] | 143 | |
basile_clement@apple.com | 38ddaa7 | 2015-09-04 18:00:24 +0000 | [diff] [blame] | 144 | static constexpr FPRegisterID firstFPRegister() { return ARMRegisters::d0; } |
| 145 | static constexpr FPRegisterID lastFPRegister() { return ARMRegisters::d31; } |
rgabor@webkit.org | ebfd250 | 2013-11-11 18:14:47 +0000 | [diff] [blame] | 146 | |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 147 | // ARM conditional constants |
| 148 | typedef enum { |
mark.lam@apple.com | a61ec35 | 2013-04-22 17:37:29 +0000 | [diff] [blame] | 149 | EQ = 0x00000000, // Zero / Equal. |
| 150 | NE = 0x10000000, // Non-zero / Not equal. |
| 151 | CS = 0x20000000, // Unsigned higher or same. |
| 152 | CC = 0x30000000, // Unsigned lower. |
| 153 | MI = 0x40000000, // Negative. |
| 154 | PL = 0x50000000, // Positive or zero. |
| 155 | VS = 0x60000000, // Overflowed. |
| 156 | VC = 0x70000000, // Not overflowed. |
| 157 | HI = 0x80000000, // Unsigned higher. |
| 158 | LS = 0x90000000, // Unsigned lower or same. |
| 159 | GE = 0xa0000000, // Signed greater than or equal. |
| 160 | LT = 0xb0000000, // Signed less than. |
| 161 | GT = 0xc0000000, // Signed greater than. |
mark.lam@apple.com | 91c1722 | 2013-04-23 04:47:08 +0000 | [diff] [blame] | 162 | LE = 0xd0000000, // Signed less than or equal. |
mark.lam@apple.com | a61ec35 | 2013-04-22 17:37:29 +0000 | [diff] [blame] | 163 | AL = 0xe0000000 // Unconditional / Always execute. |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 164 | } Condition; |
| 165 | |
| 166 | // ARM instruction constants |
| 167 | enum { |
| 168 | AND = (0x0 << 21), |
| 169 | EOR = (0x1 << 21), |
| 170 | SUB = (0x2 << 21), |
| 171 | RSB = (0x3 << 21), |
| 172 | ADD = (0x4 << 21), |
| 173 | ADC = (0x5 << 21), |
| 174 | SBC = (0x6 << 21), |
| 175 | RSC = (0x7 << 21), |
| 176 | TST = (0x8 << 21), |
| 177 | TEQ = (0x9 << 21), |
| 178 | CMP = (0xa << 21), |
| 179 | CMN = (0xb << 21), |
| 180 | ORR = (0xc << 21), |
| 181 | MOV = (0xd << 21), |
| 182 | BIC = (0xe << 21), |
| 183 | MVN = (0xf << 21), |
| 184 | MUL = 0x00000090, |
| 185 | MULL = 0x00c00090, |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 186 | VMOV_F64 = 0x0eb00b40, |
zherczeg@webkit.org | b699414 | 2010-08-13 06:49:16 +0000 | [diff] [blame] | 187 | VADD_F64 = 0x0e300b00, |
| 188 | VDIV_F64 = 0x0e800b00, |
| 189 | VSUB_F64 = 0x0e300b40, |
| 190 | VMUL_F64 = 0x0e200b00, |
| 191 | VCMP_F64 = 0x0eb40b40, |
| 192 | VSQRT_F64 = 0x0eb10bc0, |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 193 | VABS_F64 = 0x0eb00bc0, |
| 194 | VNEG_F64 = 0x0eb10b40, |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 195 | STMDB = 0x09200000, |
| 196 | LDMIA = 0x08b00000, |
| 197 | B = 0x0a000000, |
| 198 | BL = 0x0b000000, |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 199 | BX = 0x012fff10, |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 200 | VMOV_VFP64 = 0x0c400a10, |
| 201 | VMOV_ARM64 = 0x0c500a10, |
| 202 | VMOV_VFP32 = 0x0e000a10, |
| 203 | VMOV_ARM32 = 0x0e100a10, |
zherczeg@webkit.org | b699414 | 2010-08-13 06:49:16 +0000 | [diff] [blame] | 204 | VCVT_F64_S32 = 0x0eb80bc0, |
rgabor@webkit.org | 3e838be | 2013-05-06 16:37:41 +0000 | [diff] [blame] | 205 | VCVT_S32_F64 = 0x0ebd0bc0, |
| 206 | VCVT_U32_F64 = 0x0ebc0bc0, |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 207 | VCVT_F32_F64 = 0x0eb70bc0, |
| 208 | VCVT_F64_F32 = 0x0eb70ac0, |
zherczeg@webkit.org | b699414 | 2010-08-13 06:49:16 +0000 | [diff] [blame] | 209 | VMRS_APSR = 0x0ef1fa10, |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 210 | CLZ = 0x016f0f10, |
zherczeg@webkit.org | 32f8aea | 2010-10-28 07:22:38 +0000 | [diff] [blame] | 211 | BKPT = 0xe1200070, |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 212 | BLX = 0x012fff30, |
loki@webkit.org | 2b8542d8 | 2010-01-05 15:53:17 +0000 | [diff] [blame] | 213 | #if WTF_ARM_ARCH_AT_LEAST(7) |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 214 | MOVW = 0x03000000, |
| 215 | MOVT = 0x03400000, |
| 216 | #endif |
loki@webkit.org | 7a7c80c | 2011-05-20 05:27:48 +0000 | [diff] [blame] | 217 | NOP = 0xe1a00000, |
commit-queue@webkit.org | b545d40 | 2013-11-20 18:32:37 +0000 | [diff] [blame] | 218 | DMB_SY = 0xf57ff05f, |
ossy@webkit.org | d3a3de9 | 2015-03-16 18:44:46 +0000 | [diff] [blame] | 219 | #if HAVE(ARM_IDIV_INSTRUCTIONS) |
| 220 | SDIV = 0x0710f010, |
| 221 | UDIV = 0x0730f010, |
| 222 | #endif |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 223 | }; |
| 224 | |
| 225 | enum { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 226 | Op2Immediate = (1 << 25), |
| 227 | ImmediateForHalfWordTransfer = (1 << 22), |
| 228 | Op2InvertedImmediate = (1 << 26), |
| 229 | SetConditionalCodes = (1 << 20), |
| 230 | Op2IsRegisterArgument = (1 << 25), |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 231 | // Data transfer flags. |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 232 | DataTransferUp = (1 << 23), |
| 233 | DataTransferWriteBack = (1 << 21), |
| 234 | DataTransferPostUpdate = (1 << 24), |
| 235 | DataTransferLoad = (1 << 20), |
| 236 | ByteDataTransfer = (1 << 22), |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 237 | }; |
| 238 | |
| 239 | enum DataTransferTypeA { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 240 | LoadUint32 = 0x05000000 | DataTransferLoad, |
| 241 | LoadUint8 = 0x05400000 | DataTransferLoad, |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 242 | StoreUint32 = 0x05000000, |
| 243 | StoreUint8 = 0x05400000, |
| 244 | }; |
| 245 | |
| 246 | enum DataTransferTypeB { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 247 | LoadUint16 = 0x010000b0 | DataTransferLoad, |
| 248 | LoadInt16 = 0x010000f0 | DataTransferLoad, |
| 249 | LoadInt8 = 0x010000d0 | DataTransferLoad, |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 250 | StoreUint16 = 0x010000b0, |
| 251 | }; |
| 252 | |
| 253 | enum DataTransferTypeFloat { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 254 | LoadFloat = 0x0d000a00 | DataTransferLoad, |
| 255 | LoadDouble = 0x0d000b00 | DataTransferLoad, |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 256 | StoreFloat = 0x0d000a00, |
| 257 | StoreDouble = 0x0d000b00, |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 258 | }; |
| 259 | |
| 260 | // Masks of ARM instructions |
| 261 | enum { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 262 | BranchOffsetMask = 0x00ffffff, |
| 263 | ConditionalFieldMask = 0xf0000000, |
| 264 | DataTransferOffsetMask = 0xfff, |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 265 | }; |
| 266 | |
| 267 | enum { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 268 | MinimumBranchOffsetDistance = -0x00800000, |
| 269 | MaximumBranchOffsetDistance = 0x007fffff, |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 270 | }; |
| 271 | |
| 272 | enum { |
| 273 | padForAlign8 = 0x00, |
| 274 | padForAlign16 = 0x0000, |
zherczeg@webkit.org | 32f8aea | 2010-10-28 07:22:38 +0000 | [diff] [blame] | 275 | padForAlign32 = 0xe12fff7f // 'bkpt 0xffff' instruction. |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 276 | }; |
| 277 | |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 278 | static const ARMWord InvalidImmediate = 0xf0000000; |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 279 | static const ARMWord InvalidBranchTarget = 0xffffffff; |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 280 | static const int DefaultPrefetchOffset = 2; |
| 281 | |
| 282 | static const ARMWord BlxInstructionMask = 0x012fff30; |
| 283 | static const ARMWord LdrOrAddInstructionMask = 0x0ff00000; |
| 284 | static const ARMWord LdrPcImmediateInstructionMask = 0x0f7f0000; |
| 285 | |
| 286 | static const ARMWord AddImmediateInstruction = 0x02800000; |
| 287 | static const ARMWord BlxInstruction = 0x012fff30; |
| 288 | static const ARMWord LdrImmediateInstruction = 0x05900000; |
| 289 | static const ARMWord LdrPcImmediateInstruction = 0x051f0000; |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 290 | |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 291 | // Instruction formating |
| 292 | |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 293 | void emitInstruction(ARMWord op, int rd, int rn, ARMWord op2) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 294 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 295 | ASSERT(((op2 & ~Op2Immediate) <= 0xfff) || (((op2 & ~ImmediateForHalfWordTransfer) <= 0xfff))); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 296 | m_buffer.putInt(op | RN(rn) | RD(rd) | op2); |
| 297 | } |
| 298 | |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 299 | void emitDoublePrecisionInstruction(ARMWord op, int dd, int dn, int dm) |
zherczeg@webkit.org | b699414 | 2010-08-13 06:49:16 +0000 | [diff] [blame] | 300 | { |
| 301 | ASSERT((dd >= 0 && dd <= 31) && (dn >= 0 && dn <= 31) && (dm >= 0 && dm <= 31)); |
| 302 | m_buffer.putInt(op | ((dd & 0xf) << 12) | ((dd & 0x10) << (22 - 4)) |
| 303 | | ((dn & 0xf) << 16) | ((dn & 0x10) << (7 - 4)) |
| 304 | | (dm & 0xf) | ((dm & 0x10) << (5 - 4))); |
| 305 | } |
| 306 | |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 307 | void emitSinglePrecisionInstruction(ARMWord op, int sd, int sn, int sm) |
zherczeg@webkit.org | b699414 | 2010-08-13 06:49:16 +0000 | [diff] [blame] | 308 | { |
| 309 | ASSERT((sd >= 0 && sd <= 31) && (sn >= 0 && sn <= 31) && (sm >= 0 && sm <= 31)); |
| 310 | m_buffer.putInt(op | ((sd >> 1) << 12) | ((sd & 0x1) << 22) |
| 311 | | ((sn >> 1) << 16) | ((sn & 0x1) << 7) |
| 312 | | (sm >> 1) | ((sm & 0x1) << 5)); |
| 313 | } |
| 314 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 315 | void bitAnd(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 316 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 317 | emitInstruction(toARMWord(cc) | AND, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 318 | } |
| 319 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 320 | void bitAnds(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 321 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 322 | emitInstruction(toARMWord(cc) | AND | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 323 | } |
| 324 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 325 | void eor(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 326 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 327 | emitInstruction(toARMWord(cc) | EOR, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 328 | } |
| 329 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 330 | void eors(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 331 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 332 | emitInstruction(toARMWord(cc) | EOR | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 333 | } |
| 334 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 335 | void sub(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 336 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 337 | emitInstruction(toARMWord(cc) | SUB, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 338 | } |
| 339 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 340 | void subs(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 341 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 342 | emitInstruction(toARMWord(cc) | SUB | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 343 | } |
| 344 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 345 | void rsb(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 346 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 347 | emitInstruction(toARMWord(cc) | RSB, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 348 | } |
| 349 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 350 | void rsbs(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 351 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 352 | emitInstruction(toARMWord(cc) | RSB | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 353 | } |
| 354 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 355 | void add(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 356 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 357 | emitInstruction(toARMWord(cc) | ADD, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 358 | } |
| 359 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 360 | void adds(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 361 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 362 | emitInstruction(toARMWord(cc) | ADD | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 363 | } |
| 364 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 365 | void adc(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 366 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 367 | emitInstruction(toARMWord(cc) | ADC, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 368 | } |
| 369 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 370 | void adcs(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 371 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 372 | emitInstruction(toARMWord(cc) | ADC | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 373 | } |
| 374 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 375 | void sbc(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 376 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 377 | emitInstruction(toARMWord(cc) | SBC, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 378 | } |
| 379 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 380 | void sbcs(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 381 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 382 | emitInstruction(toARMWord(cc) | SBC | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 383 | } |
| 384 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 385 | void rsc(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 386 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 387 | emitInstruction(toARMWord(cc) | RSC, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 388 | } |
| 389 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 390 | void rscs(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 391 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 392 | emitInstruction(toARMWord(cc) | RSC | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 393 | } |
| 394 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 395 | void tst(int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 396 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 397 | emitInstruction(toARMWord(cc) | TST | SetConditionalCodes, 0, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 398 | } |
| 399 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 400 | void teq(int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 401 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 402 | emitInstruction(toARMWord(cc) | TEQ | SetConditionalCodes, 0, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 403 | } |
| 404 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 405 | void cmp(int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 406 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 407 | emitInstruction(toARMWord(cc) | CMP | SetConditionalCodes, 0, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 408 | } |
| 409 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 410 | void cmn(int rn, ARMWord op2, Condition cc = AL) |
loki@webkit.org | 86097ad | 2010-08-25 07:52:16 +0000 | [diff] [blame] | 411 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 412 | emitInstruction(toARMWord(cc) | CMN | SetConditionalCodes, 0, rn, op2); |
loki@webkit.org | 86097ad | 2010-08-25 07:52:16 +0000 | [diff] [blame] | 413 | } |
| 414 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 415 | void orr(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 416 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 417 | emitInstruction(toARMWord(cc) | ORR, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 418 | } |
| 419 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 420 | void orrs(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 421 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 422 | emitInstruction(toARMWord(cc) | ORR | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 423 | } |
| 424 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 425 | void mov(int rd, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 426 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 427 | emitInstruction(toARMWord(cc) | MOV, rd, ARMRegisters::r0, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 428 | } |
| 429 | |
loki@webkit.org | 2b8542d8 | 2010-01-05 15:53:17 +0000 | [diff] [blame] | 430 | #if WTF_ARM_ARCH_AT_LEAST(7) |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 431 | void movw(int rd, ARMWord op2, Condition cc = AL) |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 432 | { |
| 433 | ASSERT((op2 | 0xf0fff) == 0xf0fff); |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 434 | m_buffer.putInt(toARMWord(cc) | MOVW | RD(rd) | op2); |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 435 | } |
| 436 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 437 | void movt(int rd, ARMWord op2, Condition cc = AL) |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 438 | { |
| 439 | ASSERT((op2 | 0xf0fff) == 0xf0fff); |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 440 | m_buffer.putInt(toARMWord(cc) | MOVT | RD(rd) | op2); |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 441 | } |
| 442 | #endif |
| 443 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 444 | void movs(int rd, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 445 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 446 | emitInstruction(toARMWord(cc) | MOV | SetConditionalCodes, rd, ARMRegisters::r0, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 447 | } |
| 448 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 449 | void bic(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 450 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 451 | emitInstruction(toARMWord(cc) | BIC, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 452 | } |
| 453 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 454 | void bics(int rd, int rn, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 455 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 456 | emitInstruction(toARMWord(cc) | BIC | SetConditionalCodes, rd, rn, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 457 | } |
| 458 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 459 | void mvn(int rd, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 460 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 461 | emitInstruction(toARMWord(cc) | MVN, rd, ARMRegisters::r0, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 462 | } |
| 463 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 464 | void mvns(int rd, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 465 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 466 | emitInstruction(toARMWord(cc) | MVN | SetConditionalCodes, rd, ARMRegisters::r0, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 467 | } |
| 468 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 469 | void mul(int rd, int rn, int rm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 470 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 471 | m_buffer.putInt(toARMWord(cc) | MUL | RN(rd) | RS(rn) | RM(rm)); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 472 | } |
| 473 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 474 | void muls(int rd, int rn, int rm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 475 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 476 | m_buffer.putInt(toARMWord(cc) | MUL | SetConditionalCodes | RN(rd) | RS(rn) | RM(rm)); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 477 | } |
| 478 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 479 | void mull(int rdhi, int rdlo, int rn, int rm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 480 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 481 | m_buffer.putInt(toARMWord(cc) | MULL | RN(rdhi) | RD(rdlo) | RS(rn) | RM(rm)); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 482 | } |
| 483 | |
ossy@webkit.org | d3a3de9 | 2015-03-16 18:44:46 +0000 | [diff] [blame] | 484 | #if HAVE(ARM_IDIV_INSTRUCTIONS) |
| 485 | template<int datasize> |
| 486 | void sdiv(int rd, int rn, int rm, Condition cc = AL) |
| 487 | { |
| 488 | static_assert(datasize == 32, "sdiv datasize must be 32 for armv7s"); |
| 489 | ASSERT(rd != ARMRegisters::pc); |
| 490 | ASSERT(rn != ARMRegisters::pc); |
| 491 | ASSERT(rm != ARMRegisters::pc); |
| 492 | m_buffer.putInt(toARMWord(cc) | SDIV | RN(rd) | RM(rn) | RS(rm)); |
| 493 | } |
| 494 | |
| 495 | void udiv(int rd, int rn, int rm, Condition cc = AL) |
| 496 | { |
| 497 | ASSERT(rd != ARMRegisters::pc); |
| 498 | ASSERT(rn != ARMRegisters::pc); |
| 499 | ASSERT(rm != ARMRegisters::pc); |
| 500 | m_buffer.putInt(toARMWord(cc) | UDIV | RN(rd) | RM(rn) | RS(rm)); |
| 501 | } |
| 502 | #endif |
| 503 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 504 | void vmov_f64(int dd, int dm, Condition cc = AL) |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 505 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 506 | emitDoublePrecisionInstruction(toARMWord(cc) | VMOV_F64, dd, 0, dm); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 507 | } |
| 508 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 509 | void vadd_f64(int dd, int dn, int dm, Condition cc = AL) |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 510 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 511 | emitDoublePrecisionInstruction(toARMWord(cc) | VADD_F64, dd, dn, dm); |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 512 | } |
| 513 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 514 | void vdiv_f64(int dd, int dn, int dm, Condition cc = AL) |
zoltan@webkit.org | 1916f84 | 2009-11-14 00:44:42 +0000 | [diff] [blame] | 515 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 516 | emitDoublePrecisionInstruction(toARMWord(cc) | VDIV_F64, dd, dn, dm); |
zoltan@webkit.org | 1916f84 | 2009-11-14 00:44:42 +0000 | [diff] [blame] | 517 | } |
| 518 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 519 | void vsub_f64(int dd, int dn, int dm, Condition cc = AL) |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 520 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 521 | emitDoublePrecisionInstruction(toARMWord(cc) | VSUB_F64, dd, dn, dm); |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 522 | } |
| 523 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 524 | void vmul_f64(int dd, int dn, int dm, Condition cc = AL) |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 525 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 526 | emitDoublePrecisionInstruction(toARMWord(cc) | VMUL_F64, dd, dn, dm); |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 527 | } |
| 528 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 529 | void vcmp_f64(int dd, int dm, Condition cc = AL) |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 530 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 531 | emitDoublePrecisionInstruction(toARMWord(cc) | VCMP_F64, dd, 0, dm); |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 532 | } |
| 533 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 534 | void vsqrt_f64(int dd, int dm, Condition cc = AL) |
zherczeg@webkit.org | fa3e921 | 2010-04-29 14:08:44 +0000 | [diff] [blame] | 535 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 536 | emitDoublePrecisionInstruction(toARMWord(cc) | VSQRT_F64, dd, 0, dm); |
zherczeg@webkit.org | fa3e921 | 2010-04-29 14:08:44 +0000 | [diff] [blame] | 537 | } |
| 538 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 539 | void vabs_f64(int dd, int dm, Condition cc = AL) |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 540 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 541 | emitDoublePrecisionInstruction(toARMWord(cc) | VABS_F64, dd, 0, dm); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 542 | } |
| 543 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 544 | void vneg_f64(int dd, int dm, Condition cc = AL) |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 545 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 546 | emitDoublePrecisionInstruction(toARMWord(cc) | VNEG_F64, dd, 0, dm); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 547 | } |
| 548 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 549 | void ldrImmediate(int rd, ARMWord imm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 550 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 551 | m_buffer.putIntWithConstantInt(toARMWord(cc) | LoadUint32 | DataTransferUp | RN(ARMRegisters::pc) | RD(rd), imm, true); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 552 | } |
| 553 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 554 | void ldrUniqueImmediate(int rd, ARMWord imm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 555 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 556 | m_buffer.putIntWithConstantInt(toARMWord(cc) | LoadUint32 | DataTransferUp | RN(ARMRegisters::pc) | RD(rd), imm); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 557 | } |
| 558 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 559 | void dtrUp(DataTransferTypeA transferType, int rd, int rb, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 560 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 561 | emitInstruction(toARMWord(cc) | transferType | DataTransferUp, rd, rb, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 562 | } |
| 563 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 564 | void dtrUpRegister(DataTransferTypeA transferType, int rd, int rb, int rm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 565 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 566 | emitInstruction(toARMWord(cc) | transferType | DataTransferUp | Op2IsRegisterArgument, rd, rb, rm); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 567 | } |
| 568 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 569 | void dtrDown(DataTransferTypeA transferType, int rd, int rb, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 570 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 571 | emitInstruction(toARMWord(cc) | transferType, rd, rb, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 572 | } |
| 573 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 574 | void dtrDownRegister(DataTransferTypeA transferType, int rd, int rb, int rm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 575 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 576 | emitInstruction(toARMWord(cc) | transferType | Op2IsRegisterArgument, rd, rb, rm); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 577 | } |
| 578 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 579 | void halfDtrUp(DataTransferTypeB transferType, int rd, int rb, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 580 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 581 | emitInstruction(toARMWord(cc) | transferType | DataTransferUp, rd, rb, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 582 | } |
| 583 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 584 | void halfDtrUpRegister(DataTransferTypeB transferType, int rd, int rn, int rm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 585 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 586 | emitInstruction(toARMWord(cc) | transferType | DataTransferUp, rd, rn, rm); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 587 | } |
| 588 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 589 | void halfDtrDown(DataTransferTypeB transferType, int rd, int rb, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 590 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 591 | emitInstruction(toARMWord(cc) | transferType, rd, rb, op2); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 592 | } |
| 593 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 594 | void halfDtrDownRegister(DataTransferTypeB transferType, int rd, int rn, int rm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 595 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 596 | emitInstruction(toARMWord(cc) | transferType, rd, rn, rm); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 597 | } |
| 598 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 599 | void doubleDtrUp(DataTransferTypeFloat type, int rd, int rb, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 600 | { |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 601 | ASSERT(op2 <= 0xff && rd <= 15); |
| 602 | /* Only d0-d15 and s0, s2, s4 ... s30 are supported. */ |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 603 | m_buffer.putInt(toARMWord(cc) | DataTransferUp | type | (rd << 12) | RN(rb) | op2); |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 604 | } |
| 605 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 606 | void doubleDtrDown(DataTransferTypeFloat type, int rd, int rb, ARMWord op2, Condition cc = AL) |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 607 | { |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 608 | ASSERT(op2 <= 0xff && rd <= 15); |
| 609 | /* Only d0-d15 and s0, s2, s4 ... s30 are supported. */ |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 610 | m_buffer.putInt(toARMWord(cc) | type | (rd << 12) | RN(rb) | op2); |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 611 | } |
| 612 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 613 | void push(int reg, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 614 | { |
| 615 | ASSERT(ARMWord(reg) <= 0xf); |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 616 | m_buffer.putInt(toARMWord(cc) | StoreUint32 | DataTransferWriteBack | RN(ARMRegisters::sp) | RD(reg) | 0x4); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 617 | } |
| 618 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 619 | void pop(int reg, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 620 | { |
| 621 | ASSERT(ARMWord(reg) <= 0xf); |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 622 | m_buffer.putInt(toARMWord(cc) | (LoadUint32 ^ DataTransferPostUpdate) | DataTransferUp | RN(ARMRegisters::sp) | RD(reg) | 0x4); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 623 | } |
| 624 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 625 | inline void poke(int reg, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 626 | { |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 627 | dtrDown(StoreUint32, ARMRegisters::sp, 0, reg, cc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 628 | } |
| 629 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 630 | inline void peek(int reg, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 631 | { |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 632 | dtrUp(LoadUint32, reg, ARMRegisters::sp, 0, cc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 633 | } |
| 634 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 635 | void vmov_vfp64(int sm, int rt, int rt2, Condition cc = AL) |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 636 | { |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 637 | ASSERT(rt != rt2); |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 638 | m_buffer.putInt(toARMWord(cc) | VMOV_VFP64 | RN(rt2) | RD(rt) | (sm & 0xf) | ((sm & 0x10) << (5 - 4))); |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 639 | } |
| 640 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 641 | void vmov_arm64(int rt, int rt2, int sm, Condition cc = AL) |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 642 | { |
| 643 | ASSERT(rt != rt2); |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 644 | m_buffer.putInt(toARMWord(cc) | VMOV_ARM64 | RN(rt2) | RD(rt) | (sm & 0xf) | ((sm & 0x10) << (5 - 4))); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 645 | } |
| 646 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 647 | void vmov_vfp32(int sn, int rt, Condition cc = AL) |
ossy@webkit.org | cb98130 | 2009-11-06 07:28:56 +0000 | [diff] [blame] | 648 | { |
zherczeg@webkit.org | b699414 | 2010-08-13 06:49:16 +0000 | [diff] [blame] | 649 | ASSERT(rt <= 15); |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 650 | emitSinglePrecisionInstruction(toARMWord(cc) | VMOV_VFP32, rt << 1, sn, 0); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 651 | } |
| 652 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 653 | void vmov_arm32(int rt, int sn, Condition cc = AL) |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 654 | { |
| 655 | ASSERT(rt <= 15); |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 656 | emitSinglePrecisionInstruction(toARMWord(cc) | VMOV_ARM32, rt << 1, sn, 0); |
ossy@webkit.org | cb98130 | 2009-11-06 07:28:56 +0000 | [diff] [blame] | 657 | } |
| 658 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 659 | void vcvt_f64_s32(int dd, int sm, Condition cc = AL) |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 660 | { |
zherczeg@webkit.org | b699414 | 2010-08-13 06:49:16 +0000 | [diff] [blame] | 661 | ASSERT(!(sm & 0x1)); // sm must be divisible by 2 |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 662 | emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_F64_S32, dd, 0, (sm >> 1)); |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 663 | } |
| 664 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 665 | void vcvt_s32_f64(int sd, int dm, Condition cc = AL) |
ossy@webkit.org | cb98130 | 2009-11-06 07:28:56 +0000 | [diff] [blame] | 666 | { |
zherczeg@webkit.org | b699414 | 2010-08-13 06:49:16 +0000 | [diff] [blame] | 667 | ASSERT(!(sd & 0x1)); // sd must be divisible by 2 |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 668 | emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_S32_F64, (sd >> 1), 0, dm); |
ossy@webkit.org | cb98130 | 2009-11-06 07:28:56 +0000 | [diff] [blame] | 669 | } |
| 670 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 671 | void vcvt_u32_f64(int sd, int dm, Condition cc = AL) |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 672 | { |
| 673 | ASSERT(!(sd & 0x1)); // sd must be divisible by 2 |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 674 | emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_U32_F64, (sd >> 1), 0, dm); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 675 | } |
| 676 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 677 | void vcvt_f64_f32(int dd, int sm, Condition cc = AL) |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 678 | { |
| 679 | ASSERT(dd <= 15 && sm <= 15); |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 680 | emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_F64_F32, dd, 0, sm); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 681 | } |
| 682 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 683 | void vcvt_f32_f64(int dd, int sm, Condition cc = AL) |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 684 | { |
| 685 | ASSERT(dd <= 15 && sm <= 15); |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 686 | emitDoublePrecisionInstruction(toARMWord(cc) | VCVT_F32_F64, dd, 0, sm); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 687 | } |
| 688 | |
zherczeg@webkit.org | b699414 | 2010-08-13 06:49:16 +0000 | [diff] [blame] | 689 | void vmrs_apsr(Condition cc = AL) |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 690 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 691 | m_buffer.putInt(toARMWord(cc) | VMRS_APSR); |
barraclough@apple.com | 9ef61d5 | 2009-08-06 05:33:27 +0000 | [diff] [blame] | 692 | } |
| 693 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 694 | void clz(int rd, int rm, Condition cc = AL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 695 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 696 | m_buffer.putInt(toARMWord(cc) | CLZ | RD(rd) | RM(rm)); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 697 | } |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 698 | |
| 699 | void bkpt(ARMWord value) |
| 700 | { |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 701 | m_buffer.putInt(BKPT | ((value & 0xff0) << 4) | (value & 0xf)); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 702 | } |
loki@webkit.org | 7a7c80c | 2011-05-20 05:27:48 +0000 | [diff] [blame] | 703 | |
oliver@apple.com | 31df1c8 | 2011-05-20 01:33:46 +0000 | [diff] [blame] | 704 | void nop() |
| 705 | { |
loki@webkit.org | 7a7c80c | 2011-05-20 05:27:48 +0000 | [diff] [blame] | 706 | m_buffer.putInt(NOP); |
oliver@apple.com | 31df1c8 | 2011-05-20 01:33:46 +0000 | [diff] [blame] | 707 | } |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 708 | |
commit-queue@webkit.org | b545d40 | 2013-11-20 18:32:37 +0000 | [diff] [blame] | 709 | void dmbSY() |
| 710 | { |
| 711 | m_buffer.putInt(DMB_SY); |
| 712 | } |
| 713 | |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 714 | void bx(int rm, Condition cc = AL) |
| 715 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 716 | emitInstruction(toARMWord(cc) | BX, 0, 0, RM(rm)); |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 717 | } |
| 718 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 719 | AssemblerLabel blx(int rm, Condition cc = AL) |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 720 | { |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 721 | emitInstruction(toARMWord(cc) | BLX, 0, 0, RM(rm)); |
barraclough@apple.com | 0ec8712 | 2011-05-02 01:04:17 +0000 | [diff] [blame] | 722 | return m_buffer.label(); |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 723 | } |
| 724 | |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 725 | static ARMWord lsl(int reg, ARMWord value) |
| 726 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 727 | ASSERT(reg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 728 | ASSERT(value <= 0x1f); |
| 729 | return reg | (value << 7) | 0x00; |
| 730 | } |
| 731 | |
| 732 | static ARMWord lsr(int reg, ARMWord value) |
| 733 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 734 | ASSERT(reg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 735 | ASSERT(value <= 0x1f); |
| 736 | return reg | (value << 7) | 0x20; |
| 737 | } |
| 738 | |
| 739 | static ARMWord asr(int reg, ARMWord value) |
| 740 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 741 | ASSERT(reg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 742 | ASSERT(value <= 0x1f); |
| 743 | return reg | (value << 7) | 0x40; |
| 744 | } |
| 745 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 746 | static ARMWord lslRegister(int reg, int shiftReg) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 747 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 748 | ASSERT(reg <= ARMRegisters::pc); |
| 749 | ASSERT(shiftReg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 750 | return reg | (shiftReg << 8) | 0x10; |
| 751 | } |
| 752 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 753 | static ARMWord lsrRegister(int reg, int shiftReg) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 754 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 755 | ASSERT(reg <= ARMRegisters::pc); |
| 756 | ASSERT(shiftReg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 757 | return reg | (shiftReg << 8) | 0x30; |
| 758 | } |
| 759 | |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 760 | static ARMWord asrRegister(int reg, int shiftReg) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 761 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 762 | ASSERT(reg <= ARMRegisters::pc); |
| 763 | ASSERT(shiftReg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 764 | return reg | (shiftReg << 8) | 0x50; |
| 765 | } |
| 766 | |
| 767 | // General helpers |
| 768 | |
barraclough@apple.com | e00c8ce | 2011-04-30 23:59:17 +0000 | [diff] [blame] | 769 | size_t codeSize() const |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 770 | { |
barraclough@apple.com | e00c8ce | 2011-04-30 23:59:17 +0000 | [diff] [blame] | 771 | return m_buffer.codeSize(); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 772 | } |
| 773 | |
| 774 | void ensureSpace(int insnSpace, int constSpace) |
| 775 | { |
| 776 | m_buffer.ensureSpace(insnSpace, constSpace); |
| 777 | } |
| 778 | |
barraclough@apple.com | 970af2c | 2009-08-13 05:58:36 +0000 | [diff] [blame] | 779 | int sizeOfConstantPool() |
| 780 | { |
| 781 | return m_buffer.sizeOfConstantPool(); |
| 782 | } |
| 783 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 784 | AssemblerLabel labelIgnoringWatchpoints() |
| 785 | { |
| 786 | m_buffer.ensureSpaceForAnyInstruction(); |
| 787 | return m_buffer.label(); |
| 788 | } |
| 789 | |
| 790 | AssemblerLabel labelForWatchpoint() |
| 791 | { |
| 792 | m_buffer.ensureSpaceForAnyInstruction(maxJumpReplacementSize() / sizeof(ARMWord)); |
| 793 | AssemblerLabel result = m_buffer.label(); |
| 794 | if (result.m_offset != (m_indexOfTailOfLastWatchpoint - maxJumpReplacementSize())) |
| 795 | result = label(); |
| 796 | m_indexOfTailOfLastWatchpoint = result.m_offset + maxJumpReplacementSize(); |
| 797 | return label(); |
| 798 | } |
| 799 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 800 | AssemblerLabel label() |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 801 | { |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 802 | AssemblerLabel result = labelIgnoringWatchpoints(); |
| 803 | while (result.m_offset + 1 < m_indexOfTailOfLastWatchpoint) { |
| 804 | nop(); |
| 805 | // The available number of instructions are ensured by labelForWatchpoint. |
| 806 | result = m_buffer.label(); |
| 807 | } |
| 808 | return result; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 809 | } |
| 810 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 811 | AssemblerLabel align(int alignment) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 812 | { |
| 813 | while (!m_buffer.isAligned(alignment)) |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 814 | mov(ARMRegisters::r0, ARMRegisters::r0); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 815 | |
| 816 | return label(); |
| 817 | } |
| 818 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 819 | AssemblerLabel loadBranchTarget(int rd, Condition cc = AL, int useConstantPool = 0) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 820 | { |
barraclough@apple.com | 970af2c | 2009-08-13 05:58:36 +0000 | [diff] [blame] | 821 | ensureSpace(sizeof(ARMWord), sizeof(ARMWord)); |
loki@webkit.org | 4e026cf | 2011-05-02 09:37:09 +0000 | [diff] [blame] | 822 | m_jumps.append(m_buffer.codeSize() | (useConstantPool & 0x1)); |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 823 | ldrUniqueImmediate(rd, InvalidBranchTarget, cc); |
barraclough@apple.com | 0ec8712 | 2011-05-02 01:04:17 +0000 | [diff] [blame] | 824 | return m_buffer.label(); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 825 | } |
| 826 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 827 | AssemblerLabel jmp(Condition cc = AL, int useConstantPool = 0) |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 828 | { |
| 829 | return loadBranchTarget(ARMRegisters::pc, cc, useConstantPool); |
| 830 | } |
| 831 | |
commit-queue@webkit.org | 6539105 | 2013-10-29 19:02:46 +0000 | [diff] [blame] | 832 | void prepareExecutableCopy(void* to); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 833 | |
commit-queue@webkit.org | 96624d1 | 2011-05-12 07:31:43 +0000 | [diff] [blame] | 834 | unsigned debugOffset() { return m_buffer.debugOffset(); } |
barraclough@apple.com | 9cb663d | 2011-04-15 00:25:59 +0000 | [diff] [blame] | 835 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 836 | // DFG assembly helpers for moving data between fp and registers. |
| 837 | void vmov(RegisterID rd1, RegisterID rd2, FPRegisterID rn) |
| 838 | { |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 839 | vmov_arm64(rd1, rd2, rn); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 840 | } |
| 841 | |
| 842 | void vmov(FPRegisterID rd, RegisterID rn1, RegisterID rn2) |
| 843 | { |
commit-queue@webkit.org | b140963 | 2012-08-14 11:28:25 +0000 | [diff] [blame] | 844 | vmov_vfp64(rd, rn1, rn2); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 845 | } |
| 846 | |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 847 | // Patching helpers |
| 848 | |
loki@webkit.org | 15be2dd | 2010-01-08 08:01:40 +0000 | [diff] [blame] | 849 | static ARMWord* getLdrImmAddress(ARMWord* insn) |
| 850 | { |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 851 | // Check for call |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 852 | if ((*insn & LdrPcImmediateInstructionMask) != LdrPcImmediateInstruction) { |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 853 | // Must be BLX |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 854 | ASSERT((*insn & BlxInstructionMask) == BlxInstruction); |
eric@webkit.org | 6a210e7 | 2010-04-22 13:24:56 +0000 | [diff] [blame] | 855 | insn--; |
| 856 | } |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 857 | |
loki@webkit.org | 15be2dd | 2010-01-08 08:01:40 +0000 | [diff] [blame] | 858 | // Must be an ldr ..., [pc +/- imm] |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 859 | ASSERT((*insn & LdrPcImmediateInstructionMask) == LdrPcImmediateInstruction); |
loki@webkit.org | 15be2dd | 2010-01-08 08:01:40 +0000 | [diff] [blame] | 860 | |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 861 | ARMWord addr = reinterpret_cast<ARMWord>(insn) + DefaultPrefetchOffset * sizeof(ARMWord); |
| 862 | if (*insn & DataTransferUp) |
| 863 | return reinterpret_cast<ARMWord*>(addr + (*insn & DataTransferOffsetMask)); |
| 864 | return reinterpret_cast<ARMWord*>(addr - (*insn & DataTransferOffsetMask)); |
loki@webkit.org | 15be2dd | 2010-01-08 08:01:40 +0000 | [diff] [blame] | 865 | } |
| 866 | |
| 867 | static ARMWord* getLdrImmAddressOnPool(ARMWord* insn, uint32_t* constPool) |
| 868 | { |
| 869 | // Must be an ldr ..., [pc +/- imm] |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 870 | ASSERT((*insn & LdrPcImmediateInstructionMask) == LdrPcImmediateInstruction); |
loki@webkit.org | 15be2dd | 2010-01-08 08:01:40 +0000 | [diff] [blame] | 871 | |
| 872 | if (*insn & 0x1) |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 873 | return reinterpret_cast<ARMWord*>(constPool + ((*insn & DataTransferOffsetMask) >> 1)); |
loki@webkit.org | 15be2dd | 2010-01-08 08:01:40 +0000 | [diff] [blame] | 874 | return getLdrImmAddress(insn); |
| 875 | } |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 876 | |
| 877 | static void patchPointerInternal(intptr_t from, void* to) |
| 878 | { |
| 879 | ARMWord* insn = reinterpret_cast<ARMWord*>(from); |
| 880 | ARMWord* addr = getLdrImmAddress(insn); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 881 | *addr = reinterpret_cast<ARMWord>(to); |
| 882 | } |
| 883 | |
| 884 | static ARMWord patchConstantPoolLoad(ARMWord load, ARMWord value) |
| 885 | { |
| 886 | value = (value << 1) + 1; |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 887 | ASSERT(!(value & ~DataTransferOffsetMask)); |
| 888 | return (load & ~DataTransferOffsetMask) | value; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 889 | } |
| 890 | |
| 891 | static void patchConstantPoolLoad(void* loadAddr, void* constPoolAddr); |
| 892 | |
oliver@apple.com | 6695274 | 2011-06-23 22:47:04 +0000 | [diff] [blame] | 893 | // Read pointers |
| 894 | static void* readPointer(void* from) |
| 895 | { |
zherczeg@webkit.org | 4a63758 | 2012-07-26 12:29:10 +0000 | [diff] [blame] | 896 | ARMWord* instruction = reinterpret_cast<ARMWord*>(from); |
| 897 | ARMWord* address = getLdrImmAddress(instruction); |
| 898 | return *reinterpret_cast<void**>(address); |
oliver@apple.com | 6695274 | 2011-06-23 22:47:04 +0000 | [diff] [blame] | 899 | } |
zherczeg@webkit.org | 4a63758 | 2012-07-26 12:29:10 +0000 | [diff] [blame] | 900 | |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 901 | // Patch pointers |
| 902 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 903 | static void linkPointer(void* code, AssemblerLabel from, void* to) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 904 | { |
| 905 | patchPointerInternal(reinterpret_cast<intptr_t>(code) + from.m_offset, to); |
| 906 | } |
| 907 | |
zherczeg@webkit.org | 4a63758 | 2012-07-26 12:29:10 +0000 | [diff] [blame] | 908 | static void repatchInt32(void* where, int32_t to) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 909 | { |
zherczeg@webkit.org | 4a63758 | 2012-07-26 12:29:10 +0000 | [diff] [blame] | 910 | patchPointerInternal(reinterpret_cast<intptr_t>(where), reinterpret_cast<void*>(to)); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 911 | } |
zherczeg@webkit.org | 4a63758 | 2012-07-26 12:29:10 +0000 | [diff] [blame] | 912 | |
oliver@apple.com | 2c012fa | 2011-05-17 20:02:41 +0000 | [diff] [blame] | 913 | static void repatchCompact(void* where, int32_t value) |
| 914 | { |
zherczeg@webkit.org | 4a63758 | 2012-07-26 12:29:10 +0000 | [diff] [blame] | 915 | ARMWord* instruction = reinterpret_cast<ARMWord*>(where); |
| 916 | ASSERT((*instruction & 0x0f700000) == LoadUint32); |
| 917 | if (value >= 0) |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 918 | *instruction = (*instruction & 0xff7ff000) | DataTransferUp | value; |
zherczeg@webkit.org | 4a63758 | 2012-07-26 12:29:10 +0000 | [diff] [blame] | 919 | else |
| 920 | *instruction = (*instruction & 0xff7ff000) | -value; |
| 921 | cacheFlush(instruction, sizeof(ARMWord)); |
oliver@apple.com | 2c012fa | 2011-05-17 20:02:41 +0000 | [diff] [blame] | 922 | } |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 923 | |
| 924 | static void repatchPointer(void* from, void* to) |
| 925 | { |
| 926 | patchPointerInternal(reinterpret_cast<intptr_t>(from), to); |
| 927 | } |
| 928 | |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 929 | // Linkers |
loki@webkit.org | ea6cf18 | 2010-11-24 13:04:35 +0000 | [diff] [blame] | 930 | static intptr_t getAbsoluteJumpAddress(void* base, int offset = 0) |
| 931 | { |
| 932 | return reinterpret_cast<intptr_t>(base) + offset - sizeof(ARMWord); |
| 933 | } |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 934 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 935 | void linkJump(AssemblerLabel from, AssemblerLabel to) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 936 | { |
loki@webkit.org | ea6cf18 | 2010-11-24 13:04:35 +0000 | [diff] [blame] | 937 | ARMWord* insn = reinterpret_cast<ARMWord*>(getAbsoluteJumpAddress(m_buffer.data(), from.m_offset)); |
loki@webkit.org | 15be2dd | 2010-01-08 08:01:40 +0000 | [diff] [blame] | 938 | ARMWord* addr = getLdrImmAddressOnPool(insn, m_buffer.poolAddress()); |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 939 | *addr = toARMWord(to.m_offset); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 940 | } |
| 941 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 942 | static void linkJump(void* code, AssemblerLabel from, void* to) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 943 | { |
loki@webkit.org | ea6cf18 | 2010-11-24 13:04:35 +0000 | [diff] [blame] | 944 | patchPointerInternal(getAbsoluteJumpAddress(code, from.m_offset), to); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 945 | } |
| 946 | |
| 947 | static void relinkJump(void* from, void* to) |
| 948 | { |
loki@webkit.org | ea6cf18 | 2010-11-24 13:04:35 +0000 | [diff] [blame] | 949 | patchPointerInternal(getAbsoluteJumpAddress(from), to); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 950 | } |
| 951 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 952 | static void linkCall(void* code, AssemblerLabel from, void* to) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 953 | { |
loki@webkit.org | ea6cf18 | 2010-11-24 13:04:35 +0000 | [diff] [blame] | 954 | patchPointerInternal(getAbsoluteJumpAddress(code, from.m_offset), to); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 955 | } |
| 956 | |
| 957 | static void relinkCall(void* from, void* to) |
| 958 | { |
loki@webkit.org | ea6cf18 | 2010-11-24 13:04:35 +0000 | [diff] [blame] | 959 | patchPointerInternal(getAbsoluteJumpAddress(from), to); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 960 | } |
| 961 | |
ossy@webkit.org | 699a877 | 2011-11-30 11:06:29 +0000 | [diff] [blame] | 962 | static void* readCallTarget(void* from) |
| 963 | { |
| 964 | return reinterpret_cast<void*>(readPointer(reinterpret_cast<void*>(getAbsoluteJumpAddress(from)))); |
| 965 | } |
| 966 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 967 | static void replaceWithJump(void* instructionStart, void* to) |
| 968 | { |
zherczeg@webkit.org | b98ba08 | 2013-02-13 16:23:29 +0000 | [diff] [blame] | 969 | ARMWord* instruction = reinterpret_cast<ARMWord*>(instructionStart); |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 970 | intptr_t difference = reinterpret_cast<intptr_t>(to) - (reinterpret_cast<intptr_t>(instruction) + DefaultPrefetchOffset * sizeof(ARMWord)); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 971 | |
| 972 | if (!(difference & 1)) { |
| 973 | difference >>= 2; |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 974 | if ((difference <= MaximumBranchOffsetDistance && difference >= MinimumBranchOffsetDistance)) { |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 975 | // Direct branch. |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 976 | instruction[0] = B | AL | (difference & BranchOffsetMask); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 977 | cacheFlush(instruction, sizeof(ARMWord)); |
| 978 | return; |
| 979 | } |
| 980 | } |
| 981 | |
| 982 | // Load target. |
| 983 | instruction[0] = LoadUint32 | AL | RN(ARMRegisters::pc) | RD(ARMRegisters::pc) | 4; |
| 984 | instruction[1] = reinterpret_cast<ARMWord>(to); |
| 985 | cacheFlush(instruction, sizeof(ARMWord) * 2); |
| 986 | } |
| 987 | |
| 988 | static ptrdiff_t maxJumpReplacementSize() |
| 989 | { |
| 990 | return sizeof(ARMWord) * 2; |
| 991 | } |
| 992 | |
zherczeg@webkit.org | adfdb1f | 2012-07-08 10:00:04 +0000 | [diff] [blame] | 993 | static void replaceWithLoad(void* instructionStart) |
| 994 | { |
| 995 | ARMWord* instruction = reinterpret_cast<ARMWord*>(instructionStart); |
| 996 | cacheFlush(instruction, sizeof(ARMWord)); |
| 997 | |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 998 | ASSERT((*instruction & LdrOrAddInstructionMask) == AddImmediateInstruction || (*instruction & LdrOrAddInstructionMask) == LdrImmediateInstruction); |
| 999 | if ((*instruction & LdrOrAddInstructionMask) == AddImmediateInstruction) { |
| 1000 | *instruction = (*instruction & ~LdrOrAddInstructionMask) | LdrImmediateInstruction; |
zherczeg@webkit.org | adfdb1f | 2012-07-08 10:00:04 +0000 | [diff] [blame] | 1001 | cacheFlush(instruction, sizeof(ARMWord)); |
| 1002 | } |
| 1003 | } |
| 1004 | |
| 1005 | static void replaceWithAddressComputation(void* instructionStart) |
| 1006 | { |
| 1007 | ARMWord* instruction = reinterpret_cast<ARMWord*>(instructionStart); |
| 1008 | cacheFlush(instruction, sizeof(ARMWord)); |
| 1009 | |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 1010 | ASSERT((*instruction & LdrOrAddInstructionMask) == AddImmediateInstruction || (*instruction & LdrOrAddInstructionMask) == LdrImmediateInstruction); |
| 1011 | if ((*instruction & LdrOrAddInstructionMask) == LdrImmediateInstruction) { |
| 1012 | *instruction = (*instruction & ~LdrOrAddInstructionMask) | AddImmediateInstruction; |
zherczeg@webkit.org | adfdb1f | 2012-07-08 10:00:04 +0000 | [diff] [blame] | 1013 | cacheFlush(instruction, sizeof(ARMWord)); |
| 1014 | } |
| 1015 | } |
| 1016 | |
zherczeg@webkit.org | 5b49d58 | 2013-02-19 17:12:41 +0000 | [diff] [blame] | 1017 | static void revertBranchPtrWithPatch(void* instructionStart, RegisterID rn, ARMWord imm) |
| 1018 | { |
| 1019 | ARMWord* instruction = reinterpret_cast<ARMWord*>(instructionStart); |
| 1020 | |
| 1021 | ASSERT((instruction[2] & LdrPcImmediateInstructionMask) == LdrPcImmediateInstruction); |
| 1022 | instruction[0] = toARMWord(AL) | ((instruction[2] & 0x0fff0fff) + sizeof(ARMWord)) | RD(ARMRegisters::S1); |
| 1023 | *getLdrImmAddress(instruction) = imm; |
| 1024 | instruction[1] = toARMWord(AL) | CMP | SetConditionalCodes | RN(rn) | RM(ARMRegisters::S1); |
| 1025 | cacheFlush(instruction, 2 * sizeof(ARMWord)); |
| 1026 | } |
| 1027 | |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1028 | // Address operations |
| 1029 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 1030 | static void* getRelocatedAddress(void* code, AssemblerLabel label) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1031 | { |
loki@webkit.org | ea6cf18 | 2010-11-24 13:04:35 +0000 | [diff] [blame] | 1032 | return reinterpret_cast<void*>(reinterpret_cast<char*>(code) + label.m_offset); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1033 | } |
| 1034 | |
| 1035 | // Address differences |
| 1036 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 1037 | static int getDifferenceBetweenLabels(AssemblerLabel a, AssemblerLabel b) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1038 | { |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 1039 | return b.m_offset - a.m_offset; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1040 | } |
| 1041 | |
barraclough@apple.com | 4836c7a | 2011-05-01 22:20:59 +0000 | [diff] [blame] | 1042 | static unsigned getCallReturnOffset(AssemblerLabel call) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1043 | { |
loki@webkit.org | ea6cf18 | 2010-11-24 13:04:35 +0000 | [diff] [blame] | 1044 | return call.m_offset; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1045 | } |
| 1046 | |
| 1047 | // Handle immediates |
| 1048 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 1049 | static ARMWord getOp2(ARMWord imm); |
| 1050 | |
| 1051 | // Fast case if imm is known to be between 0 and 0xff |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1052 | static ARMWord getOp2Byte(ARMWord imm) |
| 1053 | { |
| 1054 | ASSERT(imm <= 0xff); |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 1055 | return Op2Immediate | imm; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1056 | } |
| 1057 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 1058 | static ARMWord getOp2Half(ARMWord imm) |
| 1059 | { |
| 1060 | ASSERT(imm <= 0xff); |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 1061 | return ImmediateForHalfWordTransfer | (imm & 0x0f) | ((imm & 0xf0) << 4); |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 1062 | } |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 1063 | |
loki@webkit.org | 2b8542d8 | 2010-01-05 15:53:17 +0000 | [diff] [blame] | 1064 | #if WTF_ARM_ARCH_AT_LEAST(7) |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 1065 | static ARMWord getImm16Op2(ARMWord imm) |
| 1066 | { |
| 1067 | if (imm <= 0xffff) |
| 1068 | return (imm & 0xf000) << 4 | (imm & 0xfff); |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 1069 | return InvalidImmediate; |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 1070 | } |
| 1071 | #endif |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1072 | ARMWord getImm(ARMWord imm, int tmpReg, bool invert = false); |
| 1073 | void moveImm(ARMWord imm, int dest); |
zoltan@webkit.org | 0014c97 | 2009-11-05 08:28:02 +0000 | [diff] [blame] | 1074 | ARMWord encodeComplexImm(ARMWord imm, int dest); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1075 | |
| 1076 | // Memory load/store helpers |
| 1077 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 1078 | void dataTransfer32(DataTransferTypeA, RegisterID srcDst, RegisterID base, int32_t offset); |
| 1079 | void baseIndexTransfer32(DataTransferTypeA, RegisterID srcDst, RegisterID base, RegisterID index, int scale, int32_t offset); |
| 1080 | void dataTransfer16(DataTransferTypeB, RegisterID srcDst, RegisterID base, int32_t offset); |
| 1081 | void baseIndexTransfer16(DataTransferTypeB, RegisterID srcDst, RegisterID base, RegisterID index, int scale, int32_t offset); |
| 1082 | void dataTransferFloat(DataTransferTypeFloat, FPRegisterID srcDst, RegisterID base, int32_t offset); |
| 1083 | void baseIndexTransferFloat(DataTransferTypeFloat, FPRegisterID srcDst, RegisterID base, RegisterID index, int scale, int32_t offset); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1084 | |
| 1085 | // Constant pool hnadlers |
| 1086 | |
| 1087 | static ARMWord placeConstantPoolBarrier(int offset) |
| 1088 | { |
| 1089 | offset = (offset - sizeof(ARMWord)) >> 2; |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 1090 | ASSERT((offset <= MaximumBranchOffsetDistance && offset >= MinimumBranchOffsetDistance)); |
| 1091 | return AL | B | (offset & BranchOffsetMask); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1092 | } |
| 1093 | |
ossy@webkit.org | d656310 | 2015-08-04 06:51:29 +0000 | [diff] [blame] | 1094 | #if OS(LINUX) && COMPILER(GCC_OR_CLANG) |
rgabor@webkit.org | 81dc3a7 | 2013-03-12 09:41:37 +0000 | [diff] [blame] | 1095 | static inline void linuxPageFlush(uintptr_t begin, uintptr_t end) |
| 1096 | { |
| 1097 | asm volatile( |
| 1098 | "push {r7}\n" |
| 1099 | "mov r0, %0\n" |
| 1100 | "mov r1, %1\n" |
| 1101 | "mov r7, #0xf0000\n" |
| 1102 | "add r7, r7, #0x2\n" |
| 1103 | "mov r2, #0x0\n" |
| 1104 | "svc 0x0\n" |
| 1105 | "pop {r7}\n" |
| 1106 | : |
| 1107 | : "r" (begin), "r" (end) |
| 1108 | : "r0", "r1", "r2"); |
| 1109 | } |
| 1110 | #endif |
| 1111 | |
barraclough@apple.com | efdbf47 | 2012-05-24 21:14:07 +0000 | [diff] [blame] | 1112 | static void cacheFlush(void* code, size_t size) |
| 1113 | { |
ossy@webkit.org | d656310 | 2015-08-04 06:51:29 +0000 | [diff] [blame] | 1114 | #if OS(LINUX) && COMPILER(GCC_OR_CLANG) |
rgabor@webkit.org | 81dc3a7 | 2013-03-12 09:41:37 +0000 | [diff] [blame] | 1115 | size_t page = pageSize(); |
| 1116 | uintptr_t current = reinterpret_cast<uintptr_t>(code); |
| 1117 | uintptr_t end = current + size; |
| 1118 | uintptr_t firstPageEnd = (current & ~(page - 1)) + page; |
| 1119 | |
| 1120 | if (end <= firstPageEnd) { |
| 1121 | linuxPageFlush(current, end); |
| 1122 | return; |
| 1123 | } |
| 1124 | |
| 1125 | linuxPageFlush(current, firstPageEnd); |
| 1126 | |
| 1127 | for (current = firstPageEnd; current + page < end; current += page) |
| 1128 | linuxPageFlush(current, current + page); |
| 1129 | |
| 1130 | linuxPageFlush(current, end); |
barraclough@apple.com | efdbf47 | 2012-05-24 21:14:07 +0000 | [diff] [blame] | 1131 | #else |
| 1132 | #error "The cacheFlush support is missing on this platform." |
| 1133 | #endif |
| 1134 | } |
barraclough@apple.com | efdbf47 | 2012-05-24 21:14:07 +0000 | [diff] [blame] | 1135 | |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1136 | private: |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 1137 | static ARMWord RM(int reg) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1138 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 1139 | ASSERT(reg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1140 | return reg; |
| 1141 | } |
| 1142 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 1143 | static ARMWord RS(int reg) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1144 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 1145 | ASSERT(reg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1146 | return reg << 8; |
| 1147 | } |
| 1148 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 1149 | static ARMWord RD(int reg) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1150 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 1151 | ASSERT(reg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1152 | return reg << 12; |
| 1153 | } |
| 1154 | |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 1155 | static ARMWord RN(int reg) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1156 | { |
eric@webkit.org | 734dd06 | 2009-08-20 00:02:24 +0000 | [diff] [blame] | 1157 | ASSERT(reg <= ARMRegisters::pc); |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1158 | return reg << 16; |
| 1159 | } |
| 1160 | |
| 1161 | static ARMWord getConditionalField(ARMWord i) |
| 1162 | { |
commit-queue@webkit.org | 3dfe8ce | 2012-08-07 22:55:04 +0000 | [diff] [blame] | 1163 | return i & ConditionalFieldMask; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1164 | } |
| 1165 | |
commit-queue@webkit.org | 6c4f927 | 2012-08-07 08:50:43 +0000 | [diff] [blame] | 1166 | static ARMWord toARMWord(Condition cc) |
| 1167 | { |
| 1168 | return static_cast<ARMWord>(cc); |
| 1169 | } |
| 1170 | |
| 1171 | static ARMWord toARMWord(uint32_t u) |
| 1172 | { |
| 1173 | return static_cast<ARMWord>(u); |
| 1174 | } |
| 1175 | |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1176 | int genInt(int reg, ARMWord imm, bool positive); |
| 1177 | |
| 1178 | ARMBuffer m_buffer; |
| 1179 | Jumps m_jumps; |
zherczeg@webkit.org | d6e661f | 2012-07-05 07:04:16 +0000 | [diff] [blame] | 1180 | uint32_t m_indexOfTailOfLastWatchpoint; |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1181 | }; |
| 1182 | |
| 1183 | } // namespace JSC |
| 1184 | |
mjs@apple.com | cc66821 | 2010-01-04 11:38:56 +0000 | [diff] [blame] | 1185 | #endif // ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) |
barraclough@apple.com | 5ea6895 | 2009-07-17 21:56:28 +0000 | [diff] [blame] | 1186 | |
| 1187 | #endif // ARMAssembler_h |