Commit 31066cee authored by Matthias Braun's avatar Matthias Braun
Browse files

mode suffix changes

[r13749]
parent dbb90c84
......@@ -285,16 +285,19 @@ void ia32_emit_immediate(ia32_emit_env_t *env, const ir_node *node)
return;
}
void ia32_emit_mode_suffix(ia32_emit_env_t *env, const ir_mode *mode)
static
void ia32_emit_mode_suffix_mode(ia32_emit_env_t *env, const ir_mode *mode)
{
be_emit_char(env, get_mode_suffix(mode));
}
void ia32_emit_x87_mode_suffix(ia32_emit_env_t *env, const ir_node *node)
void ia32_emit_mode_suffix(ia32_emit_env_t *env, const ir_node *node)
{
ir_mode *mode = get_ia32_ls_mode(node);
if(mode != NULL)
ia32_emit_mode_suffix(env, mode);
if(mode == NULL)
mode = mode_Iu;
ia32_emit_mode_suffix_mode(env, mode);
}
static
......@@ -915,7 +918,7 @@ void CMov_emitter(ia32_emit_env_t *env, const ir_node *node) {
ia32_emit_source_register(env, node, 0);
} else if (is_ia32_xCmpCMov(node)) {
be_emit_cstring(env, "\tucomis");
ia32_emit_mode_suffix(env, get_irn_mode(node));
ia32_emit_mode_suffix_mode(env, get_irn_mode(node));
be_emit_char(env, ' ');
ia32_emit_source_register(env, node, 1);
be_emit_cstring(env, ", ");
......@@ -1004,7 +1007,7 @@ void Set_emitter(ia32_emit_env_t *env, const ir_node *node, ir_mode *mode) {
ia32_emit_binop(env, node);
} else if (is_ia32_xCmpSet(node)) {
be_emit_cstring(env, "\tucomis");
ia32_emit_mode_suffix(env, get_irn_mode(get_irn_n(node, 2)));
ia32_emit_mode_suffix_mode(env, get_irn_mode(get_irn_n(node, 2)));
be_emit_char(env, ' ');
ia32_emit_binop(env, node);
} else if (is_ia32_PsiCondSet(node)) {
......@@ -1494,7 +1497,7 @@ void emit_ia32_Conv_I2I(ia32_emit_env_t *env, const ir_node *node) {
be_emit_cstring(env, "\tmov");
be_emit_string(env, sign_suffix);
ia32_emit_mode_suffix(env, smaller_mode);
ia32_emit_mode_suffix_mode(env, smaller_mode);
be_emit_cstring(env, "l %");
be_emit_string(env, sreg);
be_emit_cstring(env, ", ");
......@@ -1504,7 +1507,7 @@ void emit_ia32_Conv_I2I(ia32_emit_env_t *env, const ir_node *node) {
case ia32_AddrModeS: {
be_emit_cstring(env, "\tmov");
be_emit_string(env, sign_suffix);
ia32_emit_mode_suffix(env, smaller_mode);
ia32_emit_mode_suffix_mode(env, smaller_mode);
be_emit_cstring(env, "l %");
ia32_emit_am(env, node);
be_emit_cstring(env, ", ");
......
......@@ -46,7 +46,7 @@ void ia32_emit_source_register(ia32_emit_env_t *env, const ir_node *node, int po
void ia32_emit_dest_register(ia32_emit_env_t *env, const ir_node *node, int pos);
void ia32_emit_x87_name(ia32_emit_env_t *env, const ir_node *node, int pos);
void ia32_emit_immediate(ia32_emit_env_t *env, const ir_node *node);
void ia32_emit_mode_suffix(ia32_emit_env_t *env, const ir_mode *mode);
void ia32_emit_mode_suffix(ia32_emit_env_t *env, const ir_node *node);
void ia32_emit_x87_mode_suffix(ia32_emit_env_t *env, const ir_node *node);
void ia32_emit_xmm_mode_suffix(ia32_emit_env_t *env, const ir_node *node);
void ia32_emit_xmm_mode_suffix_s(ia32_emit_env_t *env, const ir_node *node);
......
......@@ -253,9 +253,8 @@ $arch = "ia32";
C => "${arch}_emit_immediate(env, node);",
SE => "${arch}_emit_extend_suffix(env, get_ia32_ls_mode(node));",
ME => "if(get_mode_size_bits(get_ia32_ls_mode(node)) != 32)\n
ia32_emit_mode_suffix(env, get_ia32_ls_mode(node));",
M => "${arch}_emit_mode_suffix(env, get_ia32_ls_mode(node));",
XM => "${arch}_emit_x87_mode_suffix(env, node);",
ia32_emit_mode_suffix(env, node);",
M => "${arch}_emit_mode_suffix(env, node);",
XXM => "${arch}_emit_xmm_mode_suffix(env, node);",
XSD => "${arch}_emit_xmm_mode_suffix_s(env, node);",
AM => "${arch}_emit_am(env, node);",
......@@ -425,7 +424,7 @@ Or => {
irn_flags => "R",
comment => "construct Or: Or(a, b) = Or(b, a) = a OR b",
reg_req => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "in_r3" ] },
emit => '. orl %binop',
emit => '. or%M %binop',
units => [ "GP" ],
mode => $mode_gp,
modified_flags => $status_flags
......@@ -1253,7 +1252,7 @@ GetST0 => {
state => "exc_pinned",
comment => "store ST0 onto stack",
reg_req => { in => [ "gp", "gp", "none" ] },
emit => '. fstp%XM %AM',
emit => '. fstp%M %AM',
latency => 4,
units => [ "SSE" ],
mode => "mode_M",
......@@ -1703,7 +1702,7 @@ fadd => {
rd_constructor => "NONE",
comment => "x87 Add: Add(a, b) = Add(b, a) = a + b",
reg_req => { },
emit => '. fadd%XM %x87_binop',
emit => '. fadd%M %x87_binop',
},
faddp => {
......@@ -1719,7 +1718,7 @@ fmul => {
rd_constructor => "NONE",
comment => "x87 fp Mul: Mul(a, b) = Mul(b, a) = a + b",
reg_req => { },
emit => '. fmul%XM %x87_binop',
emit => '. fmul%M %x87_binop',
},
fmulp => {
......@@ -1735,7 +1734,7 @@ fsub => {
rd_constructor => "NONE",
comment => "x87 fp Sub: Sub(a, b) = a - b",
reg_req => { },
emit => '. fsub%XM %x87_binop',
emit => '. fsub%M %x87_binop',
},
fsubp => {
......@@ -1753,7 +1752,7 @@ fsubr => {
irn_flags => "R",
comment => "x87 fp SubR: SubR(a, b) = b - a",
reg_req => { },
emit => '. fsubr%XM %x87_binop',
emit => '. fsubr%M %x87_binop',
},
fsubrp => {
......@@ -1789,7 +1788,7 @@ fdiv => {
rd_constructor => "NONE",
comment => "x87 fp Div: Div(a, b) = a / b",
reg_req => { },
emit => '. fdiv%XM %x87_binop',
emit => '. fdiv%M %x87_binop',
},
fdivp => {
......@@ -1806,7 +1805,7 @@ fdivr => {
rd_constructor => "NONE",
comment => "x87 fp DivR: DivR(a, b) = b / a",
reg_req => { },
emit => '. fdivr%XM %x87_binop',
emit => '. fdivr%M %x87_binop',
},
fdivrp => {
......@@ -1866,7 +1865,7 @@ fld => {
state => "exc_pinned",
comment => "x87 fp Load: Load(ptr, mem) = LD ptr -> reg",
reg_req => { },
emit => '. fld%XM %AM',
emit => '. fld%M %AM',
},
fst => {
......@@ -1875,7 +1874,7 @@ fst => {
state => "exc_pinned",
comment => "x87 fp Store: Store(ptr, val, mem) = ST ptr,val",
reg_req => { },
emit => '. fst%XM %AM',
emit => '. fst%M %AM',
mode => "mode_M",
},
......@@ -1885,7 +1884,7 @@ fstp => {
state => "exc_pinned",
comment => "x87 fp Store: Store(ptr, val, mem) = ST ptr,val",
reg_req => { },
emit => '. fstp%XM %AM',
emit => '. fstp%M %AM',
mode => "mode_M",
},
......@@ -1896,7 +1895,7 @@ fild => {
rd_constructor => "NONE",
comment => "x87 fp integer Load: Load(ptr, mem) = iLD ptr -> reg",
reg_req => { },
emit => '. fild%XM %AM',
emit => '. fild%M %AM',
},
fist => {
......
Markdown is supported
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