annotate test/ps2code.c @ 751:c921670e2ce8

i64 continue... 64bit register
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 14 Nov 2010 04:56:02 +0900
parents c2c709727221
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 647
diff changeset
1 #define __environment _CbC_environment
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 647
diff changeset
2 #define __return _CbC_return
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 647
diff changeset
3
647
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
4 #ifndef INLINE
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
5 #define INLINE
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
6 #endif
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
7
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
8 int printf(const char *,...);
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
9 void bzero(void *b, unsigned int len);
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
10
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
11
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
12
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
13 typedef float ps2_vu0_fmatrix[4][4] __attribute__((aligned (16)));
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
14 typedef ps2_vu0_fmatrix FMATRIX;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
15
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
16 typedef float ps2_vu0_fmatrix1[4][4];
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
17 typedef ps2_vu0_fmatrix1 FMATRIX1;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
18
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
19
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
20 void ps2_vu0_unit_matrix(ps2_vu0_fmatrix m)
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
21 {
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
22 printf("#0021:%g\n",m[1][1]);
647
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
23 m[1][1] = -0.5;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
24 }
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
25
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
26
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
27 #define mod16(a) (((int)(&a))%16)
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
28
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
29 __code
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
30 align16(int i, FMATRIX a, FMATRIX b) {
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
31 FMATRIX m;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
32 FMATRIX n;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
33 int k = i;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
34 FMATRIX o;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
35 ps2_vu0_unit_matrix(a);
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
36 if (i==0) goto align16_1(2,a,b);
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
37 printf("#0036:offset %d\n",((char*)a) - ((char*)(&m)));
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
38 printf("#0037:%d %d %d\n",mod16(m),mod16(n),mod16(o));
647
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
39 goto align16(i-1,m,n);
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
40 }
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
41
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 647
diff changeset
42 __code (*exit0)(int,void*);
647
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
43 void *env;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
44
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
45 __code
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
46 align16_1(int i, FMATRIX1 a, FMATRIX1 b) {
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
47 FMATRIX1 m;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
48 FMATRIX1 n;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
49 int k = i;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
50 FMATRIX1 o;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
51 ps2_vu0_unit_matrix(a);
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 647
diff changeset
52 if (i==0) goto exit0(0,env);
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
53 printf("#0052:offset %d\n",((char*)a) - ((char*)(&m)));
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
54 printf("#0053:%d %d %d\n",mod16(m),mod16(n),mod16(o));
647
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
55 goto align16_1(i-1,m,n);
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
56 }
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
57
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
58
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
59 int
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
60 main(int ac, char *av[])
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
61 {
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
62 FMATRIX m;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
63
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
64 m[1][1] = 0.5;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
65 exit0 = return;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
66 env = environment;
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
67 goto align16(2,m,m);
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
68 }
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
69
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
70
fe23fe842b82 *** empty log message ***
kono
parents:
diff changeset
71 /* end */