<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<p style="margin: 0px 0px 1em; padding: 0px; color: rgb(0, 0, 0);
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: 20px;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px; background-color: rgb(255,
255, 255);"><font face="monospace">Hello.<br>
</font></p>
<p style="margin: 0px 0px 1em; padding: 0px; color: rgb(0, 0, 0);
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: 20px;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px; background-color: rgb(255,
255, 255);"><font face="monospace">Please review this simple
instruction decoding fix. The MC disassembler does not decode
correctly mov instructions which place an immediate into sp.
Assembly works fine:<br>
</font></p>
<p style="margin: 0px 0px 1em; padding: 0px; color: rgb(0, 0, 0);
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: 20px;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px; background-color: rgb(255,
255, 255);"><font face="monospace">echo "movt sp, #0xd45" |
../build/bin/llvm-mc -assemble -show-inst -triple=armv7
-show-encoding<br>
.text<br>
movt sp, #3397 @ encoding:<span class="Apple-converted-space"> </span><span
class="error">[0x45,0xdd,0x40,0xe3]</span><br>
@ <MCInst #232 MOVTi16<br>
@ <MCOperand Reg:105><br>
@ <MCOperand Reg:105><br>
@ <MCOperand Imm:3397><br>
@ <MCOperand Imm:14><br>
@ <MCOperand Reg:0>></font></p>
<p style="margin: 0px 0px 1em; padding: 0px; color: rgb(0, 0, 0);
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: 20px;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px; background-color: rgb(255,
255, 255);"><font face="monospace">but disassembly fails:</font></p>
<p style="margin: 0px 0px 1em; padding: 0px; color: rgb(0, 0, 0);
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: 20px;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px; background-color: rgb(255,
255, 255);"><font face="monospace">echo "0x45 0xdd 0x40 0xe3" |
../build/bin/llvm-mc -disassemble -show-inst -triple=armv7
-show-encoding<br>
.text<br>
<stdin>:1:1: warning: invalid instruction encoding<br>
0x45 0xdd 0x40 0xe3<br>
^<br>
<stdin>:1:6: warning: invalid instruction encoding<br>
0x45 0xdd 0x40 0xe3<br>
^<br>
<stdin>:1:11: warning: invalid instruction encoding<br>
0x45 0xdd 0x40 0xe3<br>
^<br>
<stdin>:1:16: warning: invalid instruction encoding<br>
0x45 0xdd 0x40 0xe3<br>
</font></p>
<p style="margin: 0px 0px 1em; padding: 0px; color: rgb(0, 0, 0);
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: 20px;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px; background-color: rgb(255,
255, 255);"><font face="monospace">Regards,<br>
Mihai<br>
</font></p>
</body>
</html>