On Wed, Aug 08, 2001 at 04:12:39PM -0400, J. Scott Kasten wrote: > 100012b0: ffc20028 sd $v0,40($s8) > 100012b4: dfc20028 ld $v0,40($s8) > 100012b8: 3c030807 lui $v1,0x807 > 100012bc: 34630605 ori $v1,$v1,0x605 > 100012c0: 00031c38 dsll $v1,$v1,0x10 > 100012c4: 34630403 ori $v1,$v1,0x403 > 100012c8: 00031c38 dsll $v1,$v1,0x10 > 100012cc: 34630201 ori $v1,$v1,0x201 > 100012d0: fc430000 sd $v1,0($v0) > 100012d4: dfc20020 ld $v0,32($s8) > 100012d8: 64430001 daddiu $v1,$v0,1 > 100012dc: ffc30020 sd $v1,32($s8) > 100012e0: dfc20028 ld $v0,40($s8) > > Ouch that's a painfull load. It's interesting that in both cases, it > effectively makes the constant load a 16 bit operation, does the math 64 > bit, and stores 64 bit. With GP optimization something like the following would have been created: dla $gp, _gp + $8000 ld $reg1, %gprel(var)($gp) daddiu $reg1, $reg1, 1 sd $reg1, %gprel(var)($gp) _gp: var: .word 0 Gas is lame. MIPS/ELF gas is more. Ralf