Use separate code to emit suffixes for integer and floating point instructions, becau...
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 7 Oct 2008 09:31:24 +0000 (09:31 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 7 Oct 2008 09:31:24 +0000 (09:31 +0000)
[r22561]

ir/be/ia32/ia32_emitter.c
ir/be/ia32/ia32_spec.pl

index ddd0ffb..eb59f35 100644 (file)
@@ -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)
index f830e75..1f34df0 100644 (file)
@@ -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,