NyuziToolchain icon indicating copy to clipboard operation
NyuziToolchain copied to clipboard

Optimize constant pool/global memory accesses

Open jbush001 opened this issue 7 years ago • 0 comments

With new implementation, a constant pool load takes 3 instructions:

	movehi s0, hi(.LCPI1_0)
	or s0, s0, lo(.LCPI1_0)
	load_32 s0, (s0)

This can be done in two instructions by using an immediate offset with the memory instruction:

	movehi s0, hi(.LCPI1_0)
	load_32 s0, lo(.LCPI1_0)(s0)

This will require a new type of relocation that can patch the memory instruction. Global variable loads and stores can be optimized similarly.

jbush001 avatar Apr 18 '17 13:04 jbush001