Commit 20d9f785 authored by Matthias Braun's avatar Matthias Braun
Browse files

amd64: Transform x87 minus

parent 7316211b
...@@ -224,6 +224,15 @@ my $x87const = { ...@@ -224,6 +224,15 @@ my $x87const = {
mode => $mode_x87, mode => $mode_x87,
}; };
my $x87unop = {
irn_flags => [ "rematerializable" ],
in_reqs => [ "x87" ],
out_reqs => [ "x87" ],
ins => [ "value" ],
fixed => "amd64_op_mode_t op_mode = AMD64_OP_X87;\n",
mode => $mode_x87,
};
%nodes = ( %nodes = (
push_am => { push_am => {
op_flags => [ "uses_memory" ], op_flags => [ "uses_memory" ],
...@@ -738,4 +747,9 @@ fld => { ...@@ -738,4 +747,9 @@ fld => {
emit => "fld%FM %AM", emit => "fld%FM %AM",
}, },
fchs => {
template => $x87unop,
emit => "fchs",
},
); );
...@@ -1331,6 +1331,13 @@ static ir_node *gen_Minus(ir_node *const node) ...@@ -1331,6 +1331,13 @@ static ir_node *gen_Minus(ir_node *const node)
ir_mode *mode = get_irn_mode(node); ir_mode *mode = get_irn_mode(node);
if (mode_is_float(mode)) { if (mode_is_float(mode)) {
if (mode == x86_mode_E) {
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *op = get_Minus_op(node);
ir_node *new_op = be_transform_node(op);
return new_bd_amd64_fchs(dbgi, block, new_op);
}
return gen_float_neg(node); return gen_float_neg(node);
} else { } else {
return gen_unop(node, n_Minus_op, &new_bd_amd64_neg, pn_amd64_neg_res); return gen_unop(node, n_Minus_op, &new_bd_amd64_neg, pn_amd64_neg_res);
......
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