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] h8300.md: Use '?' to simplify a pattern.


Hi,

Attached is a patch to use '?' to simplify a pattern based on the
discussion starting at:

http://gcc.gnu.org/ml/gcc-patches/2003-03/msg00168.html

Tested on h8300 port.  Committed.

Kazu Hirata

2003-03-03  Kazu Hirata  <kazu at cs dot umass dot edu>

	* config/h8300/h8300.md (*extzv_8_8): Use '?' to simplify the
	pattern.

Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.183
diff -c -r1.183 h8300.md
*** h8300.md	3 Mar 2003 14:34:09 -0000	1.183
--- h8300.md	4 Mar 2003 01:09:51 -0000
***************
*** 2625,2645 ****
  ;; extzv:SI
  
  (define_insn "*extzv_8_8"
!   [(set (match_operand:SI 0 "register_operand" "=r")
! 	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
  			 (const_int 8)
  			 (const_int 8)))]
    "TARGET_H8300H || TARGET_H8300S"
!   "*
! {
!   if (REG_P (operands[0]) && REG_P (operands[1])
!       && REGNO (operands[0]) != REGNO (operands[1]))
!     return \"sub.l\\t%S0,%S0\;mov.b\\t%x1,%w0\";
!   else
!     return \"mov.b\\t%x1,%w0\;extu.w\\t%f0\;extu.l\\t%S0\";
! }"
!   [(set_attr "cc" "set_znv")
!    (set_attr "length" "6")])
  
  (define_insn "*extzv_8_16"
    [(set (match_operand:SI 0 "register_operand" "=r")
--- 2625,2640 ----
  ;; extzv:SI
  
  (define_insn "*extzv_8_8"
!   [(set (match_operand:SI 0 "register_operand" "=r,r")
! 	(zero_extract:SI (match_operand:SI 1 "register_operand" "?0,r")
  			 (const_int 8)
  			 (const_int 8)))]
    "TARGET_H8300H || TARGET_H8300S"
!   "@
!    mov.b\\t%x1,%w0\;extu.w\\t%f0\;extu.l\\t%S0
!    sub.l\\t%S0,%S0\;mov.b\\t%x1,%w0"
!   [(set_attr "cc" "clobber,set_znv")
!    (set_attr "length" "4,6")])
  
  (define_insn "*extzv_8_16"
    [(set (match_operand:SI 0 "register_operand" "=r")


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