mipsisa32-unknown-elf-as: Error: too large constant specified

Thiemo Seufer ica2_ts@csv.ica.uni-stuttgart.de
Wed Oct 15 15:21:00 GMT 2003


Nigel Stephens wrote:
[snip]
> [If  the 'or' immediate operand is zero extended by the assembler to 
> 0x0000000080000000, then  we've now generated an invalid operand for 
> "addu", since  32-bit MIPS arithmetical operations are only defined to 
> generate valid results if their inputs are correctly sign-extended, in 
> other cases their result is "unpredictable".]
> 
> I'd have to rewrite the code like this to get the original 32-bit semantics:
> 
> 	li	$2, 0x1234
> 	or	$2, $2, 0xffffffff80000000
> 	addu	$2, $2, 1

That's not only ugly but inefficient, too.

	addiu	$2, $0, -0x1234
	addu	$2, $2, 1


Thiemo



More information about the Binutils mailing list