diff mbox series

[RS6000] rs6000_rtx_costs for PLUS/MINUS constant

Message ID 20200915011946.3395-3-amodra@gmail.com
State New
Headers show
Series [RS6000] rs6000_rtx_costs for PLUS/MINUS constant | expand

Commit Message

Alan Modra Sept. 15, 2020, 1:19 a.m. UTC
These functions do behave a little differently for SImode, so the
mode should be passed.

	* config/rs6000/rs6000.c (rs6000_rtx_costs): Pass mode to
	reg_or_add_cint_operand and reg_or_sub_cint_operand.

Comments

Segher Boessenkool Sept. 15, 2020, 10:31 p.m. UTC | #1
On Tue, Sep 15, 2020 at 10:49:40AM +0930, Alan Modra wrote:
> These functions do behave a little differently for SImode, so the
> mode should be passed.
> 
> 	* config/rs6000/rs6000.c (rs6000_rtx_costs): Pass mode to
> 	reg_or_add_cint_operand and reg_or_sub_cint_operand.

Okay for trunk.  Thanks!

(Btw, please use [patch 2/6] etc. markers?  It helps refer to them :-) )


Segher
diff mbox series

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 6fc86f8185a..32044d33977 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -21189,9 +21189,9 @@  rs6000_rtx_costs (rtx x, machine_mode mode, int outer_code,
 	  return true;
 	}
       else if ((outer_code == PLUS
-		&& reg_or_add_cint_operand (x, VOIDmode))
+		&& reg_or_add_cint_operand (x, mode))
 	       || (outer_code == MINUS
-		   && reg_or_sub_cint_operand (x, VOIDmode))
+		   && reg_or_sub_cint_operand (x, mode))
 	       || ((outer_code == SET
 		    || outer_code == IOR
 		    || outer_code == XOR)