[Libre-soc-bugs] [Bug 238] POWER Compressed Formal Standard writeup

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Nov 19 03:44:48 GMT 2020


--- Comment #43 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #41)
> i had a go at creating some ld/st r1 imm opcodes.  the imm range is reduced
> by 1 bit so as to fit the 4x combination of ld/st + d/w into only the 1 Cmaj
> opcode.
> i took out addis and crammed cmpw/d into one Cmaj.m to get the full Cmaj to
> do so.
> i have no idea what impact, statistically,  that will have on C.cmp, it
> would be necessary to see some of the values of immediates used.
> however, coming back to ld/st r1: the immediate range is 0-127 even with 1
> bit shared, which for doubles (ldi, stdi) is x8 so 0 to (1024-8) and for
> words (lwi, stwi) is x4 so 0 to (512-4)
> which given it's primarily intended for stack usage seems pretty damn
> enormous if you ask me :)

for stack ld/st, we want the immediates to have a range down to -256 bytes but
no farther, since leaf functions all store their local variables below the
stack pointer, since iirc the ABI has a 256 byte range (the red zone) where
signal/exception handlers aren't allowed to modify those bytes since they are
dedicated to the currently executing function.

I think we should just have the decoder hardware subtract 256 from the
immediate after shifting.

ld r10, 0x10(r1)
would be encoded using immediate (0x10 + 256) >> 3 == 0x22
ld r10, -0x58(r1)
would have immediate (-0x58 + 256) >> 3 == 0x15

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list