From 3d8f2528cc3992632ff069d6f9e977f484ac37bf Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 19 Apr 2004 12:02:02 +0000 Subject: [PATCH] expmed.c (expand_mult_highpart_adjust): Make OP1 valid for MODE. * expmed.c (expand_mult_highpart_adjust): Make OP1 valid for MODE. (expand_mult_highpart_optab): Likewise. (expand_mult_highpart): Make OP1 valid for WIDER_MODE, not MODE. From-SVN: r80848 --- gcc/ChangeLog | 6 ++++++ gcc/expmed.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc284d58b97..b63d0395ea8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-04-19 Richard Kenner + + * expmed.c (expand_mult_highpart_adjust): Make OP1 valid for MODE. + (expand_mult_highpart_optab): Likewise. + (expand_mult_highpart): Make OP1 valid for WIDER_MODE, not MODE. + 2004-04-19 Paul Brook * config/arm/arm.md (fixuns_truncsfsi2, fixuns_truncdfsi2, diff --git a/gcc/expmed.c b/gcc/expmed.c index 5d213c38b3d..3fb76b45a54 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -2841,6 +2841,7 @@ expand_mult_highpart_adjust (enum machine_mode mode, rtx adj_operand, rtx op0, rtx tem; enum rtx_code adj_code = unsignedp ? PLUS : MINUS; + op1 = gen_int_mode (INTVAL (op1), mode); tem = expand_shift (RSHIFT_EXPR, mode, op0, build_int_2 (GET_MODE_BITSIZE (mode) - 1, 0), NULL_RTX, 0); @@ -2895,7 +2896,8 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, if (mul_highpart_cost[(int) mode] < max_cost) { moptab = unsignedp ? umul_highpart_optab : smul_highpart_optab; - tem = expand_binop (mode, moptab, op0, op1, target, + tem = expand_binop (mode, moptab, op0, + gen_int_mode (INTVAL (op1), mode), target, unsignedp, OPTAB_DIRECT); if (tem) return tem; @@ -2908,7 +2910,8 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, < max_cost)) { moptab = unsignedp ? smul_highpart_optab : umul_highpart_optab; - tem = expand_binop (mode, moptab, op0, op1, target, + tem = expand_binop (mode, moptab, op0, + gen_int_mode (INTVAL (op1), mode), target, unsignedp, OPTAB_DIRECT); if (tem) /* We used the wrong signedness. Adjust the result. */ @@ -2987,7 +2990,7 @@ expand_mult_highpart (enum machine_mode mode, rtx op0, if (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT) abort (); - op1 = gen_int_mode (cnst1, mode); + op1 = gen_int_mode (cnst1, wider_mode); cnst1 &= GET_MODE_MASK (mode); /* We can't optimize modes wider than BITS_PER_WORD. -- 2.30.2