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]

[avr port] bugfix for movstrhi, clrstrhi


2002-09-09  Denis Chertykov  <denisc@overta.ru>

	* config/avr/avr.md (movstrhi, clrstrhi): Use gen_int_mode for
	right conversion of operands[1].


Index: avr.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/avr/avr.md,v
retrieving revision 1.35
diff -c -3 -p -r1.35 avr.md
*** avr.md	13 Aug 2002 14:06:56 -0000	1.35
--- avr.md	9 Sep 2002 17:54:42 -0000
***************
*** 356,368 ****
    "{
    rtx addr0, addr1;
    int cnt8;
  
    if (GET_CODE (operands[2]) != CONST_INT)
      FAIL;
!   cnt8 = byte_immediate_operand (operands[2], GET_MODE (operands[2]));
!   operands[2] = copy_to_mode_reg (cnt8 ? QImode : HImode, operands[2]);
!   operands[4] = operands[2];
! 
    addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
    addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
  
--- 356,369 ----
    "{
    rtx addr0, addr1;
    int cnt8;
+   enum machine_mode mode;
  
    if (GET_CODE (operands[2]) != CONST_INT)
      FAIL;
!   cnt8 = byte_immediate_operand (operands[1], GET_MODE (operands[1]));
!   mode = cnt8 ? QImode : HImode;
!   operands[1] = copy_to_mode_reg (mode,
!                                   gen_int_mode (INTVAL (operands[1]), mode));
    addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
    addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
  
***************
*** 428,439 ****
    "{
    rtx addr0;
    int cnt8;
  
    if (GET_CODE (operands[1]) != CONST_INT)
      FAIL;
  
    cnt8 = byte_immediate_operand (operands[1], GET_MODE (operands[1]));
!   operands[1] = copy_to_mode_reg (cnt8 ? QImode : HImode, operands[1]);
    operands[3] = operands[1];
  
    addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
--- 429,443 ----
    "{
    rtx addr0;
    int cnt8;
+   enum machine_mode mode;
  
    if (GET_CODE (operands[1]) != CONST_INT)
      FAIL;
  
    cnt8 = byte_immediate_operand (operands[1], GET_MODE (operands[1]));
!   mode = cnt8 ? QImode : HImode;
!   operands[1] = copy_to_mode_reg (mode,
!                                   gen_int_mode (INTVAL (operands[1]), mode));
    operands[3] = operands[1];
  
    addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));


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