make verifier a bit less strict about keeps
[libfirm] / ir / be / ia32 / ia32_spec.pl
index 503a87c..510897e 100644 (file)
@@ -332,6 +332,7 @@ Asm => {
        modified_flags => 1,
 },
 
+# "allocates" a free register
 ProduceVal => {
        op_flags  => "c",
        irn_flags => "R",
@@ -1008,9 +1009,10 @@ Stc => {
 Cmp => {
        irn_flags => "R",
        state     => "exc_pinned",
-       reg_req   => { in => [ "gp", "gp", "none", "gp", "gp" ] , out => [ "flags" ] },
+       reg_req   => { in  => [ "gp", "gp", "none", "gp", "gp" ],
+                      out => [ "flags", "none", "none" ] },
        ins       => [ "base", "index", "mem", "left", "right" ],
-       outs      => [ "eflags" ],
+       outs      => [ "eflags", "unused", "M" ],
        am        => "source,binary",
        emit      => '. cmp%M %binop',
        attr      => "int ins_permuted, int cmp_unsigned",
@@ -1205,7 +1207,7 @@ Unknown_XMM => {
        units     => [],
        emit      => "",
        latency   => 0,
-       mode      => "mode_E"
+       mode      => $mode_xmm
 },
 
 NoReg_GP => {
@@ -1453,6 +1455,17 @@ LdTls => {
        latency   => 1,
 },
 
+Bt => {
+       irn_flags => "R",
+       state     => "exc_pinned",
+       reg_req   => { in => [ "gp", "gp" ], out => [ "flags" ] },
+       ins       => [ "left", "right" ],
+       emit      => '. bt%M %S1, %S0',
+       units     => [ "GP" ],
+       latency   => 1,
+       mode      => $mode_flags,
+       modified_flags => $status_flags  # only CF is set, but the other flags are undefined
+},
 
 #-----------------------------------------------------------------------------#
 #   _____ _____ ______    __ _             _                     _            #
@@ -1470,7 +1483,7 @@ xZero => {
        emit      => '. xorp%XSD %D0, %D0',
        latency   => 3,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 xPzero => {
@@ -1479,7 +1492,7 @@ xPzero => {
        emit      => '. pxor %D0, %D0',
        latency   => 3,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 # produces all 1 bits
@@ -1489,7 +1502,7 @@ xAllOnes => {
        emit      => '. pcmpeqb %D0, %D0',
        latency   => 3,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 # integer shift left, dword
@@ -1497,9 +1510,9 @@ xPslld => {
        irn_flags => "R",
        reg_req   => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
        emit      => '. pslld %SI1, %D0',
-       units     => [ "SSE" ],
-       mode      => "mode_E",
        latency   => 3,
+       units     => [ "SSE" ],
+       mode      => $mode_xmm
 },
 
 # integer shift left, qword
@@ -1507,9 +1520,9 @@ xPsllq => {
        irn_flags => "R",
        reg_req   => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
        emit      => '. psllq %SI1, %D0',
-       units     => [ "SSE" ],
-       mode      => "mode_E",
        latency   => 3,
+       units     => [ "SSE" ],
+       mode      => $mode_xmm
 },
 
 # integer shift right, dword
@@ -1517,9 +1530,9 @@ xPsrld => {
        irn_flags => "R",
        reg_req   => { in => [ "xmm", "xmm" ], out => [ "in_r1 !in_r2" ] },
        emit      => '. psrld %SI1, %D0',
-       units     => [ "SSE" ],
-       mode      => "mode_E",
        latency   => 1,
+       units     => [ "SSE" ],
+       mode      => $mode_xmm
 },
 
 # mov from integer to SSE register
@@ -1527,9 +1540,9 @@ xMovd  => {
        irn_flags => "R",
        reg_req   => { in => [ "gp" ], out => [ "xmm" ] },
        emit      => '. movd %S0, %D0',
-       units     => [ "SSE" ],
-       mode      => "mode_E",
        latency   => 1,
+       units     => [ "SSE" ],
+       mode      => $mode_xmm
 },
 
 # commutative operations
@@ -1543,7 +1556,7 @@ xAdd => {
        emit      => '. add%XXM %binop',
        latency   => 4,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 xMul => {
@@ -1555,7 +1568,7 @@ xMul => {
        emit      => '. mul%XXM %binop',
        latency   => 4,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 xMax => {
@@ -1567,7 +1580,7 @@ xMax => {
        emit      => '. max%XXM %binop',
        latency   => 2,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 xMin => {
@@ -1579,7 +1592,7 @@ xMin => {
        emit      => '. min%XXM %binop',
        latency   => 2,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 xAnd => {
@@ -1591,7 +1604,7 @@ xAnd => {
        emit      => '. andp%XSD %binop',
        latency   => 3,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 xOr => {
@@ -1603,7 +1616,7 @@ xOr => {
        emit      => '. orp%XSD %binop',
        latency   => 3,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 xXor => {
@@ -1615,7 +1628,7 @@ xXor => {
        emit      => '. xorp%XSD %binop',
        latency   => 3,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 # not commutative operations
@@ -1629,7 +1642,7 @@ xAndNot => {
        emit      => '. andnp%XSD %binop',
        latency   => 3,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 xSub => {
@@ -1641,7 +1654,7 @@ xSub => {
        emit      => '. sub%XXM %binop',
        latency   => 4,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm
 },
 
 xDiv => {
@@ -1811,7 +1824,7 @@ Conv_I2FP => {
        am        => "source,unary",
        latency   => 10,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm,
 },
 
 Conv_FP2I => {
@@ -1831,7 +1844,7 @@ Conv_FP2FP => {
        am        => "source,unary",
        latency   => 8,
        units     => [ "SSE" ],
-       mode      => "mode_E",
+       mode      => $mode_xmm,
 },
 
 #----------------------------------------------------------#
@@ -1986,6 +1999,17 @@ vfist => {
        attr_type => "ia32_x87_attr_t",
 },
 
+# SSE3 fisttp instruction
+vfisttp => {
+       state     => "exc_pinned",
+       reg_req   => { in => [ "gp", "gp", "none", "vfp" ], out => [ "in_r4", "none" ]},
+       ins       => [ "base", "index", "mem", "val" ],
+       outs      => [ "res", "M" ],
+       latency   => 4,
+       units     => [ "VFP" ],
+       attr_type => "ia32_x87_attr_t",
+},
+
 l_vfist => {
        cmp_attr  => "return 1;",
        state     => "exc_pinned",
@@ -2339,6 +2363,17 @@ fistp => {
        latency   => 2,
 },
 
+# SSE3 firsttp instruction
+fisttp => {
+       state     => "exc_pinned",
+       rd_constructor => "NONE",
+       reg_req   => { },
+       emit      => '. fisttp%M %AM',
+       mode      => "mode_M",
+       attr_type => "ia32_x87_attr_t",
+       latency   => 2,
+},
+
 # constants
 
 fldz => {