This is the mail archive of the binutils@sources.redhat.com 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]

%hi() operator on MIPS


Hi, there.
I found a strange behavior of GAS for MIPS.
If we assemble the following codes with -d option, we want to expect the following output. But the actual output is like below.

[code]
	lui $8, %hi(0x87f0c000)
	ori $8, $8, %lo(0x87f0c000)

[expected output]
	lui t0, 0x87f0
	ori t0, 0xc000

[actual output]
	lui t0, 0x87f1
	ori t0, 0xc000

Why 0x87f0 is changed to 0x87f1?
If we use la instead of lui/ori/%hi/%lo, it's expanded as follows and works.

[code]
	la $8, 0x87f0c000

[output]
	lui t0, 0x87f0
	ori t0, t0, 0xc000

A similar problem was discussed before in this ML though, is this behavior OK?


Thanks,
Shinpei Kato <shinpei@rt.k2.keio.ac.jp>


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