aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2005-03-21 14:30:51 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2005-03-21 14:30:51 +0000
commit9ce921aba837a0775de9abb3ea97e57d30f25e1f (patch)
tree681954762b33192c42f1a60a5211b189369f90af /gcc/simplify-rtx.c
parent0a04ccc5712075b82b95dec4f52b4e9dc3303cd1 (diff)
downloadgcc-9ce921aba837a0775de9abb3ea97e57d30f25e1f.zip
gcc-9ce921aba837a0775de9abb3ea97e57d30f25e1f.tar.gz
gcc-9ce921aba837a0775de9abb3ea97e57d30f25e1f.tar.bz2
rtl.h (struct rtx_hooks): Add gen_lowpart_no_emit.
2005-03-21 Paolo Bonzini <bonzini@gnu.org> * rtl.h (struct rtx_hooks): Add gen_lowpart_no_emit. * rtlhooks.c (gen_lowpart_no_emit_general): New. * rtlhooks-def.h (gen_lowpart_no_emit_general): Declare. (RTL_HOOKS_GEN_LOWPART_NO_EMIT): New. * simplify-rtx.c (simplify_binary_operation_1): Use it. From-SVN: r96799
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 2f7ae25..a703331 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1704,15 +1704,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
: const0_rtx;
/* x/1 is x. */
if (trueop1 == const1_rtx)
- {
- /* Handle narrowing UDIV. */
- rtx x = gen_lowpart_common (mode, op0);
- if (x)
- return x;
- if (mode != GET_MODE (op0) && GET_MODE (op0) != VOIDmode)
- return gen_lowpart_SUBREG (mode, op0);
- return op0;
- }
+ return rtl_hooks.gen_lowpart_no_emit (mode, op0);
/* Convert divide by power of two into shift. */
if (GET_CODE (trueop1) == CONST_INT
&& (val = exact_log2 (INTVAL (trueop1))) > 0)
@@ -1768,22 +1760,11 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
: const0_rtx;
/* x/1 is x. */
if (trueop1 == const1_rtx)
- {
- /* Handle narrowing DIV. */
- rtx x = gen_lowpart_common (mode, op0);
- if (x)
- return x;
- if (mode != GET_MODE (op0) && GET_MODE (op0) != VOIDmode)
- return gen_lowpart_SUBREG (mode, op0);
- return op0;
- }
+ return rtl_hooks.gen_lowpart_no_emit (mode, op0);
/* x/-1 is -x. */
if (trueop1 == constm1_rtx)
{
- rtx x = gen_lowpart_common (mode, op0);
- if (!x)
- x = (mode != GET_MODE (op0) && GET_MODE (op0) != VOIDmode)
- ? gen_lowpart_SUBREG (mode, op0) : op0;
+ rtx x = rtl_hooks.gen_lowpart_no_emit (mode, op0);
return simplify_gen_unary (NEG, mode, x, mode);
}
}