2 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #if USE(ARMV7_DISASSEMBLER)
30 #include "ARMv7DOpcode.h"
37 namespace JSC
{ namespace ARMv7Disassembler
{
39 ARMv7D16BitOpcode::OpcodeGroup
* ARMv7D16BitOpcode::opcodeTable
[32];
40 ARMv7D32BitOpcode::OpcodeGroup
* ARMv7D32BitOpcode::opcodeTable
[16];
42 const char* const ARMv7DOpcode::s_conditionNames
[16] = {
43 "eq", "ne", "hs", "lo", "mi", "pl", "vs", "vc",
44 "hi", "ls", "ge", "lt", "gt", "le", "al", "al"
47 const char* const ARMv7DOpcode::s_optionName
[8] = {
48 "uxtb", "uxth", "uxtw", "uxtx", "sxtb", "sxth", "sxtw", "sxtx"
51 const char* const ARMv7DOpcode::s_shiftNames
[4] = {
52 "lsl", "lsr", "asr", "ror"
55 const char* const ARMv7DOpcode::s_specialRegisterNames
[3] = { "sp", "lr", "pc" };
57 template <typename OpcodeType
, typename InstructionType
>
58 struct OpcodeGroupInitializer
{
59 unsigned m_opcodeGroupNumber
;
60 InstructionType m_mask
;
61 InstructionType m_pattern
;
62 const char* (*m_format
)(OpcodeType
*);
65 #define OPCODE_GROUP_ENTRY(groupIndex, groupClass) \
66 { groupIndex, groupClass::s_mask, groupClass::s_pattern, groupClass::format }
68 typedef OpcodeGroupInitializer
<ARMv7D16BitOpcode
, uint16_t> Opcode16GroupInitializer
;
69 typedef OpcodeGroupInitializer
<ARMv7D32BitOpcode
, uint32_t> Opcode32GroupInitializer
;
71 static Opcode16GroupInitializer opcode16BitGroupList
[] = {
72 OPCODE_GROUP_ENTRY(0x0, ARMv7DOpcodeLogicalImmediateT1
),
73 OPCODE_GROUP_ENTRY(0x1, ARMv7DOpcodeLogicalImmediateT1
),
74 OPCODE_GROUP_ENTRY(0x2, ARMv7DOpcodeLogicalImmediateT1
),
75 OPCODE_GROUP_ENTRY(0x3, ARMv7DOpcodeAddSubtractT1
),
76 OPCODE_GROUP_ENTRY(0x3, ARMv7DOpcodeAddSubtractImmediate3
),
77 OPCODE_GROUP_ENTRY(0x4, ARMv7DOpcodeMoveImmediateT1
),
78 OPCODE_GROUP_ENTRY(0x5, ARMv7DOpcodeCompareImmediateT1
),
79 OPCODE_GROUP_ENTRY(0x6, ARMv7DOpcodeAddSubtractImmediate8
),
80 OPCODE_GROUP_ENTRY(0x7, ARMv7DOpcodeAddSubtractImmediate8
),
81 OPCODE_GROUP_ENTRY(0x8, ARMv7DOpcodeDataProcessingRegisterT1
),
82 OPCODE_GROUP_ENTRY(0x8, ARMv7DOpcodeAddRegisterT2
),
83 OPCODE_GROUP_ENTRY(0x8, ARMv7DOpcodeCompareRegisterT2
),
84 OPCODE_GROUP_ENTRY(0x8, ARMv7DOpcodeCompareRegisterT1
),
85 OPCODE_GROUP_ENTRY(0x8, ARMv7DOpcodeMoveRegisterT1
),
86 OPCODE_GROUP_ENTRY(0x8, ARMv7DOpcodeBranchExchangeT1
),
87 OPCODE_GROUP_ENTRY(0x9, ARMv7DOpcodeLoadFromLiteralPool
),
88 OPCODE_GROUP_ENTRY(0xa, ARMv7DOpcodeLoadStoreRegisterOffsetT1
),
89 OPCODE_GROUP_ENTRY(0xb, ARMv7DOpcodeLoadStoreRegisterOffsetT1
),
90 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeLoadStoreRegisterImmediateWordAndByte
),
91 OPCODE_GROUP_ENTRY(0xd, ARMv7DOpcodeLoadStoreRegisterImmediateWordAndByte
),
92 OPCODE_GROUP_ENTRY(0xe, ARMv7DOpcodeLoadStoreRegisterImmediateWordAndByte
),
93 OPCODE_GROUP_ENTRY(0xf, ARMv7DOpcodeLoadStoreRegisterImmediateWordAndByte
),
94 OPCODE_GROUP_ENTRY(0x10, ARMv7DOpcodeStoreRegisterImmediateHalfWord
),
95 OPCODE_GROUP_ENTRY(0x11, ARMv7DOpcodeLoadRegisterImmediateHalfWord
),
96 OPCODE_GROUP_ENTRY(0x12, ARMv7DOpcodeLoadStoreRegisterSPRelative
),
97 OPCODE_GROUP_ENTRY(0x13, ARMv7DOpcodeLoadStoreRegisterSPRelative
),
98 OPCODE_GROUP_ENTRY(0x14, ARMv7DOpcodeGeneratePCRelativeAddress
),
99 OPCODE_GROUP_ENTRY(0x15, ARMv7DOpcodeAddSPPlusImmediate
),
100 OPCODE_GROUP_ENTRY(0x16, ARMv7DOpcodeMiscCompareAndBranch
),
101 OPCODE_GROUP_ENTRY(0x16, ARMv7DOpcodeMiscByteHalfwordOps
),
102 OPCODE_GROUP_ENTRY(0x16, ARMv7DOpcodeMiscPushPop
),
103 OPCODE_GROUP_ENTRY(0x16, ARMv7DOpcodeMiscAddSubSP
),
104 OPCODE_GROUP_ENTRY(0x17, ARMv7DOpcodeMiscHint16
), // Needs to be before IfThenT1
105 OPCODE_GROUP_ENTRY(0x17, ARMv7DOpcodeMiscIfThenT1
),
106 OPCODE_GROUP_ENTRY(0x17, ARMv7DOpcodeMiscByteHalfwordOps
),
107 OPCODE_GROUP_ENTRY(0x17, ARMv7DOpcodeMiscCompareAndBranch
),
108 OPCODE_GROUP_ENTRY(0x17, ARMv7DOpcodeMiscPushPop
),
109 OPCODE_GROUP_ENTRY(0x17, ARMv7DOpcodeMiscBreakpointT1
),
110 OPCODE_GROUP_ENTRY(0x1a, ARMv7DOpcodeBranchConditionalT1
),
111 OPCODE_GROUP_ENTRY(0x1b, ARMv7DOpcodeBranchConditionalT1
),
112 OPCODE_GROUP_ENTRY(0x1c, ARMv7DOpcodeBranchT2
)
115 static Opcode32GroupInitializer opcode32BitGroupList
[] = {
116 OPCODE_GROUP_ENTRY(0x4, ARMv7DOpcodeDataPopMultiple
),
117 OPCODE_GROUP_ENTRY(0x4, ARMv7DOpcodeDataPushMultiple
),
118 OPCODE_GROUP_ENTRY(0x5, ARMv7DOpcodeDataProcessingShiftedReg
),
119 OPCODE_GROUP_ENTRY(0x6, ARMv7DOpcodeVLDR
),
120 OPCODE_GROUP_ENTRY(0x6, ARMv7DOpcodeVMOVSinglePrecision
),
121 OPCODE_GROUP_ENTRY(0x6, ARMv7DOpcodeVMOVDoublePrecision
),
122 OPCODE_GROUP_ENTRY(0x7, ARMv7DOpcodeFPTransfer
),
123 OPCODE_GROUP_ENTRY(0x7, ARMv7DOpcodeVMSR
),
124 OPCODE_GROUP_ENTRY(0x7, ARMv7DOpcodeVCMP
),
125 OPCODE_GROUP_ENTRY(0x7, ARMv7DOpcodeVCVTBetweenFPAndInt
),
126 OPCODE_GROUP_ENTRY(0x8, ARMv7DOpcodeDataProcessingModifiedImmediate
),
127 OPCODE_GROUP_ENTRY(0x8, ARMv7DOpcodeConditionalBranchT3
),
128 OPCODE_GROUP_ENTRY(0x8, ARMv7DOpcodeBranchOrBranchLink
),
129 OPCODE_GROUP_ENTRY(0x9, ARMv7DOpcodeUnmodifiedImmediate
),
130 OPCODE_GROUP_ENTRY(0x9, ARMv7DOpcodeHint32
),
131 OPCODE_GROUP_ENTRY(0x9, ARMv7DOpcodeConditionalBranchT3
),
132 OPCODE_GROUP_ENTRY(0x9, ARMv7DOpcodeBranchOrBranchLink
),
133 OPCODE_GROUP_ENTRY(0xa, ARMv7DOpcodeDataProcessingModifiedImmediate
),
134 OPCODE_GROUP_ENTRY(0xa, ARMv7DOpcodeConditionalBranchT3
),
135 OPCODE_GROUP_ENTRY(0xa, ARMv7DOpcodeBranchOrBranchLink
),
136 OPCODE_GROUP_ENTRY(0xb, ARMv7DOpcodeUnmodifiedImmediate
),
137 OPCODE_GROUP_ENTRY(0xb, ARMv7DOpcodeConditionalBranchT3
),
138 OPCODE_GROUP_ENTRY(0xb, ARMv7DOpcodeBranchOrBranchLink
),
139 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeLoadRegister
),
140 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeDataPushPopSingle
), // Should be before StoreSingle*
141 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeDataPopMultiple
),
142 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeDataPushMultiple
),
143 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeStoreSingleRegister
),
144 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeStoreSingleImmediate12
),
145 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeStoreSingleImmediate8
),
146 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeLoadSignedImmediate
),
147 OPCODE_GROUP_ENTRY(0xc, ARMv7DOpcodeLoadUnsignedImmediate
),
148 OPCODE_GROUP_ENTRY(0xd, ARMv7DOpcodeLongMultipleDivide
),
149 OPCODE_GROUP_ENTRY(0xd, ARMv7DOpcodeDataProcessingRegShift
),
150 OPCODE_GROUP_ENTRY(0xd, ARMv7DOpcodeDataProcessingRegExtend
),
151 OPCODE_GROUP_ENTRY(0xd, ARMv7DOpcodeDataProcessingRegParallel
),
152 OPCODE_GROUP_ENTRY(0xd, ARMv7DOpcodeDataProcessingRegMisc
),
153 OPCODE_GROUP_ENTRY(0xe, ARMv7DOpcodeVLDR
),
154 OPCODE_GROUP_ENTRY(0xf, ARMv7DOpcodeVCMP
),
155 OPCODE_GROUP_ENTRY(0xf, ARMv7DOpcodeVCVTBetweenFPAndInt
),
158 bool ARMv7DOpcode::s_initialized
= false;
160 void ARMv7DOpcode::init()
165 ARMv7D16BitOpcode::init();
166 ARMv7D32BitOpcode::init();
168 s_initialized
= true;
171 void ARMv7DOpcode::startITBlock(unsigned blocksize
, unsigned firstCondition
)
173 ASSERT(blocksize
> 0 && blocksize
<= MaxITBlockSize
);
174 m_ITBlocksize
= blocksize
;
175 m_ITConditionIndex
= m_ITBlocksize
+ 1;
176 m_currentITCondition
= 0;
177 m_ifThenConditions
[0] = firstCondition
;
180 void ARMv7DOpcode::saveITConditionAt(unsigned blockPosition
, unsigned condition
)
182 if (blockPosition
< m_ITBlocksize
)
183 m_ifThenConditions
[blockPosition
] = static_cast<unsigned char>(condition
);
186 void ARMv7DOpcode::fetchOpcode(uint16_t*& newPC
)
189 m_formatBuffer
[0] = '\0';
194 if (is32BitInstruction()) {
196 m_opcode
|= *newPC
++;
199 if (m_ITConditionIndex
< m_ITBlocksize
)
200 m_currentITCondition
= m_ifThenConditions
[m_ITConditionIndex
];
202 m_currentITCondition
= CondNone
;
205 const char* ARMv7DOpcode::disassemble(uint16_t*& currentPC
)
208 fetchOpcode(currentPC
);
210 if (is32BitInstruction())
211 result
= reinterpret_cast<ARMv7D32BitOpcode
*>(this)->doDisassemble();
213 result
= reinterpret_cast<ARMv7D16BitOpcode
*>(this)->doDisassemble();
215 if (startingITBlock())
216 m_ITConditionIndex
= 0;
217 else if (inITBlock() && (++m_ITConditionIndex
>= m_ITBlocksize
))
223 void ARMv7DOpcode::bufferPrintf(const char* format
, ...)
225 if (m_bufferOffset
>= bufferSize
)
229 va_start(argList
, format
);
231 m_bufferOffset
+= vsnprintf(m_formatBuffer
+ m_bufferOffset
, bufferSize
- m_bufferOffset
, format
, argList
);
236 void ARMv7DOpcode::appendInstructionName(const char* instructionName
, bool addS
)
238 if (!inITBlock() && !addS
) {
239 appendInstructionNameNoITBlock(instructionName
);
244 const char sevenSpaces
[8] = " ";
246 unsigned length
= strlen(instructionName
);
248 bufferPrintf(" %s", instructionName
);
250 const char* condition
= conditionName(m_currentITCondition
);
251 length
+= strlen(condition
);
252 appendString(condition
);
255 appendCharacter('s');
261 appendString(sevenSpaces
+ length
);
264 void ARMv7DOpcode::appendRegisterName(unsigned registerNumber
)
266 registerNumber
&= 0xf;
268 if (registerNumber
> 12) {
269 appendString(s_specialRegisterNames
[registerNumber
- 13]);
273 bufferPrintf("r%u", registerNumber
);
276 void ARMv7DOpcode::appendRegisterList(unsigned registers
)
278 unsigned numberPrinted
= 0;
280 appendCharacter('{');
282 for (unsigned i
= 0; i
< 16; i
++) {
283 if (registers
& (1 << i
)) {
286 appendRegisterName(i
);
290 appendCharacter('}');
293 void ARMv7DOpcode::appendFPRegisterName(char registerPrefix
, unsigned registerNumber
)
295 bufferPrintf("%c%u", registerPrefix
, registerNumber
);
298 // 16 Bit Instructions
300 void ARMv7D16BitOpcode::init()
302 OpcodeGroup
* lastGroups
[OpcodeGroup::opcodeTableSize
];
304 for (unsigned i
= 0; i
< OpcodeGroup::opcodeTableSize
; i
++) {
309 for (unsigned i
= 0; i
< sizeof(opcode16BitGroupList
) / sizeof(Opcode16GroupInitializer
); i
++) {
310 OpcodeGroup
* newOpcodeGroup
= new OpcodeGroup(opcode16BitGroupList
[i
].m_mask
, opcode16BitGroupList
[i
].m_pattern
, opcode16BitGroupList
[i
].m_format
);
311 uint16_t opcodeGroupNumber
= opcode16BitGroupList
[i
].m_opcodeGroupNumber
;
313 if (!opcodeTable
[opcodeGroupNumber
])
314 opcodeTable
[opcodeGroupNumber
] = newOpcodeGroup
;
316 lastGroups
[opcodeGroupNumber
]->setNext(newOpcodeGroup
);
317 lastGroups
[opcodeGroupNumber
] = newOpcodeGroup
;
321 const char* ARMv7D16BitOpcode::doDisassemble()
323 OpcodeGroup
* opGroup
= opcodeTable
[opcodeGroupNumber(m_opcode
)];
326 if (opGroup
->matches(static_cast<uint16_t>(m_opcode
)))
327 return opGroup
->format(this);
328 opGroup
= opGroup
->next();
331 return defaultFormat();
334 const char* ARMv7D16BitOpcode::defaultFormat()
336 bufferPrintf(" .word %04x", m_opcode
);
337 return m_formatBuffer
;
340 const char* ARMv7DOpcodeAddRegisterT2::format()
342 appendInstructionName("add");
343 appendRegisterName(rdn());
345 appendRegisterName(rm());
347 return m_formatBuffer
;
350 const char* ARMv7DOpcodeAddSPPlusImmediate::format()
352 appendInstructionName("add");
353 appendRegisterName(rd());
355 appendRegisterName(RegSP
);
357 appendUnsignedImmediate(immediate8());
359 return m_formatBuffer
;
362 const char* const ARMv7DOpcodeAddSubtract::s_opNames
[2] = { "add", "sub" };
364 const char* ARMv7DOpcodeAddSubtractT1::format()
366 appendInstructionName(opName(), !inITBlock());
367 appendRegisterName(rd());
369 appendRegisterName(rn());
371 appendRegisterName(rm());
373 return m_formatBuffer
;
376 const char* ARMv7DOpcodeAddSubtractImmediate3::format()
378 appendInstructionName(opName(), !inITBlock());
379 appendRegisterName(rd());
381 appendRegisterName(rn());
383 appendUnsignedImmediate(immediate3());
385 return m_formatBuffer
;
388 const char* ARMv7DOpcodeAddSubtractImmediate8::format()
390 appendInstructionName(opName(), !inITBlock());
391 appendRegisterName(rdn());
393 appendUnsignedImmediate(immediate8());
395 return m_formatBuffer
;
398 const char* ARMv7DOpcodeBranchConditionalT1::format()
400 if (condition() == 0xe)
401 return defaultFormat();
403 if (condition() == 0xf) {
404 appendInstructionName("svc");
405 appendUnsignedImmediate(offset());
407 return m_formatBuffer
;
410 bufferPrintf(" b%-6.6s", conditionName(condition()));
411 appendPCRelativeOffset(static_cast<int32_t>(offset()) + 2);
413 return m_formatBuffer
;
416 const char* ARMv7DOpcodeBranchExchangeT1::format()
418 appendInstructionName(opName());
419 appendRegisterName(rm());
421 return m_formatBuffer
;
424 const char* ARMv7DOpcodeBranchT2::format()
426 appendInstructionName("b");
427 appendPCRelativeOffset(static_cast<int32_t>(immediate11()) + 2);
429 return m_formatBuffer
;
432 const char* ARMv7DOpcodeCompareImmediateT1::format()
434 appendInstructionName("cmp");
435 appendRegisterName(rn());
437 appendUnsignedImmediate(immediate8());
439 return m_formatBuffer
;
442 const char* ARMv7DOpcodeCompareRegisterT1::format()
444 appendInstructionName("cmp");
445 appendRegisterName(rn());
447 appendRegisterName(rm());
449 return m_formatBuffer
;
452 const char* ARMv7DOpcodeCompareRegisterT2::format()
454 appendInstructionName("compare");
455 appendRegisterName(rn());
457 appendRegisterName(rm());
459 return m_formatBuffer
;
462 const char* const ARMv7DOpcodeDataProcessingRegisterT1::s_opNames
[16] = {
463 "and", "eor", "lsl", "lsr", "asr", "adc", "sbc", "ror", "tst", "rsb", "cmp", "cmn", "orr", "mul", "bic", "mvn"
466 const char* ARMv7DOpcodeDataProcessingRegisterT1::format()
468 appendInstructionName(opName(), inITBlock() && (!(op() == 0x8) || (op() == 0xa) || (op() == 0xb)));
469 appendRegisterName(rdn());
471 appendRegisterName(rm());
472 if (op() == 0x9) // rsb T1
473 appendString(", #0");
474 else if (op() == 0xd) { // mul T1
476 appendRegisterName(rdn());
479 return m_formatBuffer
;
482 const char* ARMv7DOpcodeGeneratePCRelativeAddress::format()
484 appendInstructionName("adr");
485 appendRegisterName(rd());
487 appendPCRelativeOffset(static_cast<int32_t>(immediate8()));
489 return m_formatBuffer
;
492 const char* ARMv7DOpcodeLoadFromLiteralPool::format()
494 appendInstructionName("ldr");
495 appendRegisterName(rt());
497 appendPCRelativeOffset(static_cast<int32_t>(immediate8()));
499 return m_formatBuffer
;
502 const char* const ARMv7DOpcodeLoadStoreRegisterImmediate::s_opNames
[6] = {
503 "str", "ldr", "strb", "ldrb", "strh", "ldrh"
506 const char* ARMv7DOpcodeLoadStoreRegisterImmediate::format()
508 const char* instructionName
= opName();
510 if (!instructionName
)
511 return defaultFormat();
513 appendInstructionName(opName());
514 appendRegisterName(rt());
516 appendCharacter('[');
517 appendRegisterName(rn());
520 appendUnsignedImmediate(immediate5() << scale());
522 appendCharacter(']');
524 return m_formatBuffer
;
527 unsigned ARMv7DOpcodeLoadStoreRegisterImmediate::scale()
542 ASSERT_NOT_REACHED();
546 const char* const ARMv7DOpcodeLoadStoreRegisterOffsetT1::s_opNames
[8] = {
547 "str", "strh", "strb", "ldrsb", "ldr", "ldrh", "ldrb", "ldrsh"
550 const char* ARMv7DOpcodeLoadStoreRegisterOffsetT1::format()
552 appendInstructionName(opName());
553 appendRegisterName(rt());
555 appendCharacter('[');
556 appendRegisterName(rn());
558 appendRegisterName(rm());
559 appendCharacter(']');
561 return m_formatBuffer
;
564 const char* ARMv7DOpcodeLoadStoreRegisterSPRelative::format()
566 appendInstructionName(opName());
567 appendRegisterName(rt());
569 appendCharacter('[');
570 appendRegisterName(RegSP
);
573 appendUnsignedImmediate(immediate8() << 2);
575 appendCharacter(']');
577 return m_formatBuffer
;
580 const char* ARMv7DOpcodeLogicalImmediateT1::format()
582 if (!op() && !immediate5()) {
584 appendInstructionName("movs");
585 appendRegisterName(rd());
587 appendRegisterName(rm());
589 return m_formatBuffer
;
592 appendInstructionName(opName(), !inITBlock());
593 appendRegisterName(rd());
595 appendRegisterName(rm());
597 appendUnsignedImmediate((op() && !immediate5()) ? 32 : immediate5());
599 return m_formatBuffer
;
602 const char* ARMv7DOpcodeMiscAddSubSP::format()
604 appendInstructionName(opName());
605 appendRegisterName(RegSP
);
607 appendRegisterName(RegSP
);
609 appendUnsignedImmediate(immediate7());
611 return m_formatBuffer
;
614 const char* ARMv7DOpcodeMiscBreakpointT1::format()
616 appendInstructionNameNoITBlock("bkpt");
617 appendUnsignedImmediate(immediate8());
619 return m_formatBuffer
;
622 const char* const ARMv7DOpcodeMiscByteHalfwordOps::s_opNames
[8] = {
623 "sxth", "sxb", "uxth", "uxtb", "rev", "rev16", "revsh"
626 const char* ARMv7DOpcodeMiscByteHalfwordOps::format()
628 const char* instructionName
= opName();
630 if (!instructionName
)
631 return defaultFormat();
633 appendInstructionName(instructionName
);
634 appendRegisterName(rd());
636 appendRegisterName(rm());
638 return m_formatBuffer
;
641 const char* ARMv7DOpcodeMiscCompareAndBranch::format()
643 appendInstructionName(opName());
644 appendPCRelativeOffset(immediate6() + 2);
646 return m_formatBuffer
;
649 const char* const ARMv7DOpcodeMiscHint16::s_opNames
[16] = {
650 "nop", "yield", "wfe", "wfi", "sev"
653 const char* ARMv7DOpcodeMiscHint16::format()
656 return defaultFormat();
658 appendInstructionName(opName());
660 return m_formatBuffer
;
663 const char* ARMv7DOpcodeMiscIfThenT1::format()
669 unsigned condition
= firstCondition();
670 unsigned maskBits
= mask();
671 unsigned blockLength
= 0;
673 for (unsigned i
= 0; i
< 4; ++i
) {
674 if (maskBits
& (1 << i
)) {
680 startITBlock(blockLength
, condition
);
682 for (unsigned i
= 1; i
< blockLength
; ++i
) {
683 unsigned currMaskBit
= (maskBits
>> (4-i
)) & 0x1;
684 opName
[i
+ 1] = (currMaskBit
^ (condition
& 1)) ? 'e' : 't';
685 saveITConditionAt(i
, (condition
& ~1) | currMaskBit
);
687 opName
[blockLength
+ 1] = '\0';
689 appendInstructionNameNoITBlock(opName
);
690 appendString(conditionName(condition
));
692 return m_formatBuffer
;
695 const char* ARMv7DOpcodeMiscPushPop::format()
697 appendInstructionName(opName());
698 appendRegisterList(registerMask());
700 return m_formatBuffer
;
703 const char* ARMv7DOpcodeMoveImmediateT1::format()
705 appendInstructionName("mov", !inITBlock());
706 appendRegisterName(rd());
708 appendUnsignedImmediate(immediate8());
710 return m_formatBuffer
;
713 const char* ARMv7DOpcodeMoveRegisterT1::format()
715 appendInstructionName("mov");
716 appendRegisterName(rd());
718 appendRegisterName(rm());
720 return m_formatBuffer
;
723 // 32 bit Intructions
725 void ARMv7D32BitOpcode::init()
727 OpcodeGroup
* lastGroups
[OpcodeGroup::opcodeTableSize
];
729 for (unsigned i
= 0; i
< OpcodeGroup::opcodeTableSize
; i
++) {
734 for (unsigned i
= 0; i
< sizeof(opcode32BitGroupList
) / sizeof(Opcode32GroupInitializer
); i
++) {
735 OpcodeGroup
* newOpcodeGroup
= new OpcodeGroup(opcode32BitGroupList
[i
].m_mask
, opcode32BitGroupList
[i
].m_pattern
, opcode32BitGroupList
[i
].m_format
);
736 uint16_t opcodeGroupNumber
= opcode32BitGroupList
[i
].m_opcodeGroupNumber
;
738 if (!opcodeTable
[opcodeGroupNumber
])
739 opcodeTable
[opcodeGroupNumber
] = newOpcodeGroup
;
741 lastGroups
[opcodeGroupNumber
]->setNext(newOpcodeGroup
);
742 lastGroups
[opcodeGroupNumber
] = newOpcodeGroup
;
746 const char* ARMv7D32BitOpcode::doDisassemble()
748 OpcodeGroup
* opGroup
= opcodeTable
[opcodeGroupNumber(m_opcode
)];
751 if (opGroup
->matches(m_opcode
))
752 return opGroup
->format(this);
753 opGroup
= opGroup
->next();
756 return defaultFormat();
759 const char* ARMv7D32BitOpcode::defaultFormat()
761 bufferPrintf(" .long %08x", m_opcode
);
762 return m_formatBuffer
;
765 const char* ARMv7DOpcodeConditionalBranchT3::format()
767 if (condition() < 0xe)
768 bufferPrintf(" b%-6.6s", conditionName(condition()));
770 appendInstructionName("b");
771 appendPCRelativeOffset(offset() + 2);
773 return m_formatBuffer
;
776 const char* ARMv7DOpcodeBranchOrBranchLink::format()
778 appendInstructionName(isBL() ? "bl" : "b");
779 appendPCRelativeOffset(offset() + 2);
781 return m_formatBuffer
;
784 const char* const ARMv7DOpcodeDataProcessingLogicalAndRithmetic::s_opNames
[16] = {
785 "and", "bic", "orr", "orn", "eor", 0, "pkh", 0, "add", 0, "adc", "sbc", 0, "sub", "rsb", 0
788 void ARMv7DOpcodeDataProcessingModifiedImmediate::appendModifiedImmediate(unsigned immediate12
)
790 if (!(immediate12
& 0xc00)) {
791 unsigned immediate
= 0;
792 unsigned lower8Bits
= immediate12
& 0xff;
794 switch ((immediate12
>> 8) & 3) {
796 immediate
= lower8Bits
;
799 immediate
= (lower8Bits
<< 16) | lower8Bits
;
802 immediate
= (lower8Bits
<< 24) | (lower8Bits
<< 8);
805 immediate
= (lower8Bits
<< 24) | (lower8Bits
<< 16) | (lower8Bits
<< 8) | lower8Bits
;
808 appendUnsignedImmediate(immediate
);
812 unsigned immediate8
= 0x80 | (immediate12
& 0x7f);
813 unsigned shiftAmount
= 32 - ((immediate12
>> 7) & 0x1f);
815 appendUnsignedImmediate(immediate8
<< shiftAmount
);
818 const char* ARMv7DOpcodeDataProcessingModifiedImmediate::format()
820 if ((op() == 0x5) || (op() == 0x6) || (op() == 0x7) || (op() == 0x9) || (op() == 0xc) || (op() == 0xf))
821 return defaultFormat();
823 const char* instructionName
= opName();
828 instructionName
= sBit() ? "movs" : "mov";
829 appendInstructionName(instructionName
);
830 appendRegisterName(rd());
832 appendModifiedImmediate(immediate12());
834 return m_formatBuffer
;
839 instructionName
= sBit() ? "mvns" : "mvn";
840 appendInstructionName(instructionName
);
841 appendRegisterName(rd());
843 appendModifiedImmediate(immediate12());
845 return m_formatBuffer
;
851 bool testOrCmpInstruction
= false;
855 instructionName
= "tst";
856 testOrCmpInstruction
= true;
859 instructionName
= "teq";
860 testOrCmpInstruction
= true;
863 instructionName
= "cmn";
864 testOrCmpInstruction
= true;
867 instructionName
= "cmp";
868 testOrCmpInstruction
= true;
872 if (testOrCmpInstruction
) {
873 appendInstructionName(instructionName
);
874 appendRegisterName(rn());
876 appendModifiedImmediate(immediate12());
878 return m_formatBuffer
;
883 appendInstructionName(instructionName
);
884 appendRegisterName(rd());
886 appendRegisterName(rn());
888 appendModifiedImmediate(immediate12());
890 return m_formatBuffer
;
893 void ARMv7DOpcodeDataProcessingShiftedReg::appendImmShift(unsigned type
, unsigned immediate
)
895 if (type
|| immediate
) {
910 appendShiftType(type
);
911 appendUnsignedImmediate(immediate
);
915 const char* ARMv7DOpcodeDataProcessingShiftedReg::format()
917 if ((op() == 0x5) || (op() == 0x7) || (op() == 0x9) || (op() == 0xc) || (op() == 0xf))
918 return defaultFormat();
922 if (sBit() || tBit())
923 return defaultFormat();
926 appendInstructionName("pkhtb");
928 appendInstructionName("pkhbt");
929 appendRegisterName(rd());
931 appendRegisterName(rn());
933 appendRegisterName(rm());
934 appendImmShift(tbBit() << 1, immediate5());
936 return m_formatBuffer
;
939 const char* instructionName
= opName();
943 if (!type() && !immediate5()) {
945 instructionName
= sBit() ? "movs" : "mov";
946 appendInstructionName(instructionName
);
947 appendRegisterName(rd());
949 appendRegisterName(rm());
951 return m_formatBuffer
;
954 if (type() == 3 && !immediate5()) {
956 instructionName
= sBit() ? "rrx" : "rrx";
957 appendInstructionName(instructionName
);
958 appendRegisterName(rd());
960 appendRegisterName(rm());
962 return m_formatBuffer
;
967 bufferPrintf("%ss ", shiftName(type()));
969 appendInstructionName(shiftName(type()));
970 appendRegisterName(rd());
972 appendRegisterName(rm());
974 appendUnsignedImmediate(immediate5());
976 return m_formatBuffer
;
981 instructionName
= sBit() ? "mvns" : "mvn";
982 appendInstructionName(instructionName
);
983 appendRegisterName(rd());
985 appendRegisterName(rm());
986 appendImmShift(type(), immediate5());
988 return m_formatBuffer
;
994 bool testOrCmpInstruction
= false;
998 instructionName
= "tst";
999 testOrCmpInstruction
= true;
1002 instructionName
= "teq";
1003 testOrCmpInstruction
= true;
1006 instructionName
= "cmn";
1007 testOrCmpInstruction
= true;
1010 instructionName
= "cmp";
1011 testOrCmpInstruction
= true;
1015 if (testOrCmpInstruction
) {
1016 appendInstructionName(instructionName
);
1017 appendRegisterName(rn());
1019 appendRegisterName(rm());
1020 appendImmShift(type(), immediate5());
1022 return m_formatBuffer
;
1027 appendInstructionName(instructionName
);
1028 appendRegisterName(rd());
1030 appendRegisterName(rn());
1032 appendRegisterName(rm());
1033 appendImmShift(type(), immediate5());
1035 return m_formatBuffer
;
1038 const char* ARMv7DOpcodeFPTransfer::format()
1040 appendInstructionName("vmov");
1047 appendRegisterName(rt());
1054 return m_formatBuffer
;
1057 void ARMv7DOpcodeFPTransfer::appendFPRegister()
1060 appendFPRegisterName('d', vd());
1061 bufferPrintf("[%u]", opH());
1063 appendFPRegisterName('s', vn());
1066 const char* ARMv7DOpcodeDataProcessingRegShift::format()
1068 appendInstructionName(opName());
1069 appendRegisterName(rd());
1071 appendRegisterName(rn());
1073 appendRegisterName(rm());
1075 return m_formatBuffer
;
1078 const char* const ARMv7DOpcodeDataProcessingRegExtend::s_opExtendNames
[8] = {
1079 "sxth", "uxth", "sxtb16", "uxtb16", "sxtb", "uxtb"
1082 const char* const ARMv7DOpcodeDataProcessingRegExtend::s_opExtendAndAddNames
[8] = {
1083 "sxtah", "uxtah", "sxtab16", "uxtab16", "sxtab", "uxtab"
1086 const char* ARMv7DOpcodeDataProcessingRegExtend::format()
1088 const char* instructionName
;
1091 instructionName
= opExtendName();
1093 instructionName
= opExtendAndAddName();
1095 if (!instructionName
)
1096 return defaultFormat();
1098 appendInstructionName(instructionName
);
1099 appendRegisterName(rd());
1101 appendRegisterName(rn());
1103 appendRegisterName(rm());
1107 appendString("ror ");
1108 appendUnsignedImmediate(rotate() * 8);
1111 return m_formatBuffer
;
1114 const char* const ARMv7DOpcodeDataProcessingRegParallel::s_opNames
[16] = {
1115 "sadd8", "sadd16", "sasx", 0, "ssub8", "ssub16", "ssax", 0,
1116 "qadd8", "qadd16", "qasx", 0, "qsub8", "qsub16", "qsax", 0
1119 const char* ARMv7DOpcodeDataProcessingRegParallel::format()
1121 const char* instructionName
;
1123 instructionName
= opName();
1125 if (!instructionName
)
1126 return defaultFormat();
1128 appendInstructionName(instructionName
);
1129 appendRegisterName(rd());
1131 appendRegisterName(rn());
1133 appendRegisterName(rm());
1135 return m_formatBuffer
;
1138 const char* const ARMv7DOpcodeDataProcessingRegMisc::s_opNames
[16] = {
1139 "qadd", "qdadd", "qsub", "qdsub", "rev", "rev16", "rbit", "revsh",
1140 "sel", 0, 0, 0, "clz"
1143 const char* ARMv7DOpcodeDataProcessingRegMisc::format()
1145 const char* instructionName
;
1147 instructionName
= opName();
1149 if (!instructionName
)
1150 return defaultFormat();
1152 if ((op1() & 0x1) && (rn() != rm()))
1153 return defaultFormat();
1155 appendInstructionName(instructionName
);
1156 appendRegisterName(rd());
1159 if (op1() == 0x2) { // sel
1160 appendRegisterName(rn());
1162 appendRegisterName(rm());
1164 return m_formatBuffer
;
1167 appendRegisterName(rm());
1169 if (!(op1() & 0x1)) {
1171 appendRegisterName(rn());
1174 return m_formatBuffer
;
1177 const char* const ARMv7DOpcodeHint32::s_opNames
[8] = {
1178 "nop", "yield", "wfe", "wfi", "sev"
1181 const char* ARMv7DOpcodeHint32::format()
1183 if (isDebugHint()) {
1184 appendInstructionName("debug");
1185 appendUnsignedImmediate(debugOption());
1187 return m_formatBuffer
;
1191 return defaultFormat();
1193 appendInstructionName(opName());
1195 return m_formatBuffer
;
1198 const char* const ARMv7DOpcodeDataLoad::s_opNames
[8] = {
1199 "ldrb", "ldrh", "ldr", 0, "ldrsb", "ldrsh"
1202 const char* ARMv7DOpcodeLoadRegister::format()
1204 appendInstructionName(opName());
1205 appendRegisterName(rt());
1207 appendCharacter('[');
1208 appendRegisterName(rn());
1210 appendRegisterName(rm());
1213 appendUnsignedImmediate(immediate2());
1215 appendCharacter(']');
1217 return m_formatBuffer
;
1220 const char* ARMv7DOpcodeLoadSignedImmediate::format()
1222 appendInstructionName(opName());
1223 appendRegisterName(rt());
1225 appendCharacter('[');
1226 appendRegisterName(rn());
1228 if (wBit() || immediate8()) {
1231 appendUnsignedImmediate(immediate8());
1233 appendSignedImmediate(0 - static_cast<int>(immediate8()));
1235 appendCharacter(']');
1237 appendCharacter('!');
1239 appendCharacter(']');
1242 appendUnsignedImmediate(immediate8());
1244 appendSignedImmediate(0 - static_cast<int>(immediate8()));
1247 return m_formatBuffer
;
1250 const char* ARMv7DOpcodeLoadUnsignedImmediate::format()
1252 appendInstructionName(opName());
1253 appendRegisterName(rt());
1255 appendCharacter('[');
1256 appendRegisterName(rn());
1257 if (immediate12()) {
1259 appendUnsignedImmediate(immediate12());
1261 appendCharacter(']');
1263 return m_formatBuffer
;
1266 const char* const ARMv7DOpcodeLongMultipleDivide::s_opNames
[8] = {
1267 "smull", "sdiv", "umull", "udiv", "smlal", "smlsld", "umlal", 0
1270 const char* const ARMv7DOpcodeLongMultipleDivide::s_smlalOpNames
[4] = {
1271 "smlalbb", "smlalbt", "smlaltb", "smlaltt"
1274 const char* const ARMv7DOpcodeLongMultipleDivide::s_smlaldOpNames
[2] = {
1278 const char* const ARMv7DOpcodeLongMultipleDivide::s_smlsldOpNames
[2] = {
1282 const char* ARMv7DOpcodeLongMultipleDivide::format()
1284 const char* instructionName
= opName();
1290 return defaultFormat();
1295 return defaultFormat();
1298 if ((op2() & 0xc) == 0x8)
1299 instructionName
= smlalOpName();
1300 else if ((op2() & 0xe) == 0xc)
1301 instructionName
= smlaldOpName();
1303 return defaultFormat();
1306 if ((op2() & 0xe) == 0xc)
1307 instructionName
= smlaldOpName();
1309 return defaultFormat();
1313 instructionName
= "umaal";
1315 return defaultFormat();
1318 return defaultFormat();
1322 appendInstructionName(instructionName
);
1323 if ((op1() & 0x5) == 0x1) { // sdiv and udiv
1325 return defaultFormat();
1327 appendRegisterName(rdLo());
1330 appendRegisterName(rdHi());
1332 appendRegisterName(rn());
1334 appendRegisterName(rm());
1336 return m_formatBuffer
;
1339 const char* const ARMv7DOpcodeUnmodifiedImmediate::s_opNames
[16] = {
1340 "addw", 0, "movw", 0, 0, "subw", "movt", 0,
1341 "ssat", "ssat16", "sbfx", "bfi", "usat" , "usat16", "ubfx", 0
1344 const char* ARMv7DOpcodeUnmodifiedImmediate::format()
1346 const char* instructionName
= opName();
1348 switch (op() >> 1) {
1352 instructionName
= "adr";
1356 instructionName
= "ssat";
1360 instructionName
= "bfc";
1364 instructionName
= "usat";
1368 if (!instructionName
)
1369 return defaultFormat();
1371 appendInstructionName(instructionName
);
1372 appendRegisterName(rd());
1375 if ((op() & 0x17) == 0x4) { // movw or movt
1376 appendUnsignedImmediate(immediate16());
1378 return m_formatBuffer
;
1381 if (!op() || (op() == 0xa)) { // addw, subw and adr
1385 if ((op() == 0xa) && (rn() == 0xf))
1386 offset
= 0 - static_cast<int32_t>(immediate12());
1388 offset
= static_cast<int32_t>(immediate12());
1390 appendPCRelativeOffset(offset
);
1392 return m_formatBuffer
;
1395 appendRegisterName(rn());
1397 appendUnsignedImmediate(immediate12());
1399 return m_formatBuffer
;
1402 if (((op() & 0x15) == 0x10) || (((op() & 0x17) == 0x12) && immediate5())) { // ssat, usat, ssat16 & usat16
1404 appendUnsignedImmediate(bitNumOrSatImmediate() + 1);
1406 appendRegisterName(rn());
1407 if (shBit() || immediate5()) {
1409 appendShiftType(shBit() << 1);
1410 appendUnsignedImmediate(immediate5());
1413 return m_formatBuffer
;
1416 if (op() == 0x16) { // bfi or bfc
1417 int width
= static_cast<int>(bitNumOrSatImmediate()) - static_cast<int>(immediate5()) + 1;
1420 return defaultFormat();
1424 appendRegisterName(rn());
1427 appendUnsignedImmediate(immediate5());
1429 appendSignedImmediate(width
);
1431 return m_formatBuffer
;
1434 // Must be sbfx or ubfx
1436 appendRegisterName(rn());
1438 appendUnsignedImmediate(immediate5());
1440 appendUnsignedImmediate(bitNumOrSatImmediate() + 1);
1442 return m_formatBuffer
;
1445 const char* const ARMv7DOpcodeDataStoreSingle::s_opNames
[4] = {
1446 "strb", "strh", "str", 0
1449 const char* ARMv7DOpcodeDataPushPopSingle::format()
1451 appendInstructionName(opName());
1452 appendRegisterName(rt());
1454 return m_formatBuffer
;
1457 void ARMv7DOpcodeDataPushPopMultiple::appendRegisterList()
1459 unsigned registers
= registerList();
1461 appendCharacter('{');
1462 bool needSeparator
= false;
1464 for (unsigned i
= 0; i
< 16; i
++) {
1465 if (registers
& (1 << i
)) {
1468 appendRegisterName(i
);
1469 needSeparator
= true;
1472 appendCharacter('}');
1475 const char* ARMv7DOpcodeDataPopMultiple::format()
1477 if (condition() != 0xe)
1478 bufferPrintf(" pop%-4.4s", conditionName(condition()));
1480 appendInstructionName("pop");
1481 appendRegisterList();
1483 return m_formatBuffer
;
1486 const char* ARMv7DOpcodeDataPushMultiple::format()
1488 if (condition() != 0xe)
1489 bufferPrintf(" push%-3.3s", conditionName(condition()));
1491 appendInstructionName("push");
1492 appendRegisterList();
1494 return m_formatBuffer
;
1497 const char* ARMv7DOpcodeStoreSingleImmediate12::format()
1499 appendInstructionName(opName());
1500 appendRegisterName(rt());
1502 appendCharacter('[');
1503 appendRegisterName(rn());
1504 if (immediate12()) {
1506 appendUnsignedImmediate(immediate12());
1508 appendCharacter(']');
1510 return m_formatBuffer
;
1513 const char* ARMv7DOpcodeStoreSingleImmediate8::format()
1515 if (pBit() && uBit() && !wBit()) // Really undecoded strt
1516 return defaultFormat();
1518 if ((rn() == 0xf) || (!pBit() && !wBit()))
1519 return defaultFormat();
1521 appendInstructionName(opName());
1522 appendRegisterName(rt());
1524 appendCharacter('[');
1525 appendRegisterName(rn());
1528 appendCharacter(']');
1530 appendSignedImmediate(uBit() ? static_cast<int32_t>(immediate8()) : (0 - static_cast<int32_t>(immediate8())));
1532 return m_formatBuffer
;
1537 appendSignedImmediate(uBit() ? static_cast<int32_t>(immediate8()) : (0 - static_cast<int32_t>(immediate8())));
1539 appendCharacter(']');
1542 appendCharacter('!');
1544 return m_formatBuffer
;
1547 const char* ARMv7DOpcodeStoreSingleRegister::format()
1549 appendInstructionName(opName());
1550 appendRegisterName(rt());
1552 appendCharacter('[');
1553 appendRegisterName(rn());
1555 appendRegisterName(rm());
1558 appendString("lsl ");
1559 appendUnsignedImmediate(immediate2());
1561 appendCharacter(']');
1563 return m_formatBuffer
;
1566 const char* ARMv7DOpcodeVCMP::format()
1568 bufferPrintf(" vcmp");
1571 appendCharacter('e'); // Raise exception on qNaN
1573 if (condition() != 0xe)
1574 appendString(conditionName(condition()));
1576 appendCharacter('.');
1577 appendString(szBit() ? "f64" : "f32");
1578 appendCharacter(' ');
1580 appendFPRegisterName('d', (dBit() << 4) | vd());
1582 appendFPRegisterName('d', (mBit() << 4) | vm());
1584 appendFPRegisterName('s', (vd() << 1) | dBit());
1586 appendFPRegisterName('s', (vm() << 1) | mBit());
1589 return m_formatBuffer
;
1592 const char* ARMv7DOpcodeVCVTBetweenFPAndInt::format()
1594 bufferPrintf(" vcvt");
1595 bool convertToInteger
= op2() & 0x4;
1597 if (convertToInteger
) {
1599 appendCharacter('r'); // Round using mode in FPSCR
1600 if (condition() != 0xe)
1601 appendString(conditionName(condition()));
1602 appendCharacter('.');
1603 appendCharacter((op2() & 1) ? 's' : 'u');
1604 appendString("32.f");
1605 appendString(szBit() ? "64" : "32");
1606 appendCharacter(' ');
1607 appendFPRegisterName('s', (vd() << 1) | dBit());
1610 appendFPRegisterName('d', (mBit() << 4) | vm());
1612 appendFPRegisterName('s', (vm() << 1) | mBit());
1614 if (condition() != 0xe)
1615 appendString(conditionName(condition()));
1616 appendCharacter('.');
1617 appendString(szBit() ? "f64." : "f32.");
1618 appendString(op() ? "s32" : "u32");
1619 appendCharacter(' ');
1621 appendFPRegisterName('d', (dBit() << 4) | vd());
1623 appendFPRegisterName('s', (vd() << 1) | dBit());
1625 appendFPRegisterName('s', (vm() << 1) | mBit());
1628 return m_formatBuffer
;
1631 const char* ARMv7DOpcodeVLDR::format()
1633 if (condition() != 0xe)
1634 bufferPrintf(" vldr%-3.3s", conditionName(condition()));
1636 appendInstructionName("vldr");
1638 appendFPRegisterName(doubleReg() ? 'd' : 's', vd());
1641 int immediate
= immediate8() * 4;
1644 immediate
= -immediate
;
1646 appendCharacter('[');
1649 appendPCRelativeOffset(immediate
);
1651 appendRegisterName(rn());
1655 appendSignedImmediate(immediate
);
1659 appendCharacter(']');
1661 return m_formatBuffer
;
1664 const char* ARMv7DOpcodeVMOVDoublePrecision::format()
1666 appendInstructionName("vmov");
1668 appendRegisterName(rt());
1670 appendRegisterName(rt2());
1674 appendFPRegisterName('d', vm());
1678 appendRegisterName(rt());
1680 appendRegisterName(rt2());
1683 return m_formatBuffer
;
1686 const char* ARMv7DOpcodeVMOVSinglePrecision::format()
1688 appendInstructionName("vmov");
1690 appendRegisterName(rt());
1692 appendRegisterName(rt2());
1696 appendFPRegisterName('s', vm());
1698 appendFPRegisterName('s', (vm() + 1) % 32);
1702 appendRegisterName(rt());
1704 appendRegisterName(rt2());
1707 return m_formatBuffer
;
1710 const char* ARMv7DOpcodeVMSR::format()
1712 appendInstructionName("vmrs");
1715 appendString("apsr_nzcv");
1717 appendRegisterName(rt());
1721 appendString("fpscr");
1725 appendRegisterName(rt());
1728 return m_formatBuffer
;
1731 } } // namespace JSC::ARMv7Disassembler
1733 #endif // #if USE(ARMV7_DISASSEMBLER)