annotate test/bitfield.c @ 338:7fe7ce0a791f bit-field-done

bit-field done for IA32, PowerPC, MIPS. bit-field assop. No bit-field global init.
author kono
date Fri, 25 Jun 2004 14:30:43 +0900
parents d488b72254fb
children 5ac17fa9d7e0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
336
d488b72254fb bit-field done.
kono
parents:
diff changeset
1
d488b72254fb bit-field done.
kono
parents:
diff changeset
2
d488b72254fb bit-field done.
kono
parents:
diff changeset
3 typedef union {
d488b72254fb bit-field done.
kono
parents:
diff changeset
4 struct _PTE {
d488b72254fb bit-field done.
kono
parents:
diff changeset
5 unsigned long v:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
6 unsigned long vsid:24;
d488b72254fb bit-field done.
kono
parents:
diff changeset
7 unsigned long h:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
8 unsigned long api:6;
d488b72254fb bit-field done.
kono
parents:
diff changeset
9 unsigned long rpn:20;
d488b72254fb bit-field done.
kono
parents:
diff changeset
10
d488b72254fb bit-field done.
kono
parents:
diff changeset
11 unsigned long :3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
12 unsigned long r:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
13 unsigned long c:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
14 unsigned long w:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
15 unsigned long i:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
16 unsigned long m:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
17 unsigned long g:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
18 unsigned long :1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
19 unsigned long pp:2;
338
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
20 long long lpn:40;
336
d488b72254fb bit-field done.
kono
parents:
diff changeset
21 } pte;
d488b72254fb bit-field done.
kono
parents:
diff changeset
22 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
23 unsigned char v:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
24 signed long vsid:24;
d488b72254fb bit-field done.
kono
parents:
diff changeset
25 unsigned long h:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
26 signed char api:6;
d488b72254fb bit-field done.
kono
parents:
diff changeset
27 signed long rpn:20;
d488b72254fb bit-field done.
kono
parents:
diff changeset
28
d488b72254fb bit-field done.
kono
parents:
diff changeset
29 signed long :3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
30 unsigned long r:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
31 unsigned long c:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
32 unsigned long w:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
33 unsigned long i:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
34 unsigned long m:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
35 unsigned long g:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
36 unsigned long :1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
37 signed long pp:2;
d488b72254fb bit-field done.
kono
parents:
diff changeset
38 } sg;
d488b72254fb bit-field done.
kono
parents:
diff changeset
39 unsigned long u[2];
d488b72254fb bit-field done.
kono
parents:
diff changeset
40 } PTE;
d488b72254fb bit-field done.
kono
parents:
diff changeset
41
d488b72254fb bit-field done.
kono
parents:
diff changeset
42 PTE g;
d488b72254fb bit-field done.
kono
parents:
diff changeset
43
d488b72254fb bit-field done.
kono
parents:
diff changeset
44 main()
d488b72254fb bit-field done.
kono
parents:
diff changeset
45 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
46 PTE a,*p;
d488b72254fb bit-field done.
kono
parents:
diff changeset
47 int i = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
48 int j = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
49
d488b72254fb bit-field done.
kono
parents:
diff changeset
50 a.pte.rpn = 55;
d488b72254fb bit-field done.
kono
parents:
diff changeset
51 j = a.pte.rpn;
d488b72254fb bit-field done.
kono
parents:
diff changeset
52 printf("% 3d: %d\n",i++,j);
d488b72254fb bit-field done.
kono
parents:
diff changeset
53 a.pte.c = 1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
54 j = a.pte.c;
d488b72254fb bit-field done.
kono
parents:
diff changeset
55 printf("% 3d: %d\n",i++,j);
d488b72254fb bit-field done.
kono
parents:
diff changeset
56 a.pte.pp = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
57 j = a.pte.pp;
d488b72254fb bit-field done.
kono
parents:
diff changeset
58 printf("% 3d: %d\n",i++,j);
d488b72254fb bit-field done.
kono
parents:
diff changeset
59 a.sg.pp = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
60 j = a.sg.pp;
d488b72254fb bit-field done.
kono
parents:
diff changeset
61 printf("% 3d: %d\n",i++,j);
d488b72254fb bit-field done.
kono
parents:
diff changeset
62
d488b72254fb bit-field done.
kono
parents:
diff changeset
63 p = &g;
d488b72254fb bit-field done.
kono
parents:
diff changeset
64
d488b72254fb bit-field done.
kono
parents:
diff changeset
65 g.u[0]=0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
66 g.u[1]=0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
67
d488b72254fb bit-field done.
kono
parents:
diff changeset
68 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
69 g.pte. v = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
70 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
71 g.pte. vsid = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
72 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
73 g.pte. h = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
74 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
75 g.pte. api = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
76 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
77 g.pte. rpn = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
78 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
79
d488b72254fb bit-field done.
kono
parents:
diff changeset
80 g.pte. r = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
81 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
82 g.pte. c = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
83 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
84 g.pte. w = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
85 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
86 g.pte. i = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
87 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
88 g.pte. m = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
89 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
90 g.pte. g = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
91 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
92 g.pte. pp = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
93 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
94
d488b72254fb bit-field done.
kono
parents:
diff changeset
95 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
96 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
97
d488b72254fb bit-field done.
kono
parents:
diff changeset
98 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
99 g.pte. v = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
100 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
101 g.pte. vsid = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
102 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
103 g.pte. h = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
104 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
105 g.pte. api = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
106 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
107 g.pte. rpn = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
108 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
109
d488b72254fb bit-field done.
kono
parents:
diff changeset
110 g.pte. r = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
111 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
112 g.pte. c = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
113 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
114 g.pte. w = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
115 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
116 g.pte. i = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
117 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
118 g.pte. m = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
119 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
120 g.pte. g = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
121 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
122 g.pte. pp = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
123 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
124
d488b72254fb bit-field done.
kono
parents:
diff changeset
125 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
126 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
127
d488b72254fb bit-field done.
kono
parents:
diff changeset
128 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
129 g.pte. v = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
130 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
131 g.pte. vsid = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
132 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
133 g.pte. h = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
134 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
135 g.pte. api = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
136 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
137 g.pte. rpn = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
138 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
139
d488b72254fb bit-field done.
kono
parents:
diff changeset
140 g.pte. r = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
141 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
142 g.pte. c = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
143 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
144 g.pte. w = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
145 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
146 g.pte. i = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
147 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
148 g.pte. m = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
149 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
150 g.pte. g = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
151 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
152 g.pte. pp = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
153 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
154
d488b72254fb bit-field done.
kono
parents:
diff changeset
155 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
156 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
157
d488b72254fb bit-field done.
kono
parents:
diff changeset
158 for(i=0;i<0x200;i++) {
d488b72254fb bit-field done.
kono
parents:
diff changeset
159 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
160 g.pte. v = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
161 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
162 g.pte. vsid = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
163 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
164 g.pte. h = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
165 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
166 g.pte. api = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
167 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
168 g.pte. rpn = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
169 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
170
d488b72254fb bit-field done.
kono
parents:
diff changeset
171 g.pte. r = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
172 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
173 g.pte. c = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
174 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
175 g.pte. w = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
176 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
177 g.pte. i = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
178 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
179 g.pte. m = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
180 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
181 g.pte. g = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
182 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
183 g.pte. pp = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
184 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
185 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
186
d488b72254fb bit-field done.
kono
parents:
diff changeset
187 g = a;
d488b72254fb bit-field done.
kono
parents:
diff changeset
188
d488b72254fb bit-field done.
kono
parents:
diff changeset
189 printf("%d %d %d\n",a.pte.pp,g.pte.pp,p->pte.pp);
d488b72254fb bit-field done.
kono
parents:
diff changeset
190 main2();
d488b72254fb bit-field done.
kono
parents:
diff changeset
191 main5();
338
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
192 main3();
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
193 main4();
336
d488b72254fb bit-field done.
kono
parents:
diff changeset
194 return 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
195 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
196
d488b72254fb bit-field done.
kono
parents:
diff changeset
197 main2()
d488b72254fb bit-field done.
kono
parents:
diff changeset
198 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
199 int i = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
200
d488b72254fb bit-field done.
kono
parents:
diff changeset
201 g.u[0]=0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
202 g.u[1]=0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
203
d488b72254fb bit-field done.
kono
parents:
diff changeset
204 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
205 g.sg. v = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
206 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
207 g.sg. vsid = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
208 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
209 g.sg. h = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
210 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
211 g.sg. api = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
212 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
213 g.sg. rpn = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
214 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
215
d488b72254fb bit-field done.
kono
parents:
diff changeset
216 g.sg. r = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
217 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
218 g.sg. c = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
219 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
220 g.sg. w = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
221 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
222 g.sg. i = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
223 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
224 g.sg. m = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
225 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
226 g.sg. g = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
227 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
228 g.sg. pp = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
229 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
230
d488b72254fb bit-field done.
kono
parents:
diff changeset
231 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
232 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
233
d488b72254fb bit-field done.
kono
parents:
diff changeset
234 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
235 g.sg. v = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
236 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
237 g.sg. vsid = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
238 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
239 g.sg. h = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
240 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
241 g.sg. api = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
242 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
243 g.sg. rpn = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
244 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
245
d488b72254fb bit-field done.
kono
parents:
diff changeset
246 g.sg. r = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
247 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
248 g.sg. c = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
249 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
250 g.sg. w = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
251 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
252 g.sg. i = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
253 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
254 g.sg. m = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
255 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
256 g.sg. g = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
257 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
258 g.sg. pp = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
259 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
260
d488b72254fb bit-field done.
kono
parents:
diff changeset
261 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
262 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
263
d488b72254fb bit-field done.
kono
parents:
diff changeset
264 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
265 g.sg. v = 0x55;
d488b72254fb bit-field done.
kono
parents:
diff changeset
266 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
267 g.sg. vsid = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
268 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
269 g.sg. h = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
270 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
271 g.sg. api = 0x55;
d488b72254fb bit-field done.
kono
parents:
diff changeset
272 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
273 g.sg. rpn = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
274 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
275
d488b72254fb bit-field done.
kono
parents:
diff changeset
276 g.sg. r = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
277 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
278 g.sg. c = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
279 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
280 g.sg. w = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
281 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
282 g.sg. i = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
283 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
284 g.sg. m = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
285 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
286 g.sg. g = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
287 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
288 g.sg. pp = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
289 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
290
d488b72254fb bit-field done.
kono
parents:
diff changeset
291 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
292 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
293
d488b72254fb bit-field done.
kono
parents:
diff changeset
294 for(i=-0x100;i<0x100;i++) {
d488b72254fb bit-field done.
kono
parents:
diff changeset
295 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
296 g.sg. v = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
297 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
298 g.sg. vsid = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
299 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
300 g.sg. h = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
301 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
302 g.sg. api = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
303 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
304 g.sg. rpn = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
305 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
306
d488b72254fb bit-field done.
kono
parents:
diff changeset
307 g.sg. r = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
308 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
309 g.sg. c = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
310 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
311 g.sg. w = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
312 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
313 g.sg. i = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
314 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
315 g.sg. m = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
316 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
317 g.sg. g = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
318 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
319 g.sg. pp = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
320 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
321 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
322
d488b72254fb bit-field done.
kono
parents:
diff changeset
323 // printf("size of %d\n",sizeof(g.sg.pp)); no size of for bit-field
d488b72254fb bit-field done.
kono
parents:
diff changeset
324
d488b72254fb bit-field done.
kono
parents:
diff changeset
325 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
326
d488b72254fb bit-field done.
kono
parents:
diff changeset
327 // int :12 bit-field cannot be a return value;
d488b72254fb bit-field done.
kono
parents:
diff changeset
328 // main3( int a:8 ) bit-field cannot be an argument;
d488b72254fb bit-field done.
kono
parents:
diff changeset
329 main3( int a )
d488b72254fb bit-field done.
kono
parents:
diff changeset
330 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
331 // int b:9; // nor local variable
338
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
332 int b,i;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
333 i = 7;
336
d488b72254fb bit-field done.
kono
parents:
diff changeset
334
d488b72254fb bit-field done.
kono
parents:
diff changeset
335
338
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
336 b = g.pte.rpn = -333;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
337 printf("main3-0: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
338 b = g.pte.rpn--;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
339 printf("main3-1: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
340 b = g.pte.rpn++;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
341 printf("main3-2: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
342 b = --g.pte.rpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
343 printf("main3-3: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
344 b = ++g.pte.rpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
345 printf("main3-4: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
346 b = (g.pte.rpn += 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
347 printf("main3-5: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
348 b = (g.pte.rpn -= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
349 printf("main3-6: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
350 b = (g.pte.rpn *= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
351 printf("main3-7: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
352 b = (g.pte.rpn /= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
353 printf("main3-8: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
354 b = (g.pte.rpn %= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
355 printf("main3-9: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
356 b = (g.pte.rpn |= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
357 printf("main3-10: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
358 b = (g.pte.rpn &= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
359 printf("main3-12: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
360 b = (g.pte.rpn ^= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
361 printf("main3-13: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
362 b = (g.pte.rpn <<= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
363 printf("main3-14: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
364 b = (g.pte.rpn >>= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
365 printf("main3-15: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
366
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
367 g.pte.rpn = -333;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
368 printf("main3-16: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
369 b = g.pte.rpn--;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
370 printf("main3-17: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
371 b = g.pte.rpn++;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
372 printf("main3-18: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
373 b = --g.pte.rpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
374 printf("main3-19: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
375 b = ++g.pte.rpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
376 printf("main3-20: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
377 b = (g.pte.rpn += i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
378 printf("main3-21: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
379 b = (g.pte.rpn -= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
380 printf("main3-22: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
381 b = (g.pte.rpn *= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
382 printf("main3-23: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
383 b = (g.pte.rpn /= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
384 printf("main3-24: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
385 b = (g.pte.rpn %= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
386 printf("main3-25: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
387 b = (g.pte.rpn |= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
388 printf("main3-26: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
389 b = (g.pte.rpn &= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
390 printf("main3-27: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
391 b = (g.pte.rpn ^= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
392 printf("main3-28: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
393 b = (g.pte.rpn <<= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
394 printf("main3-29: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
395 b = (g.pte.rpn >>= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
396 printf("main3-30: %d\n",b);
336
d488b72254fb bit-field done.
kono
parents:
diff changeset
397
d488b72254fb bit-field done.
kono
parents:
diff changeset
398 return --b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
399 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
400
338
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
401 main4( int a )
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
402 {
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
403 // int b:9; // nor local variable
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
404 int b,i;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
405 PTE *pg = &g;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
406
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
407 i = 7;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
408
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
409
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
410 pg->pte.rpn = -333;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
411 printf("main4-0: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
412 b = pg->pte.rpn--;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
413 printf("main4-1: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
414 b = pg->pte.rpn++;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
415 printf("main4-2: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
416 b = --pg->pte.rpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
417 printf("main4-3: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
418 b = ++pg->pte.rpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
419 printf("main4-4: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
420 b = (pg->pte.rpn += 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
421 printf("main4-5: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
422 b = (pg->pte.rpn -= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
423 printf("main4-6: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
424 b = (pg->pte.rpn *= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
425 printf("main4-7: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
426 b = (pg->pte.rpn /= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
427 printf("main4-8: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
428 b = (pg->pte.rpn %= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
429 printf("main4-9: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
430 b = (pg->pte.rpn |= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
431 printf("main4-10: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
432 b = (pg->pte.rpn &= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
433 printf("main4-12: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
434 b = (pg->pte.rpn ^= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
435 printf("main4-13: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
436 b = (pg->pte.rpn <<= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
437 printf("main4-14: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
438 b = (pg->pte.rpn >>= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
439 printf("main4-15: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
440
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
441 pg->pte.rpn = -333;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
442 printf("main4-16: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
443 b = pg->pte.rpn--;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
444 printf("main4-17: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
445 b = pg->pte.rpn++;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
446 printf("main4-18: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
447 b = --pg->pte.rpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
448 printf("main4-19: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
449 b = ++pg->pte.rpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
450 printf("main4-20: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
451 b = (pg->pte.rpn += i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
452 printf("main4-21: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
453 b = (pg->pte.rpn -= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
454 printf("main4-22: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
455 b = (pg->pte.rpn *= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
456 printf("main4-23: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
457 b = (pg->pte.rpn /= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
458 printf("main4-24: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
459 b = (pg->pte.rpn %= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
460 printf("main4-25: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
461 b = (pg->pte.rpn |= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
462 printf("main4-26: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
463 b = (pg->pte.rpn &= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
464 printf("main4-27: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
465 b = (pg->pte.rpn ^= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
466 printf("main4-28: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
467 b = (pg->pte.rpn <<= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
468 printf("main4-29: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
469 b = (pg->pte.rpn >>= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
470 printf("main4-30: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
471
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
472 return --b;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
473 }
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
474
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
475
336
d488b72254fb bit-field done.
kono
parents:
diff changeset
476
d488b72254fb bit-field done.
kono
parents:
diff changeset
477
d488b72254fb bit-field done.
kono
parents:
diff changeset
478
d488b72254fb bit-field done.
kono
parents:
diff changeset
479 union ll1 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
480 int a[8];
d488b72254fb bit-field done.
kono
parents:
diff changeset
481 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
482 char a:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
483 long long v:33;
d488b72254fb bit-field done.
kono
parents:
diff changeset
484 long long w:33;
d488b72254fb bit-field done.
kono
parents:
diff changeset
485 long long x:33;
d488b72254fb bit-field done.
kono
parents:
diff changeset
486 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
487 } ll1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
488
d488b72254fb bit-field done.
kono
parents:
diff changeset
489 union ll0 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
490 int a[8];
d488b72254fb bit-field done.
kono
parents:
diff changeset
491 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
492 char a:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
493 long long v:48;
d488b72254fb bit-field done.
kono
parents:
diff changeset
494 long long w:48;
d488b72254fb bit-field done.
kono
parents:
diff changeset
495 long long x:48;
d488b72254fb bit-field done.
kono
parents:
diff changeset
496 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
497 } ll0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
498
d488b72254fb bit-field done.
kono
parents:
diff changeset
499
d488b72254fb bit-field done.
kono
parents:
diff changeset
500 union ll {
d488b72254fb bit-field done.
kono
parents:
diff changeset
501 int a[8];
d488b72254fb bit-field done.
kono
parents:
diff changeset
502 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
503 char a:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
504 long long v:56;
d488b72254fb bit-field done.
kono
parents:
diff changeset
505 long long w:56;
d488b72254fb bit-field done.
kono
parents:
diff changeset
506 long long x:56;
d488b72254fb bit-field done.
kono
parents:
diff changeset
507 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
508 } ll;
d488b72254fb bit-field done.
kono
parents:
diff changeset
509
d488b72254fb bit-field done.
kono
parents:
diff changeset
510 union cc {
d488b72254fb bit-field done.
kono
parents:
diff changeset
511 int a;
d488b72254fb bit-field done.
kono
parents:
diff changeset
512 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
513 char a:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
514 char b:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
515 char c:7;
d488b72254fb bit-field done.
kono
parents:
diff changeset
516 char d:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
517 char e:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
518 char f:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
519 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
520 } cc;
d488b72254fb bit-field done.
kono
parents:
diff changeset
521
d488b72254fb bit-field done.
kono
parents:
diff changeset
522 union ii {
d488b72254fb bit-field done.
kono
parents:
diff changeset
523 int a;
d488b72254fb bit-field done.
kono
parents:
diff changeset
524 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
525 int a:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
526 int b:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
527 int c:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
528 int d:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
529 int e:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
530 int f:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
531 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
532 } ii;
d488b72254fb bit-field done.
kono
parents:
diff changeset
533
d488b72254fb bit-field done.
kono
parents:
diff changeset
534 int m1 = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
535 int p1 = 1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
536 int zero = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
537
d488b72254fb bit-field done.
kono
parents:
diff changeset
538 main5()
d488b72254fb bit-field done.
kono
parents:
diff changeset
539 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
540 ii.b.a = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
541 printf("00:%d\n",ii.b.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
542
d488b72254fb bit-field done.
kono
parents:
diff changeset
543 ll1.b.v = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
544 printf("01:%llx\n",ll1.b.v);
d488b72254fb bit-field done.
kono
parents:
diff changeset
545 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
546 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
547 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
548 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
549 ll1.b.v = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
550 ll1.b.w = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
551 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
552 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
553 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
554 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
555 ll1.b.w = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
556 ll1.b.x = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
557 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
558 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
559 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
560 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
561
d488b72254fb bit-field done.
kono
parents:
diff changeset
562 ll0.b.v = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
563 printf("01:%llx\n",ll0.b.v);
d488b72254fb bit-field done.
kono
parents:
diff changeset
564 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
565 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
566 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
567 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
568 ll0.b.v = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
569 ll0.b.w = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
570 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
571 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
572 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
573 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
574 ll0.b.w = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
575 ll0.b.x = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
576 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
577 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
578 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
579 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
580
d488b72254fb bit-field done.
kono
parents:
diff changeset
581 ll.b.v = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
582 printf("1:%llx\n",ll.b.v);
d488b72254fb bit-field done.
kono
parents:
diff changeset
583 printf("2:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
584 ll.a[0],ll.a[1],ll.a[2],ll.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
585 ll.a[4],ll.a[5],ll.a[6],ll.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
586 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
587 ll.b.v = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
588 ll.b.w = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
589 printf("2:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
590 ll.a[0],ll.a[1],ll.a[2],ll.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
591 ll.a[4],ll.a[5],ll.a[6],ll.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
592 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
593 ll.b.w = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
594 ll.b.x = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
595 printf("2:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
596 ll.a[0],ll.a[1],ll.a[2],ll.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
597 ll.a[4],ll.a[5],ll.a[6],ll.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
598 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
599
d488b72254fb bit-field done.
kono
parents:
diff changeset
600 printf("char a:1; char b:4; char c:7; char d:4; char e:4; char f:4;\n");
d488b72254fb bit-field done.
kono
parents:
diff changeset
601 cc.b.a = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
602 printf("a:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
603 cc.b.b = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
604 printf("b:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
605 cc.b.c = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
606 printf("c:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
607 cc.b.d = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
608 printf("d:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
609 cc.b.e = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
610 printf("e:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
611 cc.b.f = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
612 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
613 printf("3:%d %d\n",cc.b.c,cc.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
614 cc.a = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
615 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
616 cc.b.a = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
617 printf("a:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
618 cc.b.b = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
619 printf("b:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
620 cc.b.c = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
621 printf("c:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
622 cc.b.d = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
623 printf("d:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
624 cc.b.e = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
625 printf("e:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
626 cc.b.f = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
627 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
628 printf("3:%d %d\n",cc.b.c,cc.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
629 cc.a = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
630 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
631 cc.b.a = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
632 printf("a:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
633 cc.b.b = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
634 printf("b:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
635 cc.b.c = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
636 printf("c:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
637 cc.b.d = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
638 printf("d:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
639 cc.b.e = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
640 printf("e:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
641 cc.b.f = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
642 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
643 printf("3:%d %d\n",cc.b.c,cc.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
644 cc.a = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
645 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
646 cc.b.a = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
647 printf("a:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
648 cc.b.b = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
649 printf("b:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
650 cc.b.c = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
651 printf("c:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
652 cc.b.d = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
653 printf("d:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
654 cc.b.e = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
655 printf("e:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
656 cc.b.f = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
657 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
658 printf("3:%d %d\n",cc.b.c,cc.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
659
d488b72254fb bit-field done.
kono
parents:
diff changeset
660 ii.b.a = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
661 printf("6:%08x\n",ii.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
662 ii.b.d = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
663 printf("6:%08x\n",ii.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
664 printf("5:%d %d\n",ii.b.a,ii.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
665 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
666
d488b72254fb bit-field done.
kono
parents:
diff changeset
667
338
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
668 main3l( int a )
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
669 {
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
670 // int b:9; // nor local variable
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
671 long long b,i;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
672 i = 7;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
673
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
674
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
675 g.pte.lpn = -333;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
676 printf("main3l-0: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
677 b = g.pte.lpn--;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
678 printf("main3l-1: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
679 b = g.pte.lpn++;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
680 printf("main3l-2: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
681 b = --g.pte.lpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
682 printf("main3l-3: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
683 b = ++g.pte.lpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
684 printf("main3l-4: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
685 b = (g.pte.lpn += 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
686 printf("main3l-5: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
687 b = (g.pte.lpn -= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
688 printf("main3l-6: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
689 b = (g.pte.lpn *= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
690 printf("main3l-7: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
691 b = (g.pte.lpn /= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
692 printf("main3l-8: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
693 b = (g.pte.lpn %= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
694 printf("main3l-9: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
695 b = (g.pte.lpn |= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
696 printf("main3l-10: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
697 b = (g.pte.lpn &= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
698 printf("main3l-12: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
699 b = (g.pte.lpn ^= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
700 printf("main3l-13: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
701 b = (g.pte.lpn <<= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
702 printf("main3l-14: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
703 b = (g.pte.lpn >>= 3);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
704 printf("main3l-15: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
705
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
706 g.pte.lpn = -333;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
707 printf("main3l-16: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
708 b = g.pte.lpn--;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
709 printf("main3l-17: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
710 b = g.pte.lpn++;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
711 printf("main3l-18: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
712 b = --g.pte.lpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
713 printf("main3l-19: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
714 b = ++g.pte.lpn;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
715 printf("main3l-20: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
716 b = (g.pte.lpn += i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
717 printf("main3l-21: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
718 b = (g.pte.lpn -= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
719 printf("main3l-22: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
720 b = (g.pte.lpn *= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
721 printf("main3l-23: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
722 b = (g.pte.lpn /= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
723 printf("main3l-24: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
724 b = (g.pte.lpn %= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
725 printf("main3l-25: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
726 b = (g.pte.lpn |= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
727 printf("main3l-26: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
728 b = (g.pte.lpn &= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
729 printf("main3l-27: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
730 b = (g.pte.lpn ^= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
731 printf("main3l-28: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
732 b = (g.pte.lpn <<= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
733 printf("main3l-29: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
734 b = (g.pte.lpn >>= i);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
735 printf("main3l-30: %d\n",b);
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
736
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
737 return --b;
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
738 }
7fe7ce0a791f bit-field done for IA32, PowerPC, MIPS.
kono
parents: 336
diff changeset
739