int prefixes;
/* REX prefix the current instruction. See below. */
- int rex;
+ unsigned char rex;
/* Bits of REX we've already used. */
- int rex_used;
+ unsigned char rex_used;
+
+ bool need_modrm;
+ bool need_vex;
/* Flags for ins->prefixes which we somehow handled when printing the
current instruction. */
int rm;
}
modrm;
- unsigned char need_modrm;
struct
{
int register_specifier;
int length;
int prefix;
- int w;
- int evex;
- int r;
- int v;
int mask_register_specifier;
- int zeroing;
int ll;
- int b;
- int no_broadcast;
+ bool w;
+ bool evex;
+ bool r;
+ bool v;
+ bool zeroing;
+ bool b;
+ bool no_broadcast;
}
vex;
- unsigned char need_vex;
/* Remember if the current op is a jump instruction. */
bool op_is_jump;
+ bool two_source_ops;
+
+ unsigned char op_ad;
+ signed char op_index[MAX_OPERANDS];
char op_out[MAX_OPERANDS][100];
- int op_ad, op_index[MAX_OPERANDS];
- int two_source_ops;
bfd_vma op_address[MAX_OPERANDS];
bfd_vma op_riprel[MAX_OPERANDS];
bfd_vma start_pc;
* The function returns the length of this instruction in bytes.
*/
char intel_syntax;
- char intel_mnemonic;
+ bool intel_mnemonic;
char open_char;
char close_char;
char separator_char;
{ "ud0S", { Gv, Ev }, 0 },
};
-static const unsigned char onebyte_has_modrm[256] = {
+static const bool onebyte_has_modrm[256] = {
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* ------------------------------- */
/* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
};
-static const unsigned char twobyte_has_modrm[256] = {
+static const bool twobyte_has_modrm[256] = {
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* ------------------------------- */
/* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
ins->vex.prefix = REPNE_PREFIX_OPCODE;
break;
}
- ins->need_vex = 1;
+ ins->need_vex = true;
ins->codep++;
vindex = *ins->codep++;
dp = &xop_table[vex_table_index][vindex];
ins->vex.prefix = REPNE_PREFIX_OPCODE;
break;
}
- ins->need_vex = 1;
+ ins->need_vex = true;
ins->codep++;
vindex = *ins->codep++;
dp = &vex_table[vex_table_index][vindex];
ins->vex.prefix = REPNE_PREFIX_OPCODE;
break;
}
- ins->need_vex = 1;
+ ins->need_vex = true;
ins->codep++;
vindex = *ins->codep++;
dp = &vex_table[dp->op[1].bytemode][vindex];
if (!ins->need_vex)
abort ();
- dp = &vex_w_table[dp->op[1].bytemode][ins->vex.w ? 1 : 0];
+ dp = &vex_w_table[dp->op[1].bytemode][ins->vex.w];
break;
case USE_EVEX_TABLE:
- ins->two_source_ops = 0;
+ ins->two_source_ops = false;
/* EVEX prefix. */
- ins->vex.evex = 1;
+ ins->vex.evex = true;
FETCH_DATA (ins->info, ins->codep + 4);
/* The first byte after 0x62. */
ins->rex = ~(*ins->codep >> 5) & 0x7;
/* Remember the static rounding bits. */
ins->vex.ll = (*ins->codep >> 5) & 3;
- ins->vex.b = (*ins->codep & 0x10) != 0;
+ ins->vex.b = *ins->codep & 0x10;
ins->vex.v = *ins->codep & 0x8;
ins->vex.mask_register_specifier = *ins->codep & 0x7;
{
/* In 16/32-bit mode silently ignore following bits. */
ins->rex &= ~REX_B;
- ins->vex.r = 1;
+ ins->vex.r = true;
}
- ins->need_vex = 1;
+ ins->need_vex = true;
ins->codep++;
vindex = *ins->codep++;
dp = &evex_table[vex_table_index][vindex];
{
ins->intel_syntax = 1;
if (startswith (p + 5, "-mnemonic"))
- ins->intel_mnemonic = 1;
+ ins->intel_mnemonic = true;
}
else if (startswith (p, "att"))
{
ins->intel_syntax = 0;
if (startswith (p + 3, "-mnemonic"))
- ins->intel_mnemonic = 0;
+ ins->intel_mnemonic = false;
}
else if (startswith (p, "addr"))
{
else
memset (&ins->modrm, 0, sizeof (ins->modrm));
- ins->need_vex = 0;
+ ins->need_vex = false;
memset (&ins->vex, 0, sizeof (ins->vex));
if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
}
else if (l == 1 && last[0] == 'X')
{
- if (ins->vex.w == 0)
+ if (!ins->vex.w)
*ins->obufp++ = 'h';
else
oappend (ins, "{bad}");
oappend (ins, "WORD PTR ");
break;
default:
- ins->vex.no_broadcast = 1;
+ ins->vex.no_broadcast = true;
break;
}
return;
/* Broadcast can only ever be valid for memory sources. */
if (ins->obufp == ins->op_out[0])
- ins->vex.no_broadcast = 1;
+ ins->vex.no_broadcast = true;
if (!ins->vex.no_broadcast)
{
}
else if (bytemode == q_mode
|| bytemode == ymmq_mode)
- ins->vex.no_broadcast = 1;
+ ins->vex.no_broadcast = true;
else if (ins->vex.w
|| bytemode == evex_half_bcst_xmmqdh_mode
|| bytemode == evex_half_bcst_xmmq_mode)
}
}
else
- ins->vex.no_broadcast = 1;
+ ins->vex.no_broadcast = true;
}
if (ins->vex.no_broadcast)
oappend (ins, "{bad}");
if (bytemode == tmm_mode)
ins->modrm.reg = reg;
else if (bytemode == scalar_mode)
- ins->vex.no_broadcast = 1;
+ ins->vex.no_broadcast = true;
print_vector_reg (ins, reg, bytemode);
}
strcpy (ins->op_out[1], att_names32[1] + ins->intel_syntax);
if (bytemode == eBX_reg)
strcpy (ins->op_out[2], att_names32[3] + ins->intel_syntax);
- ins->two_source_ops = 1;
+ ins->two_source_ops = true;
}
/* Skip mod/rm byte. */
MODRM_CHECK;
strcpy (ins->op_out[0], names[0] + ins->intel_syntax);
strcpy (ins->op_out[1], att_names32[1] + ins->intel_syntax);
strcpy (ins->op_out[2], att_names32[2] + ins->intel_syntax);
- ins->two_source_ops = 1;
+ ins->two_source_ops = true;
}
/* Skip mod/rm byte. */
MODRM_CHECK;