annotate test/bitfield.c @ 336:d488b72254fb

bit-field done.
author kono
date Fri, 25 Jun 2004 03:56:48 +0900
parents
children 7fe7ce0a791f
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;
d488b72254fb bit-field done.
kono
parents:
diff changeset
20 } pte;
d488b72254fb bit-field done.
kono
parents:
diff changeset
21 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
22 unsigned char v:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
23 signed long vsid:24;
d488b72254fb bit-field done.
kono
parents:
diff changeset
24 unsigned long h:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
25 signed char api:6;
d488b72254fb bit-field done.
kono
parents:
diff changeset
26 signed long rpn:20;
d488b72254fb bit-field done.
kono
parents:
diff changeset
27
d488b72254fb bit-field done.
kono
parents:
diff changeset
28 signed long :3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
29 unsigned long r:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
30 unsigned long c:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
31 unsigned long w:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
32 unsigned long i:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
33 unsigned long m:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
34 unsigned long g:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
35 unsigned long :1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
36 signed long pp:2;
d488b72254fb bit-field done.
kono
parents:
diff changeset
37 } sg;
d488b72254fb bit-field done.
kono
parents:
diff changeset
38 unsigned long u[2];
d488b72254fb bit-field done.
kono
parents:
diff changeset
39 } PTE;
d488b72254fb bit-field done.
kono
parents:
diff changeset
40
d488b72254fb bit-field done.
kono
parents:
diff changeset
41 PTE g;
d488b72254fb bit-field done.
kono
parents:
diff changeset
42
d488b72254fb bit-field done.
kono
parents:
diff changeset
43 main()
d488b72254fb bit-field done.
kono
parents:
diff changeset
44 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
45 PTE a,*p;
d488b72254fb bit-field done.
kono
parents:
diff changeset
46 int i = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
47 int j = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
48
d488b72254fb bit-field done.
kono
parents:
diff changeset
49 a.pte.rpn = 55;
d488b72254fb bit-field done.
kono
parents:
diff changeset
50 j = a.pte.rpn;
d488b72254fb bit-field done.
kono
parents:
diff changeset
51 printf("% 3d: %d\n",i++,j);
d488b72254fb bit-field done.
kono
parents:
diff changeset
52 a.pte.c = 1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
53 j = a.pte.c;
d488b72254fb bit-field done.
kono
parents:
diff changeset
54 printf("% 3d: %d\n",i++,j);
d488b72254fb bit-field done.
kono
parents:
diff changeset
55 a.pte.pp = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
56 j = a.pte.pp;
d488b72254fb bit-field done.
kono
parents:
diff changeset
57 printf("% 3d: %d\n",i++,j);
d488b72254fb bit-field done.
kono
parents:
diff changeset
58 a.sg.pp = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
59 j = a.sg.pp;
d488b72254fb bit-field done.
kono
parents:
diff changeset
60 printf("% 3d: %d\n",i++,j);
d488b72254fb bit-field done.
kono
parents:
diff changeset
61
d488b72254fb bit-field done.
kono
parents:
diff changeset
62 p = &g;
d488b72254fb bit-field done.
kono
parents:
diff changeset
63
d488b72254fb bit-field done.
kono
parents:
diff changeset
64 g.u[0]=0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
65 g.u[1]=0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
66
d488b72254fb bit-field done.
kono
parents:
diff changeset
67 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
68 g.pte. v = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
69 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
70 g.pte. vsid = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
71 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
72 g.pte. h = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
73 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
74 g.pte. api = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
75 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
76 g.pte. rpn = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
77 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
78
d488b72254fb bit-field done.
kono
parents:
diff changeset
79 g.pte. r = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
80 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
81 g.pte. c = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
82 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
83 g.pte. w = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
84 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
85 g.pte. i = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
86 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
87 g.pte. m = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
88 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
89 g.pte. g = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
90 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
91 g.pte. pp = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
92 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
93
d488b72254fb bit-field done.
kono
parents:
diff changeset
94 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
95 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
96
d488b72254fb bit-field done.
kono
parents:
diff changeset
97 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
98 g.pte. v = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
99 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
100 g.pte. vsid = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
101 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
102 g.pte. h = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
103 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
104 g.pte. api = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
105 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
106 g.pte. rpn = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
107 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
108
d488b72254fb bit-field done.
kono
parents:
diff changeset
109 g.pte. r = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
110 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
111 g.pte. c = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
112 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
113 g.pte. w = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
114 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
115 g.pte. i = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
116 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
117 g.pte. m = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
118 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
119 g.pte. g = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
120 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
121 g.pte. pp = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
122 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
123
d488b72254fb bit-field done.
kono
parents:
diff changeset
124 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
125 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
126
d488b72254fb bit-field done.
kono
parents:
diff changeset
127 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
128 g.pte. v = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
129 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
130 g.pte. vsid = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
131 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
132 g.pte. h = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
133 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
134 g.pte. api = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
135 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
136 g.pte. rpn = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
137 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
138
d488b72254fb bit-field done.
kono
parents:
diff changeset
139 g.pte. r = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
140 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
141 g.pte. c = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
142 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
143 g.pte. w = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
144 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
145 g.pte. i = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
146 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
147 g.pte. m = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
148 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
149 g.pte. g = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
150 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
151 g.pte. pp = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
152 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
153
d488b72254fb bit-field done.
kono
parents:
diff changeset
154 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
155 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
156
d488b72254fb bit-field done.
kono
parents:
diff changeset
157 for(i=0;i<0x200;i++) {
d488b72254fb bit-field done.
kono
parents:
diff changeset
158 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
159 g.pte. v = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
160 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
161 g.pte. vsid = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
162 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
163 g.pte. h = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
164 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
165 g.pte. api = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
166 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
167 g.pte. rpn = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
168 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
169
d488b72254fb bit-field done.
kono
parents:
diff changeset
170 g.pte. r = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
171 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
172 g.pte. c = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
173 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
174 g.pte. w = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
175 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
176 g.pte. i = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
177 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
178 g.pte. m = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
179 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
180 g.pte. g = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
181 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
182 g.pte. pp = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
183 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
184 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
185
d488b72254fb bit-field done.
kono
parents:
diff changeset
186 g = a;
d488b72254fb bit-field done.
kono
parents:
diff changeset
187
d488b72254fb bit-field done.
kono
parents:
diff changeset
188 printf("%d %d %d\n",a.pte.pp,g.pte.pp,p->pte.pp);
d488b72254fb bit-field done.
kono
parents:
diff changeset
189 main2();
d488b72254fb bit-field done.
kono
parents:
diff changeset
190 main5();
d488b72254fb bit-field done.
kono
parents:
diff changeset
191 return 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
192 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
193
d488b72254fb bit-field done.
kono
parents:
diff changeset
194 main2()
d488b72254fb bit-field done.
kono
parents:
diff changeset
195 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
196 int i = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
197
d488b72254fb bit-field done.
kono
parents:
diff changeset
198 g.u[0]=0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
199 g.u[1]=0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
200
d488b72254fb bit-field done.
kono
parents:
diff changeset
201 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
202 g.sg. v = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
203 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
204 g.sg. vsid = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
205 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
206 g.sg. h = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
207 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
208 g.sg. api = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
209 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
210 g.sg. rpn = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
211 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
212
d488b72254fb bit-field done.
kono
parents:
diff changeset
213 g.sg. r = 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 g.sg. c = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
216 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
217 g.sg. w = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
218 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
219 g.sg. i = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
220 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
221 g.sg. m = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
222 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
223 g.sg. g = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
224 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
225 g.sg. pp = 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
226 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
227
d488b72254fb bit-field done.
kono
parents:
diff changeset
228 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
229 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
230
d488b72254fb bit-field done.
kono
parents:
diff changeset
231 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
232 g.sg. v = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
233 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
234 g.sg. vsid = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
235 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
236 g.sg. h = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
237 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
238 g.sg. api = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
239 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
240 g.sg. rpn = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
241 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
242
d488b72254fb bit-field done.
kono
parents:
diff changeset
243 g.sg. r = 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 g.sg. c = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
246 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
247 g.sg. w = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
248 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
249 g.sg. i = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
250 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
251 g.sg. m = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
252 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
253 g.sg. g = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
254 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
255 g.sg. pp = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
256 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
257
d488b72254fb bit-field done.
kono
parents:
diff changeset
258 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
259 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
260
d488b72254fb bit-field done.
kono
parents:
diff changeset
261 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
262 g.sg. v = 0x55;
d488b72254fb bit-field done.
kono
parents:
diff changeset
263 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
264 g.sg. vsid = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
265 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
266 g.sg. h = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
267 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
268 g.sg. api = 0x55;
d488b72254fb bit-field done.
kono
parents:
diff changeset
269 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
270 g.sg. rpn = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
271 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
272
d488b72254fb bit-field done.
kono
parents:
diff changeset
273 g.sg. r = 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 g.sg. c = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
276 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
277 g.sg. w = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
278 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
279 g.sg. i = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
280 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
281 g.sg. m = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
282 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
283 g.sg. g = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
284 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
285 g.sg. pp = 0x5555555;
d488b72254fb bit-field done.
kono
parents:
diff changeset
286 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
287
d488b72254fb bit-field done.
kono
parents:
diff changeset
288 g.u[0]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
289 g.u[1]=-1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
290
d488b72254fb bit-field done.
kono
parents:
diff changeset
291 for(i=-0x100;i<0x100;i++) {
d488b72254fb bit-field done.
kono
parents:
diff changeset
292 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
293 g.sg. v = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
294 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
295 g.sg. vsid = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
296 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
297 g.sg. h = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
298 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
299 g.sg. api = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
300 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
301 g.sg. rpn = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
302 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
303
d488b72254fb bit-field done.
kono
parents:
diff changeset
304 g.sg. r = 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 g.sg. c = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
307 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
308 g.sg. w = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
309 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
310 g.sg. i = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
311 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
312 g.sg. m = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
313 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
314 g.sg. g = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
315 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
316 g.sg. pp = i;
d488b72254fb bit-field done.
kono
parents:
diff changeset
317 printf("% 3d: 0x%08x%08x\n",i++,g.u[0],g.u[1]);
d488b72254fb bit-field done.
kono
parents:
diff changeset
318 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
319
d488b72254fb bit-field done.
kono
parents:
diff changeset
320 // printf("size of %d\n",sizeof(g.sg.pp)); no size of for bit-field
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
d488b72254fb bit-field done.
kono
parents:
diff changeset
324 // int :12 bit-field cannot be a return value;
d488b72254fb bit-field done.
kono
parents:
diff changeset
325 // main3( int a:8 ) bit-field cannot be an argument;
d488b72254fb bit-field done.
kono
parents:
diff changeset
326 main3( int a )
d488b72254fb bit-field done.
kono
parents:
diff changeset
327 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
328 // int b:9; // nor local variable
d488b72254fb bit-field done.
kono
parents:
diff changeset
329 int b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
330
d488b72254fb bit-field done.
kono
parents:
diff changeset
331
d488b72254fb bit-field done.
kono
parents:
diff changeset
332 g.pte.rpn--;
d488b72254fb bit-field done.
kono
parents:
diff changeset
333 g.pte.rpn++;
d488b72254fb bit-field done.
kono
parents:
diff changeset
334 --g.pte.rpn;
d488b72254fb bit-field done.
kono
parents:
diff changeset
335 ++g.pte.rpn;
d488b72254fb bit-field done.
kono
parents:
diff changeset
336 g.pte.rpn += 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
337 g.pte.rpn -= 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
338 g.pte.rpn *= 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
339 g.pte.rpn /= 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
340 g.pte.rpn %= 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
341 g.pte.rpn |= 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
342 g.pte.rpn &= 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
343 g.pte.rpn ^= 3;
d488b72254fb bit-field done.
kono
parents:
diff changeset
344
d488b72254fb bit-field done.
kono
parents:
diff changeset
345 return --b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
346 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
347
d488b72254fb bit-field done.
kono
parents:
diff changeset
348
d488b72254fb bit-field done.
kono
parents:
diff changeset
349
d488b72254fb bit-field done.
kono
parents:
diff changeset
350
d488b72254fb bit-field done.
kono
parents:
diff changeset
351 union ll1 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
352 int a[8];
d488b72254fb bit-field done.
kono
parents:
diff changeset
353 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
354 char a:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
355 long long v:33;
d488b72254fb bit-field done.
kono
parents:
diff changeset
356 long long w:33;
d488b72254fb bit-field done.
kono
parents:
diff changeset
357 long long x:33;
d488b72254fb bit-field done.
kono
parents:
diff changeset
358 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
359 } ll1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
360
d488b72254fb bit-field done.
kono
parents:
diff changeset
361 union ll0 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
362 int a[8];
d488b72254fb bit-field done.
kono
parents:
diff changeset
363 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
364 char a:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
365 long long v:48;
d488b72254fb bit-field done.
kono
parents:
diff changeset
366 long long w:48;
d488b72254fb bit-field done.
kono
parents:
diff changeset
367 long long x:48;
d488b72254fb bit-field done.
kono
parents:
diff changeset
368 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
369 } ll0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
370
d488b72254fb bit-field done.
kono
parents:
diff changeset
371
d488b72254fb bit-field done.
kono
parents:
diff changeset
372 union ll {
d488b72254fb bit-field done.
kono
parents:
diff changeset
373 int a[8];
d488b72254fb bit-field done.
kono
parents:
diff changeset
374 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
375 char a:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
376 long long v:56;
d488b72254fb bit-field done.
kono
parents:
diff changeset
377 long long w:56;
d488b72254fb bit-field done.
kono
parents:
diff changeset
378 long long x:56;
d488b72254fb bit-field done.
kono
parents:
diff changeset
379 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
380 } ll;
d488b72254fb bit-field done.
kono
parents:
diff changeset
381
d488b72254fb bit-field done.
kono
parents:
diff changeset
382 union cc {
d488b72254fb bit-field done.
kono
parents:
diff changeset
383 int a;
d488b72254fb bit-field done.
kono
parents:
diff changeset
384 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
385 char a:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
386 char b:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
387 char c:7;
d488b72254fb bit-field done.
kono
parents:
diff changeset
388 char d:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
389 char e:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
390 char f:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
391 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
392 } cc;
d488b72254fb bit-field done.
kono
parents:
diff changeset
393
d488b72254fb bit-field done.
kono
parents:
diff changeset
394 union ii {
d488b72254fb bit-field done.
kono
parents:
diff changeset
395 int a;
d488b72254fb bit-field done.
kono
parents:
diff changeset
396 struct {
d488b72254fb bit-field done.
kono
parents:
diff changeset
397 int a:1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
398 int b:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
399 int c:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
400 int d:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
401 int e:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
402 int f:4;
d488b72254fb bit-field done.
kono
parents:
diff changeset
403 } b;
d488b72254fb bit-field done.
kono
parents:
diff changeset
404 } ii;
d488b72254fb bit-field done.
kono
parents:
diff changeset
405
d488b72254fb bit-field done.
kono
parents:
diff changeset
406 int m1 = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
407 int p1 = 1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
408 int zero = 0;
d488b72254fb bit-field done.
kono
parents:
diff changeset
409
d488b72254fb bit-field done.
kono
parents:
diff changeset
410 main5()
d488b72254fb bit-field done.
kono
parents:
diff changeset
411 {
d488b72254fb bit-field done.
kono
parents:
diff changeset
412 ii.b.a = -1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
413 printf("00:%d\n",ii.b.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
414
d488b72254fb bit-field done.
kono
parents:
diff changeset
415 ll1.b.v = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
416 printf("01:%llx\n",ll1.b.v);
d488b72254fb bit-field done.
kono
parents:
diff changeset
417 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
418 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
419 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
420 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
421 ll1.b.v = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
422 ll1.b.w = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
423 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
424 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
425 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
426 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
427 ll1.b.w = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
428 ll1.b.x = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
429 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
430 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
431 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
432 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
433
d488b72254fb bit-field done.
kono
parents:
diff changeset
434 ll0.b.v = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
435 printf("01:%llx\n",ll0.b.v);
d488b72254fb bit-field done.
kono
parents:
diff changeset
436 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
437 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
438 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
439 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
440 ll0.b.v = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
441 ll0.b.w = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
442 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
443 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
444 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
445 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
446 ll0.b.w = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
447 ll0.b.x = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
448 printf("02:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
449 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
450 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
451 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
452
d488b72254fb bit-field done.
kono
parents:
diff changeset
453 ll.b.v = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
454 printf("1:%llx\n",ll.b.v);
d488b72254fb bit-field done.
kono
parents:
diff changeset
455 printf("2:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
456 ll.a[0],ll.a[1],ll.a[2],ll.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
457 ll.a[4],ll.a[5],ll.a[6],ll.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
458 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
459 ll.b.v = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
460 ll.b.w = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
461 printf("2:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
462 ll.a[0],ll.a[1],ll.a[2],ll.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
463 ll.a[4],ll.a[5],ll.a[6],ll.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
464 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
465 ll.b.w = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
466 ll.b.x = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
467 printf("2:%08x %08x %08x %08x %08x %08x %08x %08x\n",
d488b72254fb bit-field done.
kono
parents:
diff changeset
468 ll.a[0],ll.a[1],ll.a[2],ll.a[3],
d488b72254fb bit-field done.
kono
parents:
diff changeset
469 ll.a[4],ll.a[5],ll.a[6],ll.a[7]
d488b72254fb bit-field done.
kono
parents:
diff changeset
470 );
d488b72254fb bit-field done.
kono
parents:
diff changeset
471
d488b72254fb bit-field done.
kono
parents:
diff changeset
472 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
473 cc.b.a = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
474 printf("a:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
475 cc.b.b = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
476 printf("b:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
477 cc.b.c = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
478 printf("c:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
479 cc.b.d = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
480 printf("d:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
481 cc.b.e = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
482 printf("e:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
483 cc.b.f = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
484 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
485 printf("3:%d %d\n",cc.b.c,cc.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
486 cc.a = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
487 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
488 cc.b.a = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
489 printf("a:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
490 cc.b.b = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
491 printf("b:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
492 cc.b.c = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
493 printf("c:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
494 cc.b.d = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
495 printf("d:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
496 cc.b.e = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
497 printf("e:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
498 cc.b.f = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
499 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
500 printf("3:%d %d\n",cc.b.c,cc.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
501 cc.a = zero;
d488b72254fb bit-field done.
kono
parents:
diff changeset
502 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
503 cc.b.a = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
504 printf("a:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
505 cc.b.b = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
506 printf("b:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
507 cc.b.c = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
508 printf("c:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
509 cc.b.d = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
510 printf("d:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
511 cc.b.e = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
512 printf("e:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
513 cc.b.f = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
514 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
515 printf("3:%d %d\n",cc.b.c,cc.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
516 cc.a = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
517 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
518 cc.b.a = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
519 printf("a:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
520 cc.b.b = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
521 printf("b:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
522 cc.b.c = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
523 printf("c:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
524 cc.b.d = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
525 printf("d:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
526 cc.b.e = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
527 printf("e:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
528 cc.b.f = p1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
529 printf("f:%08x\n",cc.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
530 printf("3:%d %d\n",cc.b.c,cc.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
531
d488b72254fb bit-field done.
kono
parents:
diff changeset
532 ii.b.a = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
533 printf("6:%08x\n",ii.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
534 ii.b.d = m1;
d488b72254fb bit-field done.
kono
parents:
diff changeset
535 printf("6:%08x\n",ii.a);
d488b72254fb bit-field done.
kono
parents:
diff changeset
536 printf("5:%d %d\n",ii.b.a,ii.b.d);
d488b72254fb bit-field done.
kono
parents:
diff changeset
537 }
d488b72254fb bit-field done.
kono
parents:
diff changeset
538
d488b72254fb bit-field done.
kono
parents:
diff changeset
539