annotate CbC-examples/test_para4.c @ 44:a14cd9f25ac4

merge.
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Mon, 25 Jan 2010 17:27:45 +0900
parents 959d4c8c8abc
children 5d30d517ebed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 //#include<stdio.h>
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 //#include<stdlib.h>
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #define DPRINT 1
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 #define NOINLINE __attribute__((noinline))
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 extern __code cs_goto(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j,
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 int a2, int b2, int c2, int d2, int e2, int f2, int g2, int h2, int i2, int j2);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 extern __code cs0(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j,
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 int a2, int b2, int c2, int d2, int e2, int f2, int g2, int h2, int i2, int j2);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 __code (*csp)(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j,
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 int a2, int b2, int c2, int d2, int e2, int f2, int g2, int h2, int i2, int j2);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 __code NOINLINE cs_exit(int a){
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 int b = 20 * a + 3;
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 printf("cs_exit : a=%d. b=%d\n", a, b);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 exit(a);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 }
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
21
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
21 __code NOINLINE cs0(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j,
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
22 int a2, int b2, int c2, int d2, int e2, int f2, int g2, int h2, int i2, int j2){
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
23 #if DPRINT
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
24 //printf("cs0 : a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d.\n", a, b, c, d, e, f, g);
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
25 printf("cs0 : a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d, j=%d\n",
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
26 a, b, c, d, e, f, g, h, i, j);
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
27 printf("cs0 : a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d, j=%d\n",
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
28 a2, b2, c2, d2, e2, f2, g2, h2, i2, j2);
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
29 #endif
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
30 goto cs_exit( (int)(10*a + 10*b + 10*i2 + 10*j2) );
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
31 }
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
32
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
33 __code NOINLINE cs_goto(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j,
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
34 int a2, int b2, int c2, int d2, int e2, int f2, int g2, int h2, int i2, int j2){
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
35 #if DPRINT
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
36 printf("cs_goto : a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d, j=%d\n",
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
37 a, b, c, d, e, f, g, h, i, j);
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
38 printf("cs_goto : a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d, j=%d\n",
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
39 a2, b2, c2, d2, e2, f2, g2, h2, i2, j2);
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
40 #endif
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
41 goto cs0(b, c, d, e, f, g, h, i, j, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, a);
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
42 }
959d4c8c8abc add conv.c conv1.c
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
43
16
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 int function(double l, float m, int n){
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 int a=10, b=20, c=30, d=40, e=50, f=60, g=70, h=80, i=90, j=100;
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 int a2=110, b2=120, c2=130, d2=140, e2=150, f2=160, g2=170, h2=180, i2=190, j2=200;
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 #if DPRINT
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 printf("function: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d, j=%d\n",
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 a, b, c, d, e, f, g, h, i, j);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 printf("function: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d, j=%d\n",
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 a2, b2, c2, d2, e2, f2, g2, h2, i2, j2);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 //printf("l=%lf, m=%f, n=%d\n", l, m, n);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 #endif
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 //goto cs_goto(10, 20, 30, 40);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 goto cs_goto(a, b, c, d, e, f, g, h, i, j, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 }
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 int main(int argc, char **argv){
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 //printf("main :\n");
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 /*
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 printf("main : a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d, j=%d\n",
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 a, b, c, d, e, f, g, h, i, j);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 printf("main : a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d, j=%d\n",
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 a2, b2, c2, d2, e2, f2, g2, h2, i2, j2);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 */
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 //csp = cs0;
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 function(10.01, 20.02, 30);
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 return 0;
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 }
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
4c6926a2b9bc examples.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74