annotate test/short.c @ 427:0c256ea2a97e

Bitfield left value for ia32
author kono
date Sat, 30 Oct 2004 18:49:25 +0900
parents 5b50813d0c45
children 32737bad7489
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
170
6e0f67b7d200 test files
kono
parents:
diff changeset
1
6e0f67b7d200 test files
kono
parents:
diff changeset
2 short gj;
6e0f67b7d200 test files
kono
parents:
diff changeset
3 short gi;
6e0f67b7d200 test files
kono
parents:
diff changeset
4
6e0f67b7d200 test files
kono
parents:
diff changeset
5 short a[100];
6e0f67b7d200 test files
kono
parents:
diff changeset
6 unsigned short b[100];
6e0f67b7d200 test files
kono
parents:
diff changeset
7 unsigned char c[100];
6e0f67b7d200 test files
kono
parents:
diff changeset
8
278
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 172
diff changeset
9 short data[] = {10,20,-40,-50};
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 172
diff changeset
10 unsigned short udata[] = {10,20,-40,-50};
170
6e0f67b7d200 test files
kono
parents:
diff changeset
11
6e0f67b7d200 test files
kono
parents:
diff changeset
12 short f(short i,unsigned short j,unsigned short k,short m,short a);
6e0f67b7d200 test files
kono
parents:
diff changeset
13 unsigned
6e0f67b7d200 test files
kono
parents:
diff changeset
14 short g(short i,unsigned short j,unsigned short k,short m,short a);
6e0f67b7d200 test files
kono
parents:
diff changeset
15
6e0f67b7d200 test files
kono
parents:
diff changeset
16 main()
6e0f67b7d200 test files
kono
parents:
diff changeset
17 {
6e0f67b7d200 test files
kono
parents:
diff changeset
18 int ii;
6e0f67b7d200 test files
kono
parents:
diff changeset
19 short i,k,*p;
6e0f67b7d200 test files
kono
parents:
diff changeset
20 unsigned short j,m,*up;
6e0f67b7d200 test files
kono
parents:
diff changeset
21 unsigned char g0,h0;
6e0f67b7d200 test files
kono
parents:
diff changeset
22 char g1,h1;
6e0f67b7d200 test files
kono
parents:
diff changeset
23 unsigned short sg0,sh0;
6e0f67b7d200 test files
kono
parents:
diff changeset
24 short sg1,sh1;
6e0f67b7d200 test files
kono
parents:
diff changeset
25 unsigned char *pg0,*ph0;
6e0f67b7d200 test files
kono
parents:
diff changeset
26 char *pg1,*ph1;
6e0f67b7d200 test files
kono
parents:
diff changeset
27 unsigned short *psg0,*psh0;
6e0f67b7d200 test files
kono
parents:
diff changeset
28 short *psg1,*psh1;
6e0f67b7d200 test files
kono
parents:
diff changeset
29
6e0f67b7d200 test files
kono
parents:
diff changeset
30
6e0f67b7d200 test files
kono
parents:
diff changeset
31 i = -3;
6e0f67b7d200 test files
kono
parents:
diff changeset
32 j = 3;
6e0f67b7d200 test files
kono
parents:
diff changeset
33 k = 44;
6e0f67b7d200 test files
kono
parents:
diff changeset
34 k = i*j+3+k;
6e0f67b7d200 test files
kono
parents:
diff changeset
35 m = i*j-7+k;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
36 printf("#0035:%d %d %d\n",i,k,m);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
37
6e0f67b7d200 test files
kono
parents:
diff changeset
38 g0 = 123;
6e0f67b7d200 test files
kono
parents:
diff changeset
39 g0++; --g0;
6e0f67b7d200 test files
kono
parents:
diff changeset
40 ++g0; g0--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
41 printf("#0040:g0=%d\n",g0);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
42 g1 = -123;
6e0f67b7d200 test files
kono
parents:
diff changeset
43 g1++; --g1;
6e0f67b7d200 test files
kono
parents:
diff changeset
44 ++g1; g1--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
45 printf("#0044:g1=%d\n",g1);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
46
6e0f67b7d200 test files
kono
parents:
diff changeset
47 sg0 = 123;
6e0f67b7d200 test files
kono
parents:
diff changeset
48 sg0++; --sg0;
6e0f67b7d200 test files
kono
parents:
diff changeset
49 ++sg0; sg0--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
50 printf("#0049:sg0=%d\n",sg0);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
51 sg1 = -123;
6e0f67b7d200 test files
kono
parents:
diff changeset
52 sg1++; --sg1;
6e0f67b7d200 test files
kono
parents:
diff changeset
53 ++sg1; sg1--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
54 printf("#0053:sg1=%d\n",sg1);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
55
6e0f67b7d200 test files
kono
parents:
diff changeset
56 pg0 = &g0;
6e0f67b7d200 test files
kono
parents:
diff changeset
57 ph0 = &h0;
6e0f67b7d200 test files
kono
parents:
diff changeset
58 *pg0 = 123;
6e0f67b7d200 test files
kono
parents:
diff changeset
59 //*pg0++; *--pg0;
6e0f67b7d200 test files
kono
parents:
diff changeset
60 //*++pg0; *g0--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
61 printf("#0060:g0=%d\n",*pg0);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
62 pg1 = &g1;
6e0f67b7d200 test files
kono
parents:
diff changeset
63 ph1 = &h1;
6e0f67b7d200 test files
kono
parents:
diff changeset
64 *pg1 = -123;
6e0f67b7d200 test files
kono
parents:
diff changeset
65 //*pg1++; --*pg1;
6e0f67b7d200 test files
kono
parents:
diff changeset
66 //++*pg1; *pg1--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
67 printf("#0066:g1=%d\n",*pg1);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
68
6e0f67b7d200 test files
kono
parents:
diff changeset
69 psg0 = &sg0;
6e0f67b7d200 test files
kono
parents:
diff changeset
70 psh0 = &sh0;
6e0f67b7d200 test files
kono
parents:
diff changeset
71 *psg0 = 123;
6e0f67b7d200 test files
kono
parents:
diff changeset
72 //*sg0++; *--sg0;
6e0f67b7d200 test files
kono
parents:
diff changeset
73 //*++sg0; *sg0--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
74 printf("#0073:sg0=%d\n",*psg0);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
75 psg1 = &sg1;
6e0f67b7d200 test files
kono
parents:
diff changeset
76 psh1 = &sh1;
6e0f67b7d200 test files
kono
parents:
diff changeset
77 *psg1 = -123;
6e0f67b7d200 test files
kono
parents:
diff changeset
78 //*sg1++; *--sg1;
6e0f67b7d200 test files
kono
parents:
diff changeset
79 //*++sg1; *sg1--;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
80 printf("#0079:sg1=%d\n",*psg1);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
81
6e0f67b7d200 test files
kono
parents:
diff changeset
82
6e0f67b7d200 test files
kono
parents:
diff changeset
83 h0 = g0 - 20;
6e0f67b7d200 test files
kono
parents:
diff changeset
84 c[33] = g0;
6e0f67b7d200 test files
kono
parents:
diff changeset
85
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
86 if (i==j) { printf("#0085:i==j\n"); } else { printf("i!=j\n"); }
170
6e0f67b7d200 test files
kono
parents:
diff changeset
87
6e0f67b7d200 test files
kono
parents:
diff changeset
88 a[33] = i;
6e0f67b7d200 test files
kono
parents:
diff changeset
89 b[33] = 105;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
90 printf("#0089:i=%d\n",i);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
91 printf("#0090:j=%d\n",j);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
92 i++; --i;
6e0f67b7d200 test files
kono
parents:
diff changeset
93 j++; --j;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
94 printf("#0093:i=%d\n",i);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
95 printf("#0094:j=%d\n",j);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
96 gi = 3333;
6e0f67b7d200 test files
kono
parents:
diff changeset
97 gj = 6666;
6e0f67b7d200 test files
kono
parents:
diff changeset
98 gi++; --gi;
6e0f67b7d200 test files
kono
parents:
diff changeset
99 gj++; --gj;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
100 printf("#0099:gi=%d\n",gi);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
101 printf("#0100:gj=%d\n",gj);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
102
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
103 printf("#0102:k=%d\n",k);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
104 printf("#0103:m=%d\n",m);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
105 printf("#0104:a[33]=%d\n",a[33]);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
106 printf("#0105:b[33]=%d\n",b[33]);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
107 printf("#0106:a[33]=%d\n",++a[33]);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
108 printf("#0107:b[33]=%d\n",b[33]--);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
109
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
110 printf("#0109:g0=%d\n",g0);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
111 printf("#0110:h0=%d\n",h0);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
112 printf("#0111:c[33]=%d\n",c[33]);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
113
6e0f67b7d200 test files
kono
parents:
diff changeset
114 p = data;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
115 printf("#0114:*p++ = %d\n",*p++);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
116 printf("#0115:*++p = %d\n",*++p);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
117 *p++ = -343;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
118 printf("#0117:*p-- = %d\n",*p--);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
119 printf("#0118:*--p = %d\n",*--p);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
120 up = udata;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
121 printf("#0120:*up-- = %d\n",*up--);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
122 printf("#0121:*--up = %d\n",*--up);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
123 *up++ = 65530;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
124 printf("#0123:*up-- = %d\n",*up--);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
125 printf("#0124:*--up = %d\n",*--up);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
126
6e0f67b7d200 test files
kono
parents:
diff changeset
127
6e0f67b7d200 test files
kono
parents:
diff changeset
128 ii = f(i,j,k,m,a[33]);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
129 printf("#0128:f()=%d\n",ii);
170
6e0f67b7d200 test files
kono
parents:
diff changeset
130 ii = g(i,j,k,m,a[33]);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 278
diff changeset
131 printf("#0130:f()=%d\n",ii);
172
096559f07a70 some check
kono
parents: 170
diff changeset
132 return 0;
170
6e0f67b7d200 test files
kono
parents:
diff changeset
133 }
6e0f67b7d200 test files
kono
parents:
diff changeset
134
6e0f67b7d200 test files
kono
parents:
diff changeset
135 short f(short i,unsigned short j,unsigned short k,short m,short a)
6e0f67b7d200 test files
kono
parents:
diff changeset
136 {
6e0f67b7d200 test files
kono
parents:
diff changeset
137 return i+j*k-m/a;
6e0f67b7d200 test files
kono
parents:
diff changeset
138 }
6e0f67b7d200 test files
kono
parents:
diff changeset
139
6e0f67b7d200 test files
kono
parents:
diff changeset
140 unsigned
6e0f67b7d200 test files
kono
parents:
diff changeset
141 short g(short i,unsigned short j,unsigned short k,short m,short a)
6e0f67b7d200 test files
kono
parents:
diff changeset
142 {
6e0f67b7d200 test files
kono
parents:
diff changeset
143 return i+j*k-m/a;
6e0f67b7d200 test files
kono
parents:
diff changeset
144 }