More missing config.h
[libfirm] / ir / be / ia32 / ia32_spec.pl
index 0d32820..3935c82 100644 (file)
@@ -73,6 +73,10 @@ $comment_string = "/*";
 #
 # outs:  if a node defines more than one output, the names of the projections
 #        nodes having outs having automatically the mode mode_T
+#        One can also annotate some flags for each out, additional to irn_flags.
+#        They are separated from name with a colon ':', and concatenated by pipe '|'
+#        Only I and S are available at the moment (same meaning as in irn_flags).
+#        example: [ "frame:I", "stack:I|S", "M" ]
 #
 # comment: OPTIONAL comment for the node constructor
 #
@@ -100,6 +104,8 @@ $comment_string = "/*";
 #   1 - caller save (register must be saved by the caller of a function)
 #   2 - callee save (register must be saved by the called function)
 #   4 - ignore (do not assign this register)
+#   8 - emitter can choose an arbitrary register of this class
+#  16 - the register is a virtual one
 # NOTE: Last entry of each class is the largest Firm-Mode a register can hold
 %reg_classes = (
   "gp" => [
@@ -133,8 +139,8 @@ $comment_string = "/*";
 #            { "name" => "r32", "type" => 1 },
             { "name" => "ebp", "type" => 2 },
             { "name" => "esp", "type" => 4 },
-            { "name" => "gp_NOREG", "type" => 6 },  # we need a dummy register for NoReg nodes
-            { "name" => "gp_UKNWN", "type" => },  # we need a dummy register for Unknown nodes
+            { "name" => "gp_NOREG", "type" => 2 | 4 | 16 },     # we need a dummy register for NoReg nodes
+            { "name" => "gp_UKNWN", "type" => 2 | 4 | 8 | 16},  # we need a dummy register for Unknown nodes
                        { "mode" => "mode_P" }
           ],
   "xmm" => [
@@ -146,21 +152,21 @@ $comment_string = "/*";
             { "name" => "xmm5", "type" => 1 },
             { "name" => "xmm6", "type" => 1 },
             { "name" => "xmm7", "type" => 1 },
-            { "name" => "xmm_NOREG", "type" => 6 },  # we need a dummy register for NoReg nodes
-            { "name" => "xmm_UKNWN", "type" => },  # we need a dummy register for Unknown nodes
+            { "name" => "xmm_NOREG", "type" => 2 | 4 | 16 },     # we need a dummy register for NoReg nodes
+            { "name" => "xmm_UKNWN", "type" => 2 | 4 | 8 | 16},  # we need a dummy register for Unknown nodes
                        { "mode" => "mode_D" }
           ],
   "vfp" => [
-            { "name" => "vf0", "type" => 1 },
-            { "name" => "vf1", "type" => 1 },
-            { "name" => "vf2", "type" => 1 },
-            { "name" => "vf3", "type" => 1 },
-            { "name" => "vf4", "type" => 1 },
-            { "name" => "vf5", "type" => 1 },
-            { "name" => "vf6", "type" => 1 },
-            { "name" => "vf7", "type" => 1 },
-            { "name" => "vfp_NOREG", "type" => 6 },  # we need a dummy register for NoReg nodes
-            { "name" => "vfp_UKNWN", "type" => },  # we need a dummy register for Unknown nodes
+            { "name" => "vf0", "type" => 1 | 16 },
+            { "name" => "vf1", "type" => 1 | 16 },
+            { "name" => "vf2", "type" => 1 | 16 },
+            { "name" => "vf3", "type" => 1 | 16 },
+            { "name" => "vf4", "type" => 1 | 16 },
+            { "name" => "vf5", "type" => 1 | 16 },
+            { "name" => "vf6", "type" => 1 | 16 },
+            { "name" => "vf7", "type" => 1 | 16 },
+            { "name" => "vfp_NOREG", "type" => 2 | 4 | 16 },     # we need a dummy register for NoReg nodes
+            { "name" => "vfp_UKNWN", "type" => 2 | 4 | 8 | 16},  # we need a dummy register for Unknown nodes
                        { "mode" => "mode_E" }
           ],
   "st" => [
@@ -176,6 +182,21 @@ $comment_string = "/*";
           ]
 ); # %reg_classes
 
+%cpu = (
+  "ALU"    => [ 1, "ALU1", "ALU2", "ALU3", "ALU4" ],
+  "MUL"    => [ 1, "MUL1", "MUL2" ],
+  "SSE"    => [ 1, "SSE1", "SSE2" ],
+  "FPU"    => [ 1, "FPU1" ],
+  "MEM"    => [ 1, "MEM1", "MEM2" ],
+  "BRANCH" => [ 1, "BRANCH1", "BRANCH2" ],
+  "DUMMY"  => [ 1, "DUMMY1", "DUMMY2", "DUMMY3", "DUMMY4" ]
+); # %cpu
+
+%vliw = (
+       "bundle_size"       => 3,
+       "bundels_per_cycle" => 2
+); # vliw
+
 #--------------------------------------------------#
 #                        _                         #
 #                       (_)                        #
@@ -220,6 +241,7 @@ $comment_string = "/*";
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. add %ia32_emit_binop /* Add(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU", "MEM" ],
 },
 
 "AddC" => {
@@ -228,6 +250,22 @@ $comment_string = "/*";
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. adc %ia32_emit_binop /* AddC(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU", "MEM" ],
+},
+
+"Add64Bit" => {
+  "irn_flags" => "R",
+  "comment"   => "construct 64Bit Add: Add(a_l, a_h, b_l, b_h) = a_l + b_l; a_h + b_h + carry",
+  "arity"     => 4,
+  "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp" ], "out" => [ "!in", "!in" ] },
+  "emit"      => '
+. mov %D1, %S1 /* mov a_l into assigned l_res register */
+. mov %D2, %S2 /* mov a_h into assigned h_res register */
+. add %D1, %S3 /* a_l + b_l */
+. adc %D2, %S4 /* a_h + b_h + carry */
+',
+  "outs"      => [ "low_res", "high_res" ],
+  "units"     => [ "ALU", "MEM" ],
 },
 
 "l_Add" => {
@@ -246,15 +284,20 @@ $comment_string = "/*";
 },
 
 "MulS" => {
+  # we should not rematrialize this node. It produces 2 results and has
+  # very strict constrains
   "comment"   => "construct MulS: MulS(a, b) = MulS(b, a) = a * b",
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
   "reg_req"   => { "in" => [ "gp", "gp", "eax", "gp", "none" ], "out" => [ "eax", "edx" ] },
   "emit"      => '. mul %ia32_emit_unop /* Mul(%A1, %A2) -> %D1 */',
   "outs"      => [ "EAX", "EDX", "M" ],
   "latency"   => 10,
+  "units"     => [ "MUL" ],
 },
 
 "l_MulS" => {
+  # we should not rematrialize this node. It produces 2 results and has
+  # very strict constrains
   "op_flags"  => "C",
   "cmp_attr"  => "  return 1;\n",
   "comment"   => "construct lowered MulS: MulS(a, b) = MulS(b, a) = a * b",
@@ -270,6 +313,7 @@ $comment_string = "/*";
   "emit"      => '. imul %ia32_emit_binop /* Mul(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 5,
+  "units"     => [ "MUL" ],
 },
 
 "l_Mul" => {
@@ -281,12 +325,15 @@ $comment_string = "/*";
 
 # Mulh is an exception from the 4 INs with AM because the target is always EAX:EDX
 "Mulh" => {
+  # we should not rematrialize this node. It produces 2 results and has
+  # very strict constrains
   "comment"   => "construct Mul: Mul(a, b) = Mul(b, a) = a * b",
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
   "reg_req"   => { "in" => [ "gp", "gp", "eax", "gp", "none" ], "out" => [ "eax", "edx" ] },
   "emit"      => '. imul %ia32_emit_unop /* Mulh(%A1, %A2) -> %D1 */',
   "outs"      => [ "EAX", "EDX", "M" ],
   "latency"   => 5,
+  "units"     => [ "MUL" ],
 },
 
 "And" => {
@@ -296,6 +343,7 @@ $comment_string = "/*";
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. and %ia32_emit_binop /* And(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 "Or" => {
@@ -305,6 +353,7 @@ $comment_string = "/*";
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. or %ia32_emit_binop /* Or(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 "Eor" => {
@@ -314,6 +363,7 @@ $comment_string = "/*";
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. xor %ia32_emit_binop /* Xor(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 "l_Eor" => {
@@ -337,6 +387,7 @@ $comment_string = "/*";
   }
 ',
   "latency"   => 2,
+  "units"     => [ "ALU" ],
 },
 
 "Min" => {
@@ -353,6 +404,7 @@ $comment_string = "/*";
   }
 ',
   "latency"   => 2,
+  "units"     => [ "ALU" ],
 },
 
 # not commutative operations
@@ -364,6 +416,7 @@ $comment_string = "/*";
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. sub %ia32_emit_binop /* Sub(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 "SubC" => {
@@ -372,6 +425,22 @@ $comment_string = "/*";
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "in_r3 !in_r4" ] },
   "emit"      => '. sbb %ia32_emit_binop /* SubC(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU" ],
+},
+
+"Sub64Bit" => {
+  "irn_flags" => "R",
+  "comment"   => "construct 64Bit Sub: Sub(a_l, a_h, b_l, b_h) = a_l - b_l; a_h - b_h - borrow",
+  "arity"     => 4,
+  "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp" ], "out" => [ "!in", "!in" ] },
+  "emit"      => '
+. mov %D1, %S1 /* mov a_l into assigned l_res register */
+. mov %D2, %S2 /* mov a_h into assigned h_res register */
+. sub %D1, %S3 /* a_l - b_l */
+. sbb %D2, %S4 /* a_h - b_h - borrow */
+',
+  "outs"      => [ "low_res", "high_res" ],
+  "units"     => [ "ALU" ],
 },
 
 "l_Sub" => {
@@ -404,6 +473,7 @@ $comment_string = "/*";
 ',
   "outs"      => [ "div_res", "mod_res", "M" ],
   "latency"   => 25,
+  "units"     => [ "ALU" ],
 },
 
 "Shl" => {
@@ -413,6 +483,7 @@ $comment_string = "/*";
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r3 !in_r4" ] },
   "emit"      => '. shl %ia32_emit_binop /* Shl(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU1", "SSE1" ],
 },
 
 "l_Shl" => {
@@ -425,7 +496,15 @@ $comment_string = "/*";
   "irn_flags" => "R",
   "comment"   => "construct ShlD: ShlD(a, b, c) = a, b << count (shift left count bits from b into a)",
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
-  "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "ecx", "none" ], "out" => [ "!ecx in_r3 !in_r4" ] },
+  # Out requirements is: different from all in
+  # This is because, out must be different from LowPart and ShiftCount.
+  # We could say "!ecx !in_r4" but it can occur, that all values live through
+  # this Shift and the only value dying is the ShiftCount. Then there would be a
+  # register missing, as result must not be ecx and all other registers are
+  # occupied. What we should write is "!in_r4 !in_r5", but this is not supported
+  # (and probably never will). So we create artificial interferences of the result
+  # with all inputs, so the spiller can always assure a free register.
+  "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "ecx", "none" ], "out" => [ "!in" ] },
   "emit"      =>
 '
 if (get_ia32_immop_type(n) == ia32_ImmNone) {
@@ -447,6 +526,7 @@ else {
 ',
   "outs"      => [ "res", "M" ],
   "latency"   => 6,
+  "units"     => [ "ALU1", "SSE1" ],
 },
 
 "l_ShlD" => {
@@ -462,6 +542,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r3 !in_r4" ] },
   "emit"      => '. shr %ia32_emit_binop /* Shr(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU1", "SSE1" ],
 },
 
 "l_Shr" => {
@@ -474,7 +555,15 @@ else {
   "irn_flags" => "R",
   "comment"   => "construct ShrD: ShrD(a, b, c) = a, b >> count (shift rigth count bits from a into b)",
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
-  "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "ecx", "none" ], "out" => [ "!ecx in_r3 !in_r4" ] },
+  # Out requirements is: different from all in
+  # This is because, out must be different from LowPart and ShiftCount.
+  # We could say "!ecx !in_r4" but it can occur, that all values live through
+  # this Shift and the only value dying is the ShiftCount. Then there would be a
+  # register missing, as result must not be ecx and all other registers are
+  # occupied. What we should write is "!in_r4 !in_r5", but this is not supported
+  # (and probably never will). So we create artificial interferences of the result
+  # with all inputs, so the spiller can always assure a free register.
+  "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "ecx", "none" ], "out" => [ "!in" ] },
   "emit"      =>
 '
 if (get_ia32_immop_type(n) == ia32_ImmNone) {
@@ -496,6 +585,7 @@ else {
 ',
   "outs"      => [ "res", "M" ],
   "latency"   => 6,
+  "units"     => [ "ALU1", "SSE1" ],
 },
 
 "l_ShrD" => {
@@ -511,6 +601,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r3 !in_r4" ] },
   "emit"      => '. sar %ia32_emit_binop /* Shrs(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU1", "SSE1" ],
 },
 
 "l_Shrs" => {
@@ -526,6 +617,7 @@ else {
   "reg_req"     => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r3 !in_r4" ] },
   "emit"        => '. ror %ia32_emit_binop /* RotR(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU1", "SSE1" ],
 },
 
 "RotL" => {
@@ -535,6 +627,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "ecx", "none" ], "out" => [ "in_r3 !in_r4" ] },
   "emit"      => '. rol %ia32_emit_binop /* RotL(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU1", "SSE1" ],
 },
 
 # unary operations
@@ -546,8 +639,25 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. neg %ia32_emit_unop /* Neg(%A1) -> %D1, (%A1) */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU" ],
+},
+
+"Minus64Bit" => {
+  "irn_flags" => "R",
+  "comment"   => "construct 64Bit Minus: Minus(a_l, a_h, 0) = 0 - a_l; 0 - a_h - borrow",
+  "arity"     => 4,
+  "reg_req"   => { "in" => [ "gp", "gp", "gp" ], "out" => [ "!in", "!in" ] },
+  "emit"      => '
+. mov %D1, %S1 /* l_res */
+. mov %D2, %S1 /* h_res */
+. sub %D1, %S2 /* 0 - a_l  ->  low_res */
+. sbb %D2, %S3 /* 0 - a_h - borrow -> high_res */
+',
+  "outs"      => [ "low_res", "high_res" ],
+  "units"     => [ "ALU" ],
 },
 
+
 "l_Minus" => {
   "cmp_attr"  => "  return 1;\n",
   "comment"   => "construct lowered Minus: Minus(a) = -a",
@@ -561,6 +671,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. inc %ia32_emit_unop /* Inc(%S1) -> %D1, (%A1) */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 "Dec" => {
@@ -570,6 +681,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. dec %ia32_emit_unop /* Dec(%S1) -> %D1, (%A1) */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 "Not" => {
@@ -579,6 +691,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. not %ia32_emit_unop /* Not(%S1) -> %D1, (%A1) */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 # other operations
@@ -590,6 +703,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ] },
   "outs"      => [ "false", "true" ],
   "latency"   => 3,
+  "units"     => [ "BRANCH" ],
 },
 
 "TestJmp" => {
@@ -599,6 +713,7 @@ else {
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
   "outs"      => [ "false", "true" ],
   "latency"   => 3,
+  "units"     => [ "BRANCH" ],
 },
 
 "CJmpAM" => {
@@ -607,6 +722,7 @@ else {
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "none", "none" ] },
   "outs"      => [ "false", "true" ],
+  "units"     => [ "BRANCH" ],
 },
 
 "CJmp" => {
@@ -614,6 +730,7 @@ else {
   "comment"   => "construct conditional jump without CMP (replaces TestJmp): JMPxx LABEL",
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
   "reg_req"   => { "in" => [ "gp", "gp" ] },
+  "units"     => [ "BRANCH" ],
 },
 
 "SwitchJmp" => {
@@ -622,6 +739,7 @@ else {
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
   "reg_req"   => { "in" => [ "gp" ], "out" => [ "none" ] },
   "latency"   => 3,
+  "units"     => [ "BRANCH" ],
 },
 
 "Const" => {
@@ -629,15 +747,18 @@ else {
   "irn_flags" => "R",
   "comment"   => "represents an integer constant",
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
-  "reg_req"   => { "in" => [ "none" ], "out" => [ "gp" ] },
+  "reg_req"   => { "out" => [ "gp" ] },
+  "units"     => [ "ALU" ],
 },
 
 "Cdq" => {
-  "irn_flags" => "R",
+  # we should not rematrialize this node. It produces 2 results and has
+  # very strict constrains
   "comment"   => "construct CDQ: sign extend EAX -> EDX:EAX",
   "reg_req"   => { "in" => [ "gp" ], "out" => [ "eax in_r1", "edx" ] },
   "emit"      => '. cdq /* sign extend EAX -> EDX:EAX, (%A1) */',
   "outs"      => [ "EAX", "EDX" ],
+  "units"     => [ "ALU" ],
 },
 
 # Load / Store
@@ -658,6 +779,7 @@ else {
   }
 ',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "MEM" ],
 },
 
 "l_Load" => {
@@ -686,6 +808,7 @@ else {
   "emit"      => '. mov %ia32_emit_binop /* Store(%A3) -> (%A1) */',
   "outs"      => [ "M" ],
   "latency"   => 3,
+  "units"     => [ "MEM" ],
 },
 
 "Store8Bit" => {
@@ -697,6 +820,7 @@ else {
   "emit"      => '. mov %ia32_emit_binop /* Store(%A3) -> (%A1) */',
   "outs"      => [ "M" ],
   "latency"   => 3,
+  "units"     => [ "MEM" ],
 },
 
 "Lea" => {
@@ -706,74 +830,67 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp" ], "out" => [ "in_r1" ] },
   "emit"      => '. lea %D1, %ia32_emit_am /* LEA(%A1, %A2) */',
   "latency"   => 2,
+  "units"     => [ "ALU" ],
 },
 
 "Push" => {
-  # We don't set class modify_stack here (but we will do this on proj 0)
-  "comment"   => "push a gp register on the stack",
-  "reg_req"   => { "in" => [ "esp", "gp", "none" ], "out" => [ "esp" ] },
-  "emit"      => '
-if (get_ia32_id_cnst(n)) {
-       if (get_ia32_immop_type(n) == ia32_ImmConst) {
-4. push %C /* Push const on stack */
-} else {
-4. push OFFSET FLAT:%C /* Push symconst on stack */
-       }
-}
-else if (get_ia32_op_type(n) == ia32_Normal) {
-2. push %S2 /* Push(%A2) */
-}
-else {
-2. push %ia32_emit_am /* Push memory to stack */
-};
-',
-  "outs"      => [ "stack", "M" ],
+  "comment"   => "push on the stack",
+  "reg_req"   => { "in" => [ "gp", "gp", "gp", "esp", "none" ], "out" => [ "esp" ] },
+  "emit"      => '. push %ia32_emit_unop /* PUSH(%A1) */',
+  "outs"      => [ "stack:I|S", "M" ],
   "latency"   => 3,
+  "units"     => [ "MEM" ],
 },
 
 "Pop" => {
   # We don't set class modify stack here (but we will do this on proj 1)
   "comment"   => "pop a gp register from the stack",
-  "reg_req"   => { "in" => [ "esp", "none" ], "out" => [ "gp", "esp" ] },
-  "emit"      => '
-if (get_ia32_op_type(n) == ia32_Normal) {
-2. pop %D1 /* Pop from stack into %D1 */
-}
-else {
-2. pop %ia32_emit_am /* Pop from stack into memory */
-}
-',
-  "outs"      => [ "res", "stack", "M" ],
+  "reg_req"   => { "in" => [ "gp", "gp", "esp", "none" ], "out" => [ "gp", "esp" ] },
+  "emit"      => '. pop %ia32_emit_unop /* POP(%A1) */',
+  "outs"      => [ "res", "stack:I|S", "M" ],
   "latency"   => 4,
+  "units"     => [ "MEM" ],
 },
 
 "Enter" => {
   "comment"   => "create stack frame",
   "reg_req"   => { "in" => [ "esp" ], "out" => [ "ebp", "esp" ] },
   "emit"      => '. enter /* Enter */',
-  "outs"      => [ "frame", "stack", "M" ],
+  "outs"      => [ "frame:I", "stack:I|S", "M" ],
   "latency"   => 15,
+  "units"     => [ "MEM" ],
 },
 
 "Leave" => {
   "comment"   => "destroy stack frame",
   "reg_req"   => { "in" => [ "esp", "ebp" ], "out" => [ "ebp", "esp" ] },
   "emit"      => '. leave /* Leave */',
-  "outs"      => [ "frame", "stack", "M" ],
+  "outs"      => [ "frame:I", "stack:I|S", "M" ],
   "latency"   => 3,
+  "units"     => [ "MEM" ],
 },
 
 "AddSP" => {
   "irn_flags" => "I",
   "comment"   => "allocate space on stack",
   "reg_req"   => { "in" => [ "esp", "gp" ], "out" => [ "esp", "none" ] },
-  "outs"      => [ "stack", "M" ],
+  "outs"      => [ "stack:S", "M" ],
+  "units"     => [ "ALU" ],
+},
+
+"SubSP" => {
+  "irn_flags" => "I",
+  "comment"   => "free space on stack",
+  "reg_req"   => { "in" => [ "esp", "gp" ], "out" => [ "esp", "none" ] },
+  "outs"      => [ "stack:S", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 "LdTls" => {
   "irn_flags" => "R",
   "comment"   => "get the TLS base address",
   "reg_req"   => { "out" => [ "gp" ] },
+  "units"     => [ "MEM" ],
 },
 
 
@@ -797,6 +914,7 @@ else {
   "emit"      => '. adds%M %ia32_emit_binop /* SSE Add(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 4,
+  "units"     => [ "SSE" ],
 },
 
 "xMul" => {
@@ -807,6 +925,7 @@ else {
   "emit"      => '. muls%M %ia32_emit_binop /* SSE Mul(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 4,
+  "units"     => [ "SSE" ],
 },
 
 "xMax" => {
@@ -817,6 +936,7 @@ else {
   "emit"      => '. maxs%M %ia32_emit_binop /* SSE Max(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 2,
+  "units"     => [ "SSE" ],
 },
 
 "xMin" => {
@@ -827,6 +947,7 @@ else {
   "emit"      => '. mins%M %ia32_emit_binop /* SSE Min(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 2,
+  "units"     => [ "SSE" ],
 },
 
 "xAnd" => {
@@ -837,6 +958,7 @@ else {
   "emit"      => '. andp%M %ia32_emit_binop /* SSE And(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 3,
+  "units"     => [ "SSE" ],
 },
 
 "xOr" => {
@@ -846,6 +968,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "xmm", "xmm", "none" ], "out" => [ "in_r3" ] },
   "emit"      => '. orp%M %ia32_emit_binop /* SSE Or(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
+  "units"     => [ "SSE" ],
 },
 
 "xEor" => {
@@ -856,6 +979,7 @@ else {
   "emit"      => '. xorp%M %ia32_emit_binop /* SSE Xor(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 3,
+  "units"     => [ "SSE" ],
 },
 
 # not commutative operations
@@ -868,6 +992,7 @@ else {
   "emit"      => '. andnp%M %ia32_emit_binop /* SSE AndNot(%A3, %A4) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 3,
+  "units"     => [ "SSE" ],
 },
 
 "xSub" => {
@@ -878,6 +1003,7 @@ else {
   "emit"      => '. subs%M %ia32_emit_binop /* SSE Sub(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 4,
+  "units"     => [ "SSE" ],
 },
 
 "xDiv" => {
@@ -888,6 +1014,7 @@ else {
   "emit"      => '. divs%M %ia32_emit_binop /* SSE Div(%A1, %A2) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 16,
+  "units"     => [ "SSE" ],
 },
 
 # other operations
@@ -898,6 +1025,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "xmm", "xmm", "none" ], "out" => [ "in_r3 !in_r4" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 3,
+  "units"     => [ "SSE" ],
 },
 
 "xCondJmp" => {
@@ -907,6 +1035,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "xmm", "xmm", "none" ], "out" => [ "none", "none" ] },
   "outs"      => [ "false", "true" ],
   "latency"   => 5,
+  "units"     => [ "SSE" ],
 },
 
 "xConst" => {
@@ -914,9 +1043,10 @@ else {
   "irn_flags" => "R",
   "comment"   => "represents a SSE constant",
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
-  "reg_req"   => { "in" => [ "none" ], "out" => [ "xmm" ] },
+  "reg_req"   => { "out" => [ "xmm" ] },
   "emit"      => '. movs%M %D1, %C /* Load fConst into register */',
   "latency"   => 2,
+  "units"     => [ "SSE" ],
 },
 
 # Load / Store
@@ -930,6 +1060,7 @@ else {
   "emit"      => '. movs%M %D1, %ia32_emit_am /* Load((%A1)) -> %D1 */',
   "outs"      => [ "res", "M" ],
   "latency"   => 2,
+  "units"     => [ "SSE" ],
 },
 
 "xStore" => {
@@ -941,6 +1072,7 @@ else {
   "emit"     => '. movs%M %ia32_emit_binop /* Store(%S3) -> (%A1) */',
   "outs"      => [ "M" ],
   "latency"   => 2,
+  "units"     => [ "MEM" ],
 },
 
 "xStoreSimple" => {
@@ -952,6 +1084,7 @@ else {
   "emit"     => '. movs%M %ia32_emit_am, %S2 /* store XMM0 onto stack */',
   "outs"      => [ "M" ],
   "latency"   => 2,
+  "units"     => [ "MEM" ],
 },
 
 "l_X87toSSE" => {
@@ -978,6 +1111,7 @@ else {
   "emit"     => '. fstp %ia32_emit_am /* store ST0 onto stack */',
   "outs"     => [ "M" ],
   "latency"  => 4,
+  "units"     => [ "MEM" ],
 },
 
 "SetST0" => {
@@ -986,10 +1120,11 @@ else {
   "state"    => "exc_pinned",
   "comment"  => "load ST0 from stack",
   "cmp_attr" => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
-  "reg_req"  => { "in" => [ "gp", "none" ], "out" => [ "st0", "none" ] },
+  "reg_req"  => { "in" => [ "gp", "none" ], "out" => [ "vf0", "none" ] },
   "emit"     => '. fld %ia32_emit_am /* load ST0 from stack */',
   "outs"     => [ "res", "M" ],
   "latency"  => 2,
+  "units"     => [ "MEM" ],
 },
 
 # CopyB
@@ -1000,6 +1135,7 @@ else {
   "comment"  => "implements a memcopy: CopyB(dst, src, size, mem) == memcpy(dst, src, size)",
   "reg_req"  => { "in" => [ "edi", "esi", "ecx", "none" ], "out" => [ "edi", "esi", "ecx", "none" ] },
   "outs"     => [ "DST", "SRC", "CNT", "M" ],
+  "units"     => [ "MEM" ],
 },
 
 "CopyB_i" => {
@@ -1009,6 +1145,7 @@ else {
   "cmp_attr" => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
   "reg_req"  => { "in" => [ "edi", "esi", "none" ], "out" => [  "edi", "esi", "none" ] },
   "outs"     => [ "DST", "SRC", "M" ],
+  "units"     => [ "MEM" ],
 },
 
 # Conversions
@@ -1018,6 +1155,7 @@ else {
   "cmp_attr" => "  return ia32_compare_conv_attr(attr_a, attr_b);\n",
   "comment"  => "construct Conv Int -> Int",
   "outs"     => [ "res", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 "Conv_I2I8Bit" => {
@@ -1025,6 +1163,7 @@ else {
   "cmp_attr" => "  return ia32_compare_conv_attr(attr_a, attr_b);\n",
   "comment"  => "construct Conv Int -> Int",
   "outs"     => [ "res", "M" ],
+  "units"     => [ "ALU" ],
 },
 
 "Conv_I2FP" => {
@@ -1033,6 +1172,7 @@ else {
   "comment"  => "construct Conv Int -> Floating Point",
   "outs"     => [ "res", "M" ],
   "latency"  => 10,
+  "units"     => [ "SSE" ],
 },
 
 "Conv_FP2I" => {
@@ -1041,6 +1181,7 @@ else {
   "comment"  => "construct Conv Floating Point -> Int",
   "outs"     => [ "res", "M" ],
   "latency"  => 10,
+  "units"     => [ "SSE" ],
 },
 
 "Conv_FP2FP" => {
@@ -1049,6 +1190,7 @@ else {
   "comment"  => "construct Conv Floating Point -> Floating Point",
   "outs"     => [ "res", "M" ],
   "latency"  => 8,
+  "units"     => [ "SSE" ],
 },
 
 "CmpCMov" => {
@@ -1056,6 +1198,7 @@ else {
   "comment"   => "construct Conditional Move: CMov(sel, a, b) == sel ? a : b",
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp" ], "out" => [ "in_r4" ] },
   "latency"   => 2,
+  "units"     => [ "ALU" ],
 },
 
 "PsiCondCMov" => {
@@ -1063,6 +1206,7 @@ else {
   "comment"   => "check if Psi condition tree evaluates to true and move result accordingly",
   "reg_req"   => { "in" => [ "gp", "gp", "gp" ], "out" => [ "in_r3" ] },
   "latency"   => 2,
+  "units"     => [ "ALU" ],
 },
 
 "xCmpCMov" => {
@@ -1070,6 +1214,7 @@ else {
   "comment"   => "construct Conditional Move: SSE Compare + int CMov ",
   "reg_req"   => { "in" => [ "xmm", "xmm", "gp", "gp" ], "out" => [ "in_r4" ] },
   "latency"   => 5,
+  "units"     => [ "SSE" ],
 },
 
 "vfCmpCMov" => {
@@ -1077,6 +1222,7 @@ else {
   "comment"   => "construct Conditional Move: x87 Compare + int CMov",
   "reg_req"   => { "in" => [ "vfp", "vfp", "gp", "gp" ], "out" => [ "in_r4" ] },
   "latency"   => 10,
+  "units"     => [ "FPU" ],
 },
 
 "CmpSet" => {
@@ -1085,6 +1231,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "gp", "gp", "none" ], "out" => [ "eax ebx ecx edx", "none" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 2,
+  "units"     => [ "ALU" ],
 },
 
 "PsiCondSet" => {
@@ -1092,6 +1239,7 @@ else {
   "comment"   => "check if Psi condition tree evaluates to true and set result accordingly",
   "reg_req"   => { "in" => [ "gp" ], "out" => [ "eax ebx ecx edx" ] },
   "latency"   => 2,
+  "units"     => [ "ALU" ],
 },
 
 "xCmpSet" => {
@@ -1100,6 +1248,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "xmm", "xmm", "none" ], "out" => [ "eax ebx ecx edx", "none" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 5,
+  "units"     => [ "SSE" ],
 },
 
 "vfCmpSet" => {
@@ -1108,6 +1257,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "vfp", "vfp", "none" ], "out" => [ "eax ebx ecx edx", "none" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 10,
+  "units"     => [ "FPU" ],
 },
 
 "vfCMov" => {
@@ -1115,6 +1265,7 @@ else {
   "comment"   => "construct x87 Conditional Move: vfCMov(sel, a, b) = sel ? a : b",
   "reg_req"   => { "in" => [ "vfp", "vfp", "vfp", "vfp" ], "out" => [ "vfp" ] },
   "latency"   => 10,
+  "units"     => [ "FPU" ],
 },
 
 #----------------------------------------------------------#
@@ -1138,6 +1289,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "vfp", "vfp", "none" ], "out" => [ "vfp" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "vfmul" => {
@@ -1147,6 +1299,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "vfp", "vfp", "none" ], "out" => [ "vfp" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "l_vfmul" => {
@@ -1163,6 +1316,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "vfp", "vfp", "none" ], "out" => [ "vfp" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "l_vfsub" => {
@@ -1177,6 +1331,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "vfp", "vfp", "none" ], "out" => [ "vfp" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 20,
+  "units"     => [ "FPU" ],
 },
 
 "l_vfdiv" => {
@@ -1185,11 +1340,27 @@ else {
   "arity"     => 2,
 },
 
+"vfprem" => {
+  "comment"   => "virtual fp Rem: Rem(a, b) = a - Q * b (Q is integer)",
+  "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
+  "reg_req"   => { "in" => [ "gp", "gp", "vfp", "vfp", "none" ], "out" => [ "vfp" ] },
+  "outs"      => [ "res", "M" ],
+  "latency"   => 20,
+  "units"     => [ "FPU" ],
+},
+
+"l_vfprem" => {
+  "cmp_attr"  => "  return 1;\n",
+  "comment"   => "lowered virtual fp Rem: Rem(a, b) = a - Q * b (Q is integer)",
+  "arity"     => 2,
+},
+
 "vfabs" => {
   "irn_flags" => "R",
   "comment"   => "virtual fp Abs: Abs(a) = |a|",
   "reg_req"   => { "in" => [ "vfp"], "out" => [ "vfp" ] },
   "latency"   => 2,
+  "units"     => [ "FPU" ],
 },
 
 "vfchs" => {
@@ -1197,6 +1368,7 @@ else {
   "comment"   => "virtual fp Chs: Chs(a) = -a",
   "reg_req"   => { "in" => [ "vfp"], "out" => [ "vfp" ] },
   "latency"   => 2,
+  "units"     => [ "FPU" ],
 },
 
 "vfsin" => {
@@ -1204,6 +1376,7 @@ else {
   "comment"   => "virtual fp Sin: Sin(a) = sin(a)",
   "reg_req"   => { "in" => [ "vfp"], "out" => [ "vfp" ] },
   "latency"   => 150,
+  "units"     => [ "FPU" ],
 },
 
 "vfcos" => {
@@ -1211,6 +1384,7 @@ else {
   "comment"   => "virtual fp Cos: Cos(a) = cos(a)",
   "reg_req"   => { "in" => [ "vfp"], "out" => [ "vfp" ] },
   "latency"   => 150,
+  "units"     => [ "FPU" ],
 },
 
 "vfsqrt" => {
@@ -1218,6 +1392,7 @@ else {
   "comment"   => "virtual fp Sqrt: Sqrt(a) = a ^ 0.5",
   "reg_req"   => { "in" => [ "vfp"], "out" => [ "vfp" ] },
   "latency"   => 30,
+  "units"     => [ "FPU" ],
 },
 
 # virtual Load and Store
@@ -1230,6 +1405,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "none" ], "out" => [ "vfp", "none" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 2,
+  "units"     => [ "FPU" ],
 },
 
 "vfst" => {
@@ -1240,6 +1416,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "vfp", "none" ] },
   "outs"      => [ "M" ],
   "latency"   => 2,
+  "units"     => [ "FPU" ],
 },
 
 # Conversions
@@ -1250,6 +1427,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "none" ], "out" => [ "vfp", "none" ] },
   "outs"      => [ "res", "M" ],
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "l_vfild" => {
@@ -1265,6 +1443,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "vfp", "none" ] },
   "outs"      => [ "M" ],
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "l_vfist" => {
@@ -1282,6 +1461,7 @@ else {
   "comment"   => "virtual fp Load 0.0: Ld 0.0 -> reg",
   "reg_req"   => { "out" => [ "vfp" ] },
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "vfld1" => {
@@ -1289,6 +1469,7 @@ else {
   "comment"   => "virtual fp Load 1.0: Ld 1.0 -> reg",
   "reg_req"   => { "out" => [ "vfp" ] },
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "vfldpi" => {
@@ -1296,6 +1477,7 @@ else {
   "comment"   => "virtual fp Load pi: Ld pi -> reg",
   "reg_req"   => { "out" => [ "vfp" ] },
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "vfldln2" => {
@@ -1303,6 +1485,7 @@ else {
   "comment"   => "virtual fp Load ln 2: Ld ln 2 -> reg",
   "reg_req"   => { "out" => [ "vfp" ] },
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "vfldlg2" => {
@@ -1310,6 +1493,7 @@ else {
   "comment"   => "virtual fp Load lg 2: Ld lg 2 -> reg",
   "reg_req"   => { "out" => [ "vfp" ] },
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "vfldl2t" => {
@@ -1317,6 +1501,7 @@ else {
   "comment"   => "virtual fp Load ld 10: Ld ld 10 -> reg",
   "reg_req"   => { "out" => [ "vfp" ] },
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "vfldl2e" => {
@@ -1324,6 +1509,7 @@ else {
   "comment"   => "virtual fp Load ld e: Ld ld e -> reg",
   "reg_req"   => { "out" => [ "vfp" ] },
   "latency"   => 4,
+  "units"     => [ "FPU" ],
 },
 
 "vfConst" => {
@@ -1332,8 +1518,9 @@ else {
   "init_attr" => "  set_ia32_ls_mode(res, mode);",
   "comment"   => "represents a virtual floating point constant",
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
-  "reg_req"   => { "in" => [ "none" ], "out" => [ "vfp" ] },
+  "reg_req"   => { "out" => [ "vfp" ] },
   "latency"   => 3,
+  "units"     => [ "FPU" ],
 },
 
 # other
@@ -1345,6 +1532,7 @@ else {
   "reg_req"   => { "in" => [ "gp", "gp", "vfp", "vfp", "none" ], "out" => [ "none", "none", "eax" ] },
   "outs"      => [ "false", "true", "temp_reg_eax" ],
   "latency"   => 10,
+  "units"     => [ "FPU" ],
 },
 
 #------------------------------------------------------------------------#
@@ -1421,6 +1609,24 @@ else {
   "emit"      => '. fsubrp %ia32_emit_x87_binop /* x87 fsubr(%A3, %A4) -> %D1 */',
 },
 
+"fprem" => {
+  "op_flags"  => "R",
+  "rd_constructor" => "NONE",
+  "comment"   => "x87 fp Rem: Rem(a, b) = a - Q * b (Q is integer)",
+  "reg_req"   => { },
+  "emit"      => '. fprem1 /* x87 fprem(%A3, %A4) -> %D1 */',
+},
+
+# this node is just here, to keep the simulator running
+# we can omit this when a fprem simulation function exists
+"fpremp" => {
+  "op_flags"  => "R",
+  "rd_constructor" => "NONE",
+  "comment"   => "x87 fp Rem: Rem(a, b) = a - Q * b (Q is integer)",
+  "reg_req"   => { },
+  "emit"      => '. fprem1 /* x87 fprem(%A3, %A4) -> %D1 WITH POP */',
+},
+
 "fdiv" => {
   "op_flags"  => "R",
   "rd_constructor" => "NONE",
@@ -1554,7 +1760,7 @@ else {
   "op_flags"  => "R|c",
   "irn_flags"  => "R",
   "comment"   => "x87 fp Load 0.0: Ld 0.0 -> reg",
-  "reg_req"   => { },
+  "reg_req"   => { "out" => [ "vfp" ] },
   "emit"      => '. fldz /* x87 0.0 -> %D1 */',
 },
 
@@ -1562,7 +1768,7 @@ else {
   "op_flags"  => "R|c",
   "irn_flags"  => "R",
   "comment"   => "x87 fp Load 1.0: Ld 1.0 -> reg",
-  "reg_req"   => { },
+  "reg_req"   => { "out" => [ "vfp" ] },
   "emit"      => '. fld1 /* x87 1.0 -> %D1 */',
 },
 
@@ -1570,7 +1776,7 @@ else {
   "op_flags"  => "R|c",
   "irn_flags"  => "R",
   "comment"   => "x87 fp Load pi: Ld pi -> reg",
-  "reg_req"   => { },
+  "reg_req"   => { "out" => [ "vfp" ] },
   "emit"      => '. fldpi /* x87 pi -> %D1 */',
 },
 
@@ -1578,7 +1784,7 @@ else {
   "op_flags"  => "R|c",
   "irn_flags"  => "R",
   "comment"   => "x87 fp Load ln 2: Ld ln 2 -> reg",
-  "reg_req"   => { },
+  "reg_req"   => { "out" => [ "vfp" ] },
   "emit"      => '. fldln2 /* x87 ln(2) -> %D1 */',
 },
 
@@ -1586,7 +1792,7 @@ else {
   "op_flags"  => "R|c",
   "irn_flags"  => "R",
   "comment"   => "x87 fp Load lg 2: Ld lg 2 -> reg",
-  "reg_req"   => { },
+  "reg_req"   => { "out" => [ "vfp" ] },
   "emit"      => '. fldlg2 /* x87 log(2) -> %D1 */',
 },
 
@@ -1594,7 +1800,7 @@ else {
   "op_flags"  => "R|c",
   "irn_flags"  => "R",
   "comment"   => "x87 fp Load ld 10: Ld ld 10 -> reg",
-  "reg_req"   => { },
+  "reg_req"   => { "out" => [ "vfp" ] },
   "emit"      => '. fldll2t /* x87 ld(10) -> %D1 */',
 },
 
@@ -1602,7 +1808,7 @@ else {
   "op_flags"  => "R|c",
   "irn_flags"  => "R",
   "comment"   => "x87 fp Load ld e: Ld ld e -> reg",
-  "reg_req"   => { },
+  "reg_req"   => { "out" => [ "vfp" ] },
   "emit"      => '. fldl2e /* x87 ld(e) -> %D1 */',
 },
 
@@ -1612,25 +1818,34 @@ else {
   "rd_constructor" => "NONE",
   "comment"   => "represents a x87 constant",
   "cmp_attr"  => "  return ia32_compare_immop_attr(attr_a, attr_b);\n",
-  "reg_req"   => { "out" => [ "st" ] },
+  "reg_req"   => { "out" => [ "vfp" ] },
   "emit"      => '. fld %ia32_emit_adr /* Load fConst into register -> %D1 */',
 },
 
 # fxch, fpush, fpop
 # Note that it is NEVER allowed to do CSE on these nodes
+# Moreover, note the virtual register requierements!
 
 "fxch" => {
   "op_flags"  => "R|K",
   "comment"   => "x87 stack exchange",
-  "reg_req"   => { "in" => [ "st"], "out" => [ "st" ] },
+  "reg_req"   => { },
   "cmp_attr"  => "  return 1;\n",
   "emit"      => '. fxch %X1 /* x87 swap %X1, %X3 */',
 },
 
 "fpush" => {
+  "op_flags"  => "R|K",
+  "comment"   => "x87 stack push",
+  "reg_req"   => {},
+  "cmp_attr"  => "  return 1;\n",
+  "emit"      => '. fld %X1 /* x87 push %X1 */',
+},
+
+"fpushCopy" => {
   "op_flags"  => "R",
   "comment"   => "x87 stack push",
-  "reg_req"   => { "in" => [ "st"], "out" => [ "st" ] },
+  "reg_req"   => { "in" => [ "vfp"], "out" => [ "vfp" ] },
   "cmp_attr"  => "  return 1;\n",
   "emit"      => '. fld %X1 /* x87 push %X1 */',
 },
@@ -1638,7 +1853,7 @@ else {
 "fpop" => {
   "op_flags"  => "R|K",
   "comment"   => "x87 stack pop",
-  "reg_req"   => { "out" => [ "st" ] },
+  "reg_req"   => { },
   "cmp_attr"  => "  return 1;\n",
   "emit"      => '. fstp %X1 /* x87 pop %X1 */',
 },