Optimize unaligned reading #42

Closed
soywiz opened this Issue May 5, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@soywiz
Collaborator

soywiz commented May 5, 2012

Unaligned reading is performed using a pair of LWL and LWR, usually they are not contiguous if the compiler tries to use other registers to improve speed.

The way you read an unaligned word is like this:

lwl RT, offset(RS)
lwr RT, (offset+3)(RS)

Currently the implementation of LWL and LWR is slow, so it would be great if we try to find both instructions and convert it in a single unaligned read word.

In order to be able to perform this optimization safely we have to see that we don't have any jump label between those instructions, and there is no access to RS or RT registers in the instructions between.

Then we replace the LWL with the load, and tell the compiler to ignore the LWR instruction.

@soywiz

This comment has been minimized.

Show comment
Hide comment
@soywiz

soywiz May 5, 2012

Collaborator

Partially implemented.

Collaborator

soywiz commented May 5, 2012

Partially implemented.

@soywiz soywiz closed this Dec 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment