}
else if (code & 0x00FF0000)
{
+ // BT supports 16 bit operands and this code doesn't handle the necessary 66 prefix.
+ assert(ins != INS_bt);
+
assert((attrSize == EA_4BYTE) || (attrSize == EA_PTRSIZE) // Only for x64
|| (attrSize == EA_16BYTE) // only for x64
|| (ins == INS_movzx) || (ins == INS_movsx));
UNATIVE_OFFSET valSize = EA_SIZE_IN_BYTES(id->idOpSize());
bool valInByte = ((signed char)val == val) && (ins != INS_mov) && (ins != INS_test);
+ // We should never generate BT mem,reg because it has poor performance. BT mem,imm might be useful
+ // but it requires special handling of the immediate value (it is always encoded in a byte).
+ // Let's not complicate things until this is needed.
+ assert(ins != INS_bt);
+
#ifdef _TARGET_AMD64_
// mov reg, imm64 is the only opcode which takes a full 8 byte immediate
// all other opcodes take a sign-extended 4-byte immediate
insFormat fmt = emitInsModeFormat(ins, IF_RRD_CNS);
bool valInByte = ((signed char)val == val) && (ins != INS_mov) && (ins != INS_test);
+ // BT reg,imm might be useful but it requires special handling of the immediate value
+ // (it is always encoded in a byte). Let's not complicate things until this is needed.
+ assert(ins != INS_bt);
+
// Figure out the size of the instruction
switch (ins)
{
{
printf("%s, %s", emitRegName(id->idReg1(), EA_PTRSIZE), emitRegName(id->idReg2(), attr));
}
+ else if (ins == INS_bt)
+ {
+ // INS_bt operands are reversed. Display them in the normal order.
+ printf("%s, %s", emitRegName(id->idReg2(), attr), emitRegName(id->idReg1(), attr));
+ }
else
{
printf("%s, %s", emitRegName(id->idReg1(), attr), emitRegName(id->idReg2(), attr));
}
else if (code & 0x00FF0000)
{
+ // BT supports 16 bit operands and this code doesn't handle the necessary 66 prefix.
+ assert(ins != INS_bt);
+
// Output the REX prefix
dst += emitOutputRexOrVexPrefixIfNeeded(ins, dst, code);
}
else if (code & 0x00FF0000)
{
+ // BT supports 16 bit operands and this code doesn't add the necessary 66 prefix.
+ assert(ins != INS_bt);
+
// Output the REX prefix
dst += emitOutputRexOrVexPrefixIfNeeded(ins, dst, code);
ssize_t val = emitGetInsSC(id);
bool valInByte = ((signed char)val == val) && (ins != INS_mov) && (ins != INS_test);
+ // BT reg,imm might be useful but it requires special handling of the immediate value
+ // (it is always encoded in a byte). Let's not complicate things until this is needed.
+ assert(ins != INS_bt);
+
if (id->idIsCnsReloc())
{
valInByte = false; // relocs can't be placed in a byte
// enum name FP updmode rf wf R/M,R/M[reg] R/M,icon reg,R/M
+// Note that emitter has only partial support for BT. It can only emit the reg,reg form
+// and the registers need to be reversed to get the correct encoding.
+INST3(bt , "bt" , 0, IUM_RD, 0, 1, 0x0F00A3, BAD_CODE, 0x0F00A3)
+
INST3(movsx , "movsx" , 0, IUM_WR, 0, 0, BAD_CODE, BAD_CODE, 0x0F00BE)
#ifdef _TARGET_AMD64_
INST3(movsxd , "movsxd" , 0, IUM_WR, 0, 0, BAD_CODE, BAD_CODE, 0x4800000063LL )