Commit 51e57414 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ia32: Use 'fld[z1]; fchs' to create the constants '-0.' and '-1.'.

This is shorter than loading from a constant pool.
gcc does it, too.
parent 87eaee70
......@@ -30,6 +30,7 @@
#include "panic.h"
#include "array.h"
#include "heights.h"
#include "tv_t.h"
#include "bediagnostic.h"
#include "benode.h"
......@@ -422,6 +423,14 @@ static ir_node *gen_Const(ir_node *node)
} else if (tarval_is_one(tv)) {
load = new_bd_ia32_fld1(dbgi, block);
res = load;
} else if (tarval_is_minus_null(tv)) {
load = new_bd_ia32_fldz(dbgi, block);
goto negate;
} else if (tarval_is_minus_one(tv)) {
load = new_bd_ia32_fld1(dbgi, block);
negate:
load = new_bd_ia32_fchs(dbgi, block, load);
res = load;
} else {
ir_entity *const floatent = create_float_const_entity(tv, NULL);
/* create_float_const_ent is smart and sometimes creates
......
Markdown is supported
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