mips: optimize mips32_pracc_write_regs() code.
commit18077654afaa6f5325abf0d01187161770ff8ce4
authorSalvador Arroyo <sarroyofdez@yahoo.es>
Sat, 3 Nov 2012 10:29:46 +0000 (3 11:29 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Fri, 16 Nov 2012 12:42:03 +0000 (16 12:42 +0000)
treeaa4043f45ad974d210161d1eed4039662e7d0a6c
parentf3e01106d9a8e7ad6b81413f37c1f6d5c806600d
mips: optimize mips32_pracc_write_regs() code.

All the the loads are done with lui and ori instructions, there is
no need to save any register, they will be overwritten.
Like in the previous patch, for speed optimization in write code,
same instructions can be saved if the lower half word or the upper
half word is 0.
If the lower half word is 0, it can be loaded with only a lui instruction.
If the higher half word is 0 it can be done with an ori instruction with register 0.
This code saves 10 pracc accesses at a minimum, and 40 at a maximum,
obviously if register 2 to 31 are 0 or a half word is 0
Current code needs 91 pracc accesses.

Change-Id: I892c5b440191d0c7a474c96845d41c373b7fc637
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/957
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
src/target/mips32_pracc.c