Commit 0133e48f authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ia32: Pass the source/target mode to the constructors of Conv_{I2FP,FP2FP,FP2I}.

parent c7bc210f
......@@ -1746,6 +1746,8 @@ Conv_I2FP => {
ins => [ "base", "index", "mem", "val" ],
am => "source,unary",
latency => 10,
attr => "ir_mode *tgt_mode",
init_attr => "attr->ls_mode = tgt_mode;",
mode => $mode_xmm,
},
......@@ -1755,6 +1757,8 @@ Conv_FP2I => {
ins => [ "base", "index", "mem", "val" ],
am => "source,unary",
latency => 10,
attr => "ir_mode *src_mode",
init_attr => "attr->ls_mode = src_mode;",
mode => $mode_gp,
},
......@@ -1764,6 +1768,8 @@ Conv_FP2FP => {
ins => [ "base", "index", "mem", "val" ],
am => "source,unary",
latency => 8,
attr => "ir_mode *tgt_mode",
init_attr => "attr->ls_mode = tgt_mode;",
mode => $mode_xmm,
},
......
......@@ -3962,9 +3962,7 @@ static ir_node *gen_Conv(ir_node *node)
/* ... to float */
if (ia32_cg_config.use_sse2) {
DB((dbg, LEVEL_1, "create Conv(float, float) ..."));
res = new_bd_ia32_Conv_FP2FP(dbgi, new_block, noreg_GP,
noreg_GP, nomem, new_op);
set_ia32_ls_mode(res, tgt_mode);
res = new_bd_ia32_Conv_FP2FP(dbgi, new_block, noreg_GP, noreg_GP, nomem, new_op, tgt_mode);
} else {
if (src_bits < tgt_bits) {
DB((dbg, LEVEL_1, "killed Conv(float, float) ..."));
......@@ -3979,9 +3977,7 @@ static ir_node *gen_Conv(ir_node *node)
/* ... to int */
DB((dbg, LEVEL_1, "create Conv(float, int) ..."));
if (ia32_cg_config.use_sse2) {
res = new_bd_ia32_Conv_FP2I(dbgi, new_block, noreg_GP, noreg_GP,
nomem, new_op);
set_ia32_ls_mode(res, src_mode);
res = new_bd_ia32_Conv_FP2I(dbgi, new_block, noreg_GP, noreg_GP, nomem, new_op, src_mode);
} else {
return gen_x87_fp_to_gp(node);
}
......@@ -3993,9 +3989,7 @@ static ir_node *gen_Conv(ir_node *node)
DB((dbg, LEVEL_1, "create Conv(int, float) ..."));
if (ia32_cg_config.use_sse2) {
ir_node *new_op = be_transform_node(op);
res = new_bd_ia32_Conv_I2FP(dbgi, new_block, noreg_GP, noreg_GP,
nomem, new_op);
set_ia32_ls_mode(res, tgt_mode);
res = new_bd_ia32_Conv_I2FP(dbgi, new_block, noreg_GP, noreg_GP, nomem, new_op, tgt_mode);
} else {
unsigned int_mantissa = get_mode_size_bits(src_mode) - (mode_is_signed(src_mode) ? 1 : 0);
unsigned float_mantissa = get_mode_mantissa_size(tgt_mode);
......
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