Commit 980ece97 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Use separate code to emit suffixes for integer and floating point...

Use separate code to emit suffixes for integer and floating point instructions, because GAS wants different suffixes for 16bit /integer/ operands ("w" vs. "s") for them.

[r22561]
parent fa3fbb2f
......@@ -295,23 +295,14 @@ void ia32_emit_x87_register(const ir_node *node, int pos)
static void ia32_emit_mode_suffix_mode(const ir_mode *mode)
{
if (mode_is_float(mode)) {
switch(get_mode_size_bits(mode)) {
case 32: be_emit_char('s'); return;
case 64: be_emit_char('l'); return;
case 80:
case 96: be_emit_char('t'); return;
}
} else {
assert(mode_is_int(mode) || mode_is_reference(mode));
switch(get_mode_size_bits(mode)) {
assert(mode_is_int(mode) || mode_is_reference(mode));
switch (get_mode_size_bits(mode)) {
case 8: be_emit_char('b'); return;
case 16: be_emit_char('w'); return;
case 32: be_emit_char('l'); return;
/* gas docu says q is the suffix but gcc, objdump and icc use ll
* apparently */
case 64: be_emit_cstring("ll"); return;
case 32: be_emit_char('l'); return;
case 16: be_emit_char('w'); return;
case 8: be_emit_char('b'); return;
}
}
panic("Can't output mode_suffix for %+F", mode);
}
......@@ -327,12 +318,33 @@ void ia32_emit_mode_suffix(const ir_node *node)
void ia32_emit_x87_mode_suffix(const ir_node *node)
{
ir_mode *mode;
/* we only need to emit the mode on address mode */
if (get_ia32_op_type(node) != ia32_Normal) {
ir_mode *mode = get_ia32_ls_mode(node);
assert(mode != NULL);
ia32_emit_mode_suffix_mode(mode);
if (get_ia32_op_type(node) == ia32_Normal)
return;
mode = get_ia32_ls_mode(node);
assert(mode != NULL);
if (mode_is_float(mode)) {
switch (get_mode_size_bits(mode)) {
case 32: be_emit_char('s'); return;
case 64: be_emit_char('l'); return;
case 80:
case 96: be_emit_char('t'); return;
}
} else {
assert(mode_is_int(mode));
switch (get_mode_size_bits(mode)) {
case 16: be_emit_char('s'); return;
case 32: be_emit_char('l'); return;
/* gas docu says q is the suffix but gcc, objdump and icc use ll
* apparently */
case 64: be_emit_cstring("ll"); return;
}
}
panic("Can't output mode_suffix for %+F", mode);
}
static char get_xmm_mode_suffix(ir_mode *mode)
......
......@@ -2318,7 +2318,7 @@ fild => {
state => "exc_pinned",
rd_constructor => "NONE",
reg_req => { },
emit => '. fild%M %AM',
emit => '. fild%XM %AM',
attr_type => "ia32_x87_attr_t",
latency => 2,
},
......@@ -2327,7 +2327,7 @@ fist => {
state => "exc_pinned",
rd_constructor => "NONE",
reg_req => { },
emit => '. fist%M %AM',
emit => '. fist%XM %AM',
mode => "mode_M",
attr_type => "ia32_x87_attr_t",
latency => 2,
......@@ -2337,7 +2337,7 @@ fistp => {
state => "exc_pinned",
rd_constructor => "NONE",
reg_req => { },
emit => '. fistp%M %AM',
emit => '. fistp%XM %AM',
mode => "mode_M",
attr_type => "ia32_x87_attr_t",
latency => 2,
......@@ -2348,7 +2348,7 @@ fisttp => {
state => "exc_pinned",
rd_constructor => "NONE",
reg_req => { },
emit => '. fisttp%M %AM',
emit => '. fisttp%XM %AM',
mode => "mode_M",
attr_type => "ia32_x87_attr_t",
latency => 2,
......
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