Commit c729c0b7 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

amd64: Avoid redundant sign/zero extension for truncation.

parent 3ad6bc07
......@@ -40,6 +40,7 @@ libFirm 1.22.1 (2016-01-07)
* opt: Handle constant folding for the builtins `clz`, `ctz`, `ffs`, `parity` and `popcount`
* arm: Avoid redundant sign/zero extension right after a load
* amd64, arm: Avoid redundant sign/zero extension right before a store
* amd64: Avoid redundant sign/zero extension for truncation
* Bugfixes
libFirm 1.22.0 (2015-12-31)
......
......@@ -2395,6 +2395,13 @@ static ir_node *gen_Conv(ir_node *const node)
bool const dst_float = mode_is_float(dst_mode);
bool const is_gp = !src_float && !dst_float;
if (is_gp) {
if (src_bits > dst_bits) {
/* Omit unnecessary conversion. */
return be_transform_node(op);
}
}
ir_mode *min_mode;
if (src_bits < dst_bits) {
min_mode = src_mode;
......
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