Commit 52a59fbe authored by Matthias Braun's avatar Matthias Braun
Browse files

sparc: use AddCC, SubCC, MulCC

parent 52e0c37f
......@@ -269,12 +269,19 @@ Add => {
},
AddCC => {
irn_flags => [ "rematerializable" ],
irn_flags => [ "rematerializable", "modifies_flags" ],
emit => '. addcc %S0, %R1I, %D0',
outs => [ "res", "flags" ],
constructors => \%binopcc_operand_constructors,
},
AddCCZero => {
irn_flags => [ "rematerializable", "modifies_flags" ],
emit => '. addcc %S0, %R1I, %%g0',
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
AddX => {
# At the moment not rematerializable because of assert in beflags.c/
# (it claims that spiller can't rematerialize flag stuff correctly)
......@@ -305,12 +312,19 @@ Sub => {
},
SubCC => {
irn_flags => [ "rematerializable" ],
irn_flags => [ "rematerializable", "modifies_flags" ],
emit => '. subcc %S0, %R1I, %D0',
outs => [ "res", "flags" ],
constructors => \%binopcc_operand_constructors,
},
SubCCZero => {
irn_flags => [ "rematerializable", "modifies_flags" ],
emit => '. subcc %S0, %R1I, %%g0',
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
SubX => {
# Not rematerializable (see AddX)
emit => '. subx %S0, %R1I, %D0',
......@@ -677,6 +691,13 @@ Mul => {
constructors => \%binop_operand_constructors,
},
MulCCZero => {
irn_flags => [ "rematerializable", "modifies_flags" ],
emit => '. smulcc %S0, %R1I, %%g0',
mode => $mode_flags,
constructors => \%binopcczero_operand_constructors,
},
SMulh => {
irn_flags => [ "rematerializable" ],
outs => [ "low", "high" ],
......
......@@ -1287,6 +1287,18 @@ static ir_node *gen_Cmp(ir_node *node)
new_bd_sparc_XNorCCZero_reg,
new_bd_sparc_XNorCCZero_imm,
MATCH_NONE);
} else if (is_Add(op1)) {
return gen_helper_binop(op1, MATCH_COMMUTATIVE,
new_bd_sparc_AddCCZero_reg,
new_bd_sparc_AddCCZero_imm);
} else if (is_Sub(op1)) {
return gen_helper_binop(op1, MATCH_NONE,
new_bd_sparc_SubCCZero_reg,
new_bd_sparc_SubCCZero_imm);
} else if (is_Mul(op1)) {
return gen_helper_binop(op1, MATCH_COMMUTATIVE,
new_bd_sparc_MulCCZero_reg,
new_bd_sparc_MulCCZero_imm);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment