]
); # %reg_classes
+%cpu = (
+ "ALU" => [ "ALU1", "ALU2", "ALU3", "ALU4" ],
+ "MUL" => [ "MUL1", "MUL2" ],
+ "SSE" => [ "SSE1", "SSE2" ],
+ "FPU" => [ "FPU1" ],
+ "MEM" => [ "MEM1", "MEM2" ],
+ "BRANCH" => [ "BRANCH1", "BRANCH2" ]
+); # %cpu
+
#--------------------------------------------------#
# _ #
# (_) #
"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" => {
"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" => {
. adc %D2, %S4 /* a_h + b_h + carry */
',
"outs" => [ "low_res", "high_res" ],
+ "units" => [ "ALU", "MEM" ],
},
"l_Add" => {
"reg_req" => { "in" => [ "gp", "gp", "gp", "ecx gp_NOREG", "none" ], "out" => [ "in_r3 !in_r4" ] },
"emit" => '. shl %ia32_emit_binop /* Shl(%A1, %A2) -> %D1 */',
"outs" => [ "res", "M" ],
+ "units" => [ "ALU1", "SSE1" ],
},
"l_Shl" => {
"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,
+},
+
+"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|",
"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",