This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[COMMIT] Truncate hi16 values for IQ2000 port


Hi Guys,

  I ran across another 64-bit problem today, this time with the %hi()
  operator in the IQ2000 GAS port.  It was not allowing for the
  possibility that the number it was operating on might be a 64-bit
  type.  I am applying the patch below to fix this.  Tested by
  building a iq2000 toolchain (including gcc and libcc) and running
  the gcc testsuite.

  Cheers
    Nick

cpu/ChangeLog
2006-02-10  Nick Clifton  <nickc@redhat.com>

	* iq2000.opc (parse_hi16): Truncate shifted values to 16 bits.

cgen/ChangeLog
2006-02-10  Nick Clifton  <nickc@redhat.com>

	* cpu/iq2000.opc (parse_hi16): Truncate shifted values to 16
	bits.

opcodes/ChangeLog
 2006-02-10  Nick Clifton  <nickc@redhat.com>

         * iq2000-asm.c: Regenerate.

Index: cpu/iq2000.opc
===================================================================
RCS file: /cvs/src/src/cpu/iq2000.opc,v
retrieving revision 1.6
diff -c -3 -p -r1.6 iq2000.opc
*** cpu/iq2000.opc	5 Jul 2005 15:07:45 -0000	1.6
--- cpu/iq2000.opc	10 Feb 2006 11:59:29 -0000
*************** parse_hi16 (CGEN_CPU_DESC cd,
*** 218,223 ****
--- 218,224 ----
  	  if (value & 0x8000)
  	    value += 0x10000;
  	  value >>= 16;
+ 	  value &= 0xffff;
  	}
        *valuep = value;
  
*************** parse_hi16 (CGEN_CPU_DESC cd,
*** 243,248 ****
--- 244,250 ----
    	  && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
  	value >>= 16;
  
+       value &= 0xffff;
        *valuep = value;
  
        return errmsg;




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