Skip to content

Instantly share code, notes, and snippets.

@rygorous
Created July 11, 2013 03:28
Embed
What would you like to do?
The value in question is a signed short and starts out in r18.
1. 82020478 B241FF30 sth r18,-0D0h(r1)
2. 8202047C 7DF21670 srawi r18,r15,2
3. 82020480 7E0F0734 extsh r15,r16
4. 82020484 A201FF30 lhz r16,-0D0h(r1)
5. 82020488 B221FF30 sth r17,-0D0h(r1)
6. 8202048C 7D4A0734 extsh r10,r10
7. 82020490 7E111670 srawi r17,r16,2
1. spills it to memory.
4. reloads it from memory (zero-extended).
7. does an arithmetic right shift - note r16 didn't get sign-extended (extsh).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment