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]

Re: [v850 patch?] num_sign_bit_copies1: sign_extending consts


> >   ;; ??? Sign extending constants isn't valid.  Fix?
> 
> Comment now addressed.  ;-)

And removed.

> Hmm... I don't actually see anything wrong with using 
> mismatched modes here.  You should be able to just use :HI,
> which will dtrt in const_int_operand.

It does :-)

2003-11-04  DJ Delorie  <dj@redhat.com>

	* config/v850/v850.md (mulhisi3): Expand the const_int case
	separately to avoid trying to sign extend the const.

Index: config/v850/v850.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850.md,v
retrieving revision 1.23
diff -p -2 -r1.23 v850.md
*** config/v850/v850.md	4 Apr 2003 10:38:50 -0000	1.23
--- config/v850/v850.md	4 Nov 2003 17:44:05 -0000
***************
*** 369,373 ****
  	  (sign_extend:SI (match_operand:HI 2 "nonmemory_operand" ""))))]
    ""
!   "")
  
  (define_insn "*mulhisi3_internal1"
--- 369,377 ----
  	  (sign_extend:SI (match_operand:HI 2 "nonmemory_operand" ""))))]
    ""
!   "if (GET_CODE (operands[2]) == CONST_INT)
!      {
!        emit_insn (gen_mulhisi3_internal2 (operands[0], operands[1], operands[2]));
!        DONE;
!      }")
  
  (define_insn "*mulhisi3_internal1"
***************
*** 382,392 ****
     (set_attr "type" "mult")])
  
! ;; ??? Sign extending constants isn't valid.  Fix?
! 
! (define_insn "*mulhisi3_internal2"
    [(set (match_operand:SI 0 "register_operand" "=r,r")
  	(mult:SI
  	  (sign_extend:SI (match_operand:HI 1 "register_operand" "%0,r"))
! 	  (sign_extend:SI (match_operand 2 "const_int_operand" "J,K"))))]
    ""
    "@
--- 386,394 ----
     (set_attr "type" "mult")])
  
! (define_insn "mulhisi3_internal2"
    [(set (match_operand:SI 0 "register_operand" "=r,r")
  	(mult:SI
  	  (sign_extend:SI (match_operand:HI 1 "register_operand" "%0,r"))
! 	  (match_operand:HI 2 "const_int_operand" "J,K")))]
    ""
    "@


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