diff mbox

[PR,target/79752] fix rs6000 power9 peephole2 for udiv/umod

Message ID 1488319320.5475.10.camel@linux.vnet.ibm.com
State New
Headers show

Commit Message

Aaron Sawdey Feb. 28, 2017, 10:02 p.m. UTC
This showed up in power9 code for __divkf3 software float support and
caused a divd to be emitted where we needed a divdu. OK for trunk if
bootstrap/regtest passes?


2017-02-28  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

	PR target/79752
	* config/rs6000/rs6000.md (peephole2 for udiv/umod): Should emit
	udiv rather than div since input pattern is unsigned.

Comments

Segher Boessenkool March 1, 2017, 12:37 a.m. UTC | #1
On Tue, Feb 28, 2017 at 04:02:00PM -0600, Aaron Sawdey wrote:
> This showed up in power9 code for __divkf3 software float support and
> caused a divd to be emitted where we needed a divdu. OK for trunk if
> bootstrap/regtest passes?

Yes, certainly.  Thanks!


Segher


> --- ../trunk/gcc/config/rs6000/rs6000.md        (revision 245787)
> +++ ../trunk/gcc/config/rs6000/rs6000.md        (working copy)
> @@ -3161,7 +3161,7 @@
>     && ! reg_mentioned_p (operands[3], operands[1])
>     && ! reg_mentioned_p (operands[3], operands[2])"
>    [(set (match_dup 0)
> -       (div:GPR (match_dup 1)
> +       (udiv:GPR (match_dup 1)
>                  (match_dup 2)))
>     (set (match_dup 3)
>         (mult:GPR (match_dup 0)
> 
> 2017-02-28  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
> 
> 	PR target/79752
> 	* config/rs6000/rs6000.md (peephole2 for udiv/umod): Should emit
> 	udiv rather than div since input pattern is unsigned.
diff mbox

Patch

Index: ../trunk/gcc/config/rs6000/rs6000.md
===================================================================
--- ../trunk/gcc/config/rs6000/rs6000.md        (revision 245787)
+++ ../trunk/gcc/config/rs6000/rs6000.md        (working copy)
@@ -3161,7 +3161,7 @@ 
    && ! reg_mentioned_p (operands[3], operands[1])
    && ! reg_mentioned_p (operands[3], operands[2])"
   [(set (match_dup 0)
-       (div:GPR (match_dup 1)
+       (udiv:GPR (match_dup 1)
                 (match_dup 2)))
    (set (match_dup 3)
        (mult:GPR (match_dup 0)