This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
%hi() operator on MIPS
- From: Shinpei Kato <shinpei at rt dot k2 dot keio dot ac dot jp>
- To: binutils at sources dot redhat dot com
- Date: Sat, 21 Aug 2004 23:31:40 +0900 (JST)
- Subject: %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>