Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: sim/testsuite/sim/bfin/fact.s

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sim/testsuite/sim/bfin/c_dsp32shiftim_amix.s ('k') | sim/testsuite/sim/bfin/random_0014.S » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Blackfin testcase for factorial 1 # Blackfin testcase for factorial
2 # mach: bfin 2 # mach: bfin
3 3
4 .include "testutils.inc" 4 .include "testutils.inc"
5 5
6 start 6 start
7 7
8 .macro factorial num:req answer:req 8 .macro factorial num:req answer:req
9 R0 = \num (Z); 9 R0 = \num (Z);
10 CALL _fact; 10 CALL _fact;
(...skipping 10 matching lines...) Expand all
21 factorial 3 6 21 factorial 3 6
22 factorial 4 24 22 factorial 4 24
23 factorial 5 120 23 factorial 5 120
24 factorial 6 720 24 factorial 6 720
25 factorial 7 5040 25 factorial 7 5040
26 factorial 8 40320 26 factorial 8 40320
27 factorial 9 362880 27 factorial 9 362880
28 factorial 10 3628800 28 factorial 10 3628800
29 factorial 11 39916800 29 factorial 11 39916800
30 factorial 12 479001600 30 factorial 12 479001600
31 » factorial 13 6227020800 31 # This is the real answer, but it overflows 32bits. Since gas itself
32 # likes to choke on 64bit values when compiled for 32bit systems, just
33 # specify the truncated 32bit value since that's what the Blackfin will
34 # come up with too.
35 #» factorial 13 6227020800
32 factorial 13 1932053504 36 factorial 13 1932053504
33 pass 37 pass
34 38
35 _fact: 39 _fact:
36 LINK 0; 40 LINK 0;
37 [ -- SP ] = R7; 41 [ -- SP ] = R7;
38 CC = R0 < 2; 42 CC = R0 < 2;
39 IF CC JUMP 1f; 43 IF CC JUMP 1f;
40 R7 = R0; 44 R7 = R0;
41 R0 += -1; 45 R0 += -1;
42 CALL _fact; 46 CALL _fact;
43 R0 *= R7; 47 R0 *= R7;
44 1: 48 1:
45 R7 = [ SP ++ ]; 49 R7 = [ SP ++ ];
46 UNLINK; 50 UNLINK;
47 RTS; 51 RTS;
OLDNEW
« no previous file with comments | « sim/testsuite/sim/bfin/c_dsp32shiftim_amix.s ('k') | sim/testsuite/sim/bfin/random_0014.S » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698