Andes Workshop http://forum.andestech.com/ |
|
How to generate ABS instruction http://forum.andestech.com/viewtopic.php?f=23&t=742 |
Page 1 of 1 |
Author: | cindy [ Tue Oct 15, 2013 6:53 pm ] |
Post subject: | How to generate ABS instruction |
In performance extension V1 (PE1), there is a ABS instruction. Here is an example code to generate ABS instruction. Code is here, compiled by N968A toolchain.(V3) Code: int a; void main() { int b = (a > 0)? a: -a; } Result (partial) 5000e0: fc 01 push25 $r6,#0x8 ! {$r6, $fp, $gp, $lp} 5000e2: 3c 0d ff fe lwi.gp $r0,[+#-8] 5000e6: 42 00 00 03 abs $r0,$r0 5000ea: f0 81 swi37.sp $r0,[+#0x4] 5000ec: fc 81 pop25 $r6,#0x8 ! {$r6, $fp, $gp, $lp} |
Page 1 of 1 | All times are UTC + 8 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |