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) ...@@ -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_16: c = 'w'; break;
case INSN_MODE_32: c = 'l'; break; case INSN_MODE_32: c = 'l'; break;
case INSN_MODE_64: c = 'q'; break; case INSN_MODE_64: c = 'q'; break;
case INSN_MODE_128:
default: default:
panic("invalid insn mode"); panic("invalid insn mode");
} }
...@@ -62,8 +63,9 @@ static void amd64_emit_xmm_mode_suffix(amd64_insn_mode_t mode) ...@@ -62,8 +63,9 @@ static void amd64_emit_xmm_mode_suffix(amd64_insn_mode_t mode)
{ {
char c; char c;
switch (mode) { switch (mode) {
case INSN_MODE_32: c = 's'; break; case INSN_MODE_32: c = 's'; break;
case INSN_MODE_64: c = 'd'; break; case INSN_MODE_64: c = 'd'; break;
case INSN_MODE_128: c = 'q'; break;
default: default:
panic("invalid insn mode"); panic("invalid insn mode");
} }
...@@ -153,7 +155,8 @@ static void emit_register_insn_mode(const arch_register_t *reg, ...@@ -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_8: name = get_8bit_name(reg); break;
case INSN_MODE_16: name = get_16bit_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_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: default:
panic("invalid mode"); panic("invalid mode");
} }
......
...@@ -57,10 +57,11 @@ static const char *get_op_mode_string(amd64_op_mode_t 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) static const char *get_insn_mode_string(amd64_insn_mode_t mode)
{ {
switch (mode) { switch (mode) {
case INSN_MODE_8: return "8"; case INSN_MODE_8: return "8";
case INSN_MODE_16: return "16"; case INSN_MODE_16: return "16";
case INSN_MODE_32: return "32"; case INSN_MODE_32: return "32";
case INSN_MODE_64: return "64"; case INSN_MODE_64: return "64";
case INSN_MODE_128: return "128";
} }
panic("invalid insn_mode"); panic("invalid insn_mode");
} }
......
...@@ -21,6 +21,7 @@ enum amd64_arch_irn_flags_t { ...@@ -21,6 +21,7 @@ enum amd64_arch_irn_flags_t {
}; };
typedef enum { typedef enum {
INSN_MODE_128,
INSN_MODE_64, INSN_MODE_64,
INSN_MODE_32, INSN_MODE_32,
INSN_MODE_16, INSN_MODE_16,
...@@ -90,7 +91,7 @@ typedef struct { ...@@ -90,7 +91,7 @@ typedef struct {
typedef struct { typedef struct {
amd64_attr_t base; amd64_attr_t base;
bool needs_frame_ent : 1; 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_t addr;
} amd64_addr_attr_t; } amd64_addr_attr_t;
...@@ -104,13 +105,13 @@ typedef struct { ...@@ -104,13 +105,13 @@ typedef struct {
typedef struct { typedef struct {
amd64_attr_t base; amd64_attr_t base;
ENUMBF(amd64_insn_mode_t) insn_mode : 2; ENUMBF(amd64_insn_mode_t) insn_mode : 3;
uint8_t immediate; uint8_t immediate;
} amd64_shift_attr_t; } amd64_shift_attr_t;
typedef struct { typedef struct {
amd64_attr_t base; 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_imm64_t immediate;
} amd64_movimm_attr_t; } amd64_movimm_attr_t;
......
...@@ -318,10 +318,11 @@ static ir_node *get_frame_base(ir_graph *irg) ...@@ -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) static amd64_insn_mode_t get_insn_mode_from_mode(const ir_mode *mode)
{ {
switch (get_mode_size_bits(mode)) { switch (get_mode_size_bits(mode)) {
case 8: return INSN_MODE_8; case 8: return INSN_MODE_8;
case 16: return INSN_MODE_16; case 16: return INSN_MODE_16;
case 32: return INSN_MODE_32; case 32: return INSN_MODE_32;
case 64: return INSN_MODE_64; case 64: return INSN_MODE_64;
case 128: return INSN_MODE_128;
} }
panic("unexpected mode"); panic("unexpected mode");
} }
......
...@@ -72,10 +72,11 @@ static ir_entity *amd64_get_frame_entity(const ir_node *node) ...@@ -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) static int get_insn_mode_bytes(amd64_insn_mode_t insn_mode)
{ {
switch (insn_mode) { switch (insn_mode) {
case INSN_MODE_8: return 1; case INSN_MODE_8: return 1;
case INSN_MODE_16: return 2; case INSN_MODE_16: return 2;
case INSN_MODE_32: return 4; case INSN_MODE_32: return 4;
case INSN_MODE_64: return 8; case INSN_MODE_64: return 8;
case INSN_MODE_128: return 16;
} }
panic("bad insn mode"); 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