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]

Re: Patch to avoid prefixes in ashlhi3 pattern


Hi
This is an updated patch. I've added the same change to neg pattern
as well.

Maybe I can rewrite ashlhi pattern to use the new code of ashlsi pattern.
It can use lea instruction as well then.

Honza

Tue Apr 13 17:12:19 MET DST 1999 Jan Hubicka <hubicka@freesoft.cz>

	* i386.md (neghi2): Do not output prefixed opcode when possible.
	(ashlhi3): Likewise.

*** i386.md1	Tue Apr 13 13:18:34 1999
--- i386.md	Tue Apr 13 17:11:35 1999
*************** byte_xor_operation:
*** 4660,4666 ****
    [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
  	(neg:HI (match_operand:HI 1 "nonimmediate_operand" "0")))]
    ""
!   "neg%W0 %0")
  
  (define_insn "negqi2"
    [(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
--- 4660,4672 ----
    [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
  	(neg:HI (match_operand:HI 1 "nonimmediate_operand" "0")))]
    ""
!   "*
!     if (REG_P (operands[0]) && i386_cc_probably_useless_p (insn))
!       {
! 	CC_STATUS_INIT;
! 	return AS1(neg%L0,%0);
!       }
!     return AS1(neg%W0,%0);")
  
  (define_insn "negqi2"
    [(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
*************** byte_xor_operation:
*** 4992,5002 ****
    "*
  {
    if (REG_P (operands[2]))
!     return AS2 (sal%W0,%b2,%0);
  
    if (REG_P (operands[0]) && operands[2] == const1_rtx)
!     return AS2 (add%W0,%0,%0);
  
    return AS2 (sal%W0,%2,%0);
  }")
  
--- 4998,5027 ----
    "*
  {
    if (REG_P (operands[2]))
!     {
!       if (REG_P (operands[0]) && i386_cc_probably_useless_p (insn))
!         {
!           CC_STATUS_INIT;
!           return AS2 (sal%L0,%b2,%k0);
!         }
!       return AS2 (sal%W0,%b2,%0);
!     }
  
    if (REG_P (operands[0]) && operands[2] == const1_rtx)
!     {
!       if (i386_cc_probably_useless_p (insn))
!         {
!           CC_STATUS_INIT;
!           return AS2 (add%L0,%k0,%k0);
!         }
!       return AS2 (add%W0,%0,%0);
!     }
  
+   if (REG_P (operands[0]) && i386_cc_probably_useless_p (insn))
+     {
+       CC_STATUS_INIT;
+       return AS2 (sal%L0,%2,%k0);
+     }
    return AS2 (sal%W0,%2,%0);
  }")
  


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