]> git.gag.com Git - fw/openocd/commit
mips: optimize mips32_pracc_write_regs() code.
authorSalvador Arroyo <sarroyofdez@yahoo.es>
Sat, 3 Nov 2012 10:29:46 +0000 (11:29 +0100)
committerKeith Packard <keithp@keithp.com>
Sat, 13 Apr 2013 06:34:43 +0000 (23:34 -0700)
commit758d75ec21812c0d8b010055c46089d74d64c4ad
treeee0103341a8107afa9b1ceb67a71fc04249e4f21
parent9959297f2012eae7b810bb7d1c3679fafbee0fae
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