ia32: Do not ignore the floating point control word anymore and make it callee-save.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 1 Dec 2012 16:55:24 +0000 (17:55 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 2 Dec 2012 08:56:24 +0000 (09:56 +0100)
This corrects handling in bestate (non-ignore).
beabi attaches the fpcw to Start/Return due to being callee-save.
This was accidently done before due to being ignored.

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

index 9a99ba2..acf2744 100644 (file)
@@ -1942,6 +1942,7 @@ static int ia32_register_saved_by(const arch_register_t *reg, int callee)
        case REG_EBP:
        case REG_ESI:
        case REG_EDI:
+       case REG_FPCW:
                return callee;
 
        case REG_EAX:
index a31fd7a..5488ba3 100644 (file)
@@ -58,7 +58,7 @@ $mode_fpcw          = "ia32_mode_fpcw";
                { mode => $mode_fp87 }
        ],
        fp_cw => [      # the floating point control word
-               { name => "fpcw", dwarf => 37, type => "ignore | state" },
+               { name => "fpcw", dwarf => 37, type => "state" },
                { mode => $mode_fpcw, flags => "manual_ra | state" }
        ],
        flags => [
@@ -1083,7 +1083,7 @@ ChangeCW => {
        state     => "pinned",
        op_flags  => [ "constlike" ],
        irn_flags => [ "not_scheduled" ],
-       reg_req   => { out => [ "fpcw:I" ] },
+       reg_req   => { out => [ "fpcw" ] },
        mode      => $mode_fpcw,
        latency   => 3,
        units     => [ "GP" ],
@@ -1093,7 +1093,7 @@ ChangeCW => {
 FldCW => {
        op_flags  => [ "uses_memory" ],
        state     => "pinned",
-       reg_req   => { in => [ "gp", "gp", "none" ], out => [ "fpcw:I" ] },
+       reg_req   => { in => [ "gp", "gp", "none" ], out => [ "fpcw" ] },
        ins       => [ "base", "index", "mem" ],
        latency   => 5,
        emit      => "fldcw %AM",
@@ -1377,7 +1377,7 @@ Call => {
        state     => "exc_pinned",
        reg_req   => {
                in  => [ "gp", "gp", "none", "gp", "esp", "fpcw", "eax", "ecx", "edx" ],
-               out => [ "esp:I|S", "fpcw:I", "none", "eax", "ecx", "edx", "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "none", "none" ]
+               out => [ "esp:I|S", "fpcw", "none", "eax", "ecx", "edx", "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "none", "none" ]
        },
        ins       => [ "base", "index", "mem", "addr", "stack", "fpcw", "eax", "ecx", "edx" ],
        outs      => [ "stack", "fpcw", "M", "eax", "ecx", "edx", "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "X_regular", "X_except" ],