diff mbox series

V10 patch #3, Use PADDI to add large constants if -mcpu=future is used

Message ID 20191212001702.GC27911@ibm-toto.the-meissners.org
State New
Headers show
Series V10 patch #3, Use PADDI to add large constants if -mcpu=future is used | expand

Commit Message

Michael Meissner Dec. 12, 2019, 12:17 a.m. UTC
This patch adds an alternative to use PADDI to add large SImode and DImode
constants if -mcpu=future is used.

It is a slight reworking of patch V7 #3.  I have done bootstraps and make check
on a power8 little endian system and there were no regressions.  Can I check
this patch in?

2019-12-09  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/predicates.md (add_operand): Allow eI constants.
	* config/rs6000/rs6000.md (add<mode>3): Add alternative to
	generate PADDI for 34-bit constants if -mcpu=future.

Comments

Segher Boessenkool Dec. 17, 2019, 4:23 p.m. UTC | #1
On Wed, Dec 11, 2019 at 07:17:02PM -0500, Michael Meissner wrote:
> This patch adds an alternative to use PADDI to add large SImode and DImode
> constants if -mcpu=future is used.

> 2019-12-09  Michael Meissner  <meissner@linux.ibm.com>
> 
> 	* config/rs6000/predicates.md (add_operand): Allow eI constants.
> 	* config/rs6000/rs6000.md (add<mode>3): Add alternative to
> 	generate PADDI for 34-bit constants if -mcpu=future.

This is fine.  Okay for trunk.  Thanks!


Segher
diff mbox series

Patch

Index: gcc/config/rs6000/predicates.md
===================================================================
--- gcc/config/rs6000/predicates.md	(revision 279141)
+++ gcc/config/rs6000/predicates.md	(working copy)
@@ -839,7 +839,8 @@  (define_special_predicate "indexed_addre
 (define_predicate "add_operand"
   (if_then_else (match_code "const_int")
     (match_test "satisfies_constraint_I (op)
-		 || satisfies_constraint_L (op)")
+		 || satisfies_constraint_L (op)
+		 || satisfies_constraint_eI (op)")
     (match_operand 0 "gpc_reg_operand")))
 
 ;; Return 1 if the operand is either a non-special register, or 0, or -1.
Index: gcc/config/rs6000/rs6000.md
===================================================================
--- gcc/config/rs6000/rs6000.md	(revision 279144)
+++ gcc/config/rs6000/rs6000.md	(working copy)
@@ -1761,15 +1761,17 @@  (define_expand "add<mode>3"
 })
 
 (define_insn "*add<mode>3"
-  [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r,r")
-	(plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b,b")
-		  (match_operand:GPR 2 "add_operand" "r,I,L")))]
+  [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r,r,r")
+	(plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b,b,b")
+		  (match_operand:GPR 2 "add_operand" "r,I,L,eI")))]
   ""
   "@
    add %0,%1,%2
    addi %0,%1,%2
-   addis %0,%1,%v2"
-  [(set_attr "type" "add")])
+   addis %0,%1,%v2
+   addi %0,%1,%2"
+  [(set_attr "type" "add")
+   (set_attr "isa" "*,*,*,fut")])
 
 (define_insn "*addsi3_high"
   [(set (match_operand:SI 0 "gpc_reg_operand" "=b")