11/*
22 *
3- * Copyright (c) 2001-2002,
3+ * Copyright (c) 2001-2002,
44 * George C. Necula <necula@cs.berkeley.edu>
55 * Scott McPeak <smcpeak@cs.berkeley.edu>
66 * Wes Weimer <weimer@cs.berkeley.edu>
77 * All rights reserved.
8- *
8+ *
99 * Redistribution and use in source and binary forms, with or without
1010 * modification, are permitted provided that the following conditions are
1111 * met:
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
9191{
9292 int env = argc == 2 && !strcmp(argv[1], "--env");
9393 int alignof_short, alignof_int, alignof_long, alignof_ptr, alignof_enum,
94- alignof_float, alignof_double, alignof_longdouble,
94+ alignof_float, alignof_float32x, alignof_float64x, alignof_double, alignof_longdouble,
9595 alignof_floatcomplex, alignof_doublecomplex, alignof_longdoublecomplex,
9696 sizeof_fun,
9797 alignof_fun, alignof_str, alignof_aligned, alignof_longlong,
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
114114 };
115115 alignof_int = (intptr_t)(&((struct intstruct*)0)->i);
116116 }
117-
117+
118118 // The alignment of a bool
119119 {
120120 struct boolstruct {
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
123123 };
124124 alignof_bool = (intptr_t)(&((struct boolstruct*)0)->b);
125125 }
126-
126+
127127 // The alignment of a long
128128 {
129129 struct longstruct {
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
132132 };
133133 alignof_long = (intptr_t)(&((struct longstruct*)0)->l);
134134 }
135-
135+
136136 // The alignment of long long
137137 {
138138 struct longlong {
@@ -145,7 +145,7 @@ int main(int argc, char **argv)
145145 // The alignment of a ptr
146146 {
147147 struct ptrstruct {
148- char c;
148+ char c;
149149 int * p;
150150 };
151151 alignof_ptr = (intptr_t)(&((struct ptrstruct*)0)->p);
@@ -154,12 +154,12 @@ int main(int argc, char **argv)
154154 // The alignment of an enum
155155 {
156156 struct enumstruct {
157- char c;
157+ char c;
158158 enum e2 { THREE, FOUR, FIVE } e;
159159 };
160160 alignof_enum = (intptr_t)(&((struct enumstruct*)0)->e);
161161 }
162-
162+
163163 // The alignment of a float
164164 {
165165 struct floatstruct {
@@ -168,15 +168,33 @@ int main(int argc, char **argv)
168168 };
169169 alignof_float = (intptr_t)(&((struct floatstruct*)0)->f);
170170 }
171-
171+
172+ // The alignment of a _Float32x
173+ {
174+ struct floatstruct {
175+ char c;
176+ _Float32x f;
177+ };
178+ alignof_float32x = (intptr_t)(&((struct floatstruct*)0)->f);
179+ }
180+
181+ // The alignment of a _Float64x
182+ {
183+ struct floatstruct {
184+ char c;
185+ _Float64x f;
186+ };
187+ alignof_float64x = (intptr_t)(&((struct floatstruct*)0)->f);
188+ }
189+
172190 // The alignment of double
173191 {
174192 struct s1 {
175193 char c;
176194 double d;
177195 };
178196 alignof_double = (intptr_t)(&((struct s1*)0)->d);
179- }
197+ }
180198
181199 // The alignment of long double
182200 {
@@ -185,8 +203,8 @@ int main(int argc, char **argv)
185203 long double ld;
186204 };
187205 alignof_longdouble = (intptr_t)(&((struct s1*)0)->ld);
188- }
189-
206+ }
207+
190208 // The alignment of a float complex
191209 {
192210 struct floatstruct {
@@ -250,21 +268,24 @@ int main(int argc, char **argv)
250268 {
251269 fprintf(stderr, "Generating CIL_MACHINE machine dependency information string (for CIL)\n");
252270 printf("short=%d,%d int=%d,%d long=%d,%d long_long=%d,%d pointer=%d,%d "
253- "alignof_enum=%d float=%d,%d double=%d,%d long_double=%d,%d float_complex=%d,%d double_complex=%d,%d long_double_complex=%d,%d void=%d "
271+ "alignof_enum=%d float=%d,%d float32x=%d,%d float64x=%d,%d double=%d,%d long_double=%d,%d float_complex=%d,%d double_complex=%d,%d long_double_complex=%d,%d void=%d "
254272 "bool=%d,%d fun=%d,%d alignof_string=%d max_alignment=%d size_t=%s "
255273 "wchar_t=%s char_signed=%s "
256274 "big_endian=%s __thread_is_keyword=%s __builtin_va_list=%s "
257275 "underscore_name=%s\n",
258276 (int)sizeof(short), alignof_short, (int)sizeof(int), alignof_int,
259- (int)sizeof(long), alignof_long, (int)sizeof(long long), alignof_longlong,
260- (int)sizeof(int *), alignof_ptr, alignof_enum,
261- (int)sizeof(float), alignof_float, (int)sizeof(double), alignof_double,
277+ (int)sizeof(long), alignof_long, (int)sizeof(long long), alignof_longlong,
278+ (int)sizeof(int *), alignof_ptr,
279+ alignof_enum,
280+ (int)sizeof(_Float32x), alignof_float32x,
281+ (int)sizeof(_Float64x), alignof_float64x,
282+ (int)sizeof(float), alignof_float, (int)sizeof(double), alignof_double,
262283 (int)sizeof(long double), alignof_longdouble, (int)sizeof(float _Complex), alignof_floatcomplex, (int)sizeof(double _Complex), alignof_doublecomplex,
263284 (int)sizeof(long double _Complex), alignof_longdoublecomplex, (int)sizeof(void),
264285 (int)sizeof(bool), alignof_bool,
265- sizeof_fun, alignof_fun, alignof_str, alignof_aligned,
266- underscore(TYPE_SIZE_T), underscore(TYPE_WCHAR_T),
267- char_is_unsigned ? "false" : "true",
286+ sizeof_fun, alignof_fun, alignof_str, alignof_aligned,
287+ underscore(TYPE_SIZE_T), underscore(TYPE_WCHAR_T),
288+ char_is_unsigned ? "false" : "true",
268289 little_endian ? "false" : "true",
269290 THREAD_IS_KEYWORD, HAVE_BUILTIN_VA_LIST, UNDERSCORE_NAME);
270291 }
@@ -285,6 +306,8 @@ int main(int argc, char **argv)
285306 printf("\t sizeof_longlong = %d;\n", (int)sizeof(LONGLONG));
286307 printf("\t sizeof_ptr = %d;\n", (int)sizeof(int *));
287308 printf("\t sizeof_float = %d;\n", (int)sizeof(float));
309+ printf("\t sizeof_float32x = %d;\n", (int)sizeof(_Float32x));
310+ printf("\t sizeof_float64x = %d;\n", (int)sizeof(_Float64x));
288311 printf("\t sizeof_double = %d;\n", (int)sizeof(double));
289312 printf("\t sizeof_longdouble = %d;\n", (int)sizeof(long double));
290313 printf("\t sizeof_floatcomplex = %d;\n", (int)sizeof(float _Complex));
@@ -302,6 +325,8 @@ int main(int argc, char **argv)
302325 printf("\t alignof_ptr = %d;\n", alignof_ptr);
303326 printf("\t alignof_enum = %d;\n", alignof_enum);
304327 printf("\t alignof_float = %d;\n", alignof_float);
328+ printf("\t alignof_float32x = %d;\n", alignof_float32x);
329+ printf("\t alignof_float64x = %d;\n", alignof_float64x);
305330 printf("\t alignof_double = %d;\n", alignof_double);
306331 printf("\t alignof_longdouble = %d;\n", alignof_longdouble);
307332 printf("\t alignof_floatcomplex = %d;\n", alignof_floatcomplex);
@@ -317,4 +342,4 @@ int main(int argc, char **argv)
317342 printf("\t little_endian = %s;\n", little_endian ? "true" : "false");
318343 }
319344 return 0;
320- }
345+ }
0 commit comments