This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, committed] PowerPC predicate.md fixes PR target/20814


	altivec_register_operand needs to accept SUBREG and the various
and*_operand patterns were being too strict in the types of constants that
they were accepting.

Bootstrapped and regression tested on powerpc-ibm-aix5.2.0.0

David


	PR target/20814
	* config/rs6000/predicates.md (altivec_register_operand): Accept
	SUBREG. 
	(and64_operand): Do not limit CONST_INT to mask64_operand.
	(and64_2_operand): Do not limit CONST_INT to mask64_1or2_operand.
	(and_operand): Do not limit CONST_INT to mask_operand.

Index: predicates.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/predicates.md,v
retrieving revision 1.10
diff -c -p -r1.10 predicates.md
*** predicates.md	2 Apr 2005 10:46:03 -0000	1.10
--- predicates.md	7 Apr 2005 22:07:33 -0000
***************
*** 34,42 ****
    
  ;; Return 1 if op is an Altivec register.
  (define_predicate "altivec_register_operand"
!   (and (match_code "reg")
!        (match_test "ALTIVEC_REGNO_P (REGNO (op))
! 		    || REGNO (op) > LAST_VIRTUAL_REGISTER")))
  
  ;; Return 1 if op is XER register.
  (define_predicate "xer_operand"
--- 34,44 ----
    
  ;; Return 1 if op is an Altivec register.
  (define_predicate "altivec_register_operand"
!   (and (match_code "reg,subreg")
!        (and (match_operand 0 "register_operand")
! 	    (match_test "GET_CODE (op) != REG
! 			 || ALTIVEC_REGNO_P (REGNO (op))
! 			 || REGNO (op) > LAST_VIRTUAL_REGISTER"))))
  
  ;; Return 1 if op is XER register.
  (define_predicate "xer_operand"
***************
*** 531,559 ****
  ;; Return 1 if the operand is either a non-special register or a constant
  ;; that can be used as the operand of a PowerPC64 logical AND insn.
  (define_predicate "and64_operand"
!   (if_then_else (match_code "const_int")
!     (match_operand 0 "mask64_operand")
!     (if_then_else (match_test "fixed_regs[CR0_REGNO]")
!       (match_operand 0 "gpc_reg_operand")
!       (match_operand 0 "logical_operand"))))
  
  ;; Like and64_operand, but also match constants that can be implemented
  ;; with two rldicl or rldicr insns.
  (define_predicate "and64_2_operand"
!   (if_then_else (match_code "const_int")
!     (match_test "mask64_1or2_operand (op, mode, true)")
!     (if_then_else (match_test "fixed_regs[CR0_REGNO]")
!       (match_operand 0 "gpc_reg_operand")
!       (match_operand 0 "logical_operand"))))
  
  ;; Return 1 if the operand is either a non-special register or a
  ;; constant that can be used as the operand of a logical AND.
  (define_predicate "and_operand"
!   (if_then_else (match_code "const_int")
!     (match_operand 0 "mask_operand")
!     (if_then_else (match_test "fixed_regs[CR0_REGNO]")
!       (match_operand 0 "gpc_reg_operand")
!       (match_operand 0 "logical_operand"))))
  
  ;; Return 1 if the operand is a general non-special register or memory operand.
  (define_predicate "reg_or_mem_operand"
--- 533,559 ----
  ;; Return 1 if the operand is either a non-special register or a constant
  ;; that can be used as the operand of a PowerPC64 logical AND insn.
  (define_predicate "and64_operand"
!   (ior (match_operand 0 "mask64_operand")
!        (if_then_else (match_test "fixed_regs[CR0_REGNO]")
! 	 (match_operand 0 "gpc_reg_operand")
! 	 (match_operand 0 "logical_operand"))))
  
  ;; Like and64_operand, but also match constants that can be implemented
  ;; with two rldicl or rldicr insns.
  (define_predicate "and64_2_operand"
!   (ior (and (match_code "const_int")
! 	    (match_test "mask64_1or2_operand (op, mode, true)"))
!        (if_then_else (match_test "fixed_regs[CR0_REGNO]")
! 	 (match_operand 0 "gpc_reg_operand")
! 	 (match_operand 0 "logical_operand"))))
  
  ;; Return 1 if the operand is either a non-special register or a
  ;; constant that can be used as the operand of a logical AND.
  (define_predicate "and_operand"
!   (ior (match_operand 0 "mask_operand")
!        (if_then_else (match_test "fixed_regs[CR0_REGNO]")
! 	 (match_operand 0 "gpc_reg_operand")
! 	 (match_operand 0 "logical_operand"))))
  
  ;; Return 1 if the operand is a general non-special register or memory operand.
  (define_predicate "reg_or_mem_operand"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]