Commit 647ee5a7 authored by Matthias Braun's avatar Matthias Braun
Browse files

amd64: introduce INSN_MODE_128

parent 39fa8839
......@@ -52,6 +52,7 @@ static void amd64_emit_insn_mode_suffix(amd64_insn_mode_t mode)
case INSN_MODE_16: c = 'w'; break;
case INSN_MODE_32: c = 'l'; break;
case INSN_MODE_64: c = 'q'; break;
case INSN_MODE_128:
default:
panic("invalid insn mode");
}
......@@ -62,8 +63,9 @@ static void amd64_emit_xmm_mode_suffix(amd64_insn_mode_t mode)
{
char c;
switch (mode) {
case INSN_MODE_32: c = 's'; break;
case INSN_MODE_64: c = 'd'; break;
case INSN_MODE_32: c = 's'; break;
case INSN_MODE_64: c = 'd'; break;
case INSN_MODE_128: c = 'q'; break;
default:
panic("invalid insn mode");
}
......@@ -153,7 +155,8 @@ static void emit_register_insn_mode(const arch_register_t *reg,
case INSN_MODE_8: name = get_8bit_name(reg); break;
case INSN_MODE_16: name = get_16bit_name(reg); break;
case INSN_MODE_32: name = get_32bit_name(reg); break;
case INSN_MODE_64: name = reg->name; break;
case INSN_MODE_64:
case INSN_MODE_128: name = reg->name; break;
default:
panic("invalid mode");
}
......
......@@ -57,10 +57,11 @@ static const char *get_op_mode_string(amd64_op_mode_t mode)
static const char *get_insn_mode_string(amd64_insn_mode_t mode)
{
switch (mode) {
case INSN_MODE_8: return "8";
case INSN_MODE_16: return "16";
case INSN_MODE_32: return "32";
case INSN_MODE_64: return "64";
case INSN_MODE_8: return "8";
case INSN_MODE_16: return "16";
case INSN_MODE_32: return "32";
case INSN_MODE_64: return "64";
case INSN_MODE_128: return "128";
}
panic("invalid insn_mode");
}
......
......@@ -21,6 +21,7 @@ enum amd64_arch_irn_flags_t {
};
typedef enum {
INSN_MODE_128,
INSN_MODE_64,
INSN_MODE_32,
INSN_MODE_16,
......@@ -90,7 +91,7 @@ typedef struct {
typedef struct {
amd64_attr_t base;
bool needs_frame_ent : 1;
ENUMBF(amd64_insn_mode_t) insn_mode : 2;
ENUMBF(amd64_insn_mode_t) insn_mode : 3;
amd64_addr_t addr;
} amd64_addr_attr_t;
......@@ -104,13 +105,13 @@ typedef struct {
typedef struct {
amd64_attr_t base;
ENUMBF(amd64_insn_mode_t) insn_mode : 2;
ENUMBF(amd64_insn_mode_t) insn_mode : 3;
uint8_t immediate;
} amd64_shift_attr_t;
typedef struct {
amd64_attr_t base;
ENUMBF(amd64_insn_mode_t) insn_mode : 2;
ENUMBF(amd64_insn_mode_t) insn_mode : 3;
amd64_imm64_t immediate;
} amd64_movimm_attr_t;
......
......@@ -318,10 +318,11 @@ static ir_node *get_frame_base(ir_graph *irg)
static amd64_insn_mode_t get_insn_mode_from_mode(const ir_mode *mode)
{
switch (get_mode_size_bits(mode)) {
case 8: return INSN_MODE_8;
case 16: return INSN_MODE_16;
case 32: return INSN_MODE_32;
case 64: return INSN_MODE_64;
case 8: return INSN_MODE_8;
case 16: return INSN_MODE_16;
case 32: return INSN_MODE_32;
case 64: return INSN_MODE_64;
case 128: return INSN_MODE_128;
}
panic("unexpected mode");
}
......
......@@ -72,10 +72,11 @@ static ir_entity *amd64_get_frame_entity(const ir_node *node)
static int get_insn_mode_bytes(amd64_insn_mode_t insn_mode)
{
switch (insn_mode) {
case INSN_MODE_8: return 1;
case INSN_MODE_16: return 2;
case INSN_MODE_32: return 4;
case INSN_MODE_64: return 8;
case INSN_MODE_8: return 1;
case INSN_MODE_16: return 2;
case INSN_MODE_32: return 4;
case INSN_MODE_64: return 8;
case INSN_MODE_128: return 16;
}
panic("bad insn mode");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment