llvm-project/clang/test/Frontend/fixed_point_bit_widths.c

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

197 lines
7.9 KiB
C
Raw Normal View History

// RUN: %clang -x c -ffixed-point -S -emit-llvm -o - %s | FileCheck %s
// RUN: %clang -x c -ffixed-point -S -emit-llvm -o - --target=x86_64-scei-ps4-ubuntu-fast %s | FileCheck %s
// RUN: %clang -x c -ffixed-point -S -emit-llvm -o - --target=ppc64 %s | FileCheck %s
// RUN: %clang -x c -ffixed-point -S -emit-llvm -o - --target=x86_64-scei-ps4-windows10pro-fast %s | FileCheck %s
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
2018-06-14 22:53:51 +08:00
/* Primary signed _Accum */
int size_SsA = sizeof(signed short _Accum);
int size_SA = sizeof(signed _Accum);
int size_SlA = sizeof(signed long _Accum);
int align_SsA = __alignof(signed short _Accum);
int align_SA = __alignof(signed _Accum);
int align_SlA = __alignof(signed long _Accum);
// CHECK: @size_SsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_SA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @size_SlA = {{.*}}global i{{[0-9]+}} 8
// CHECK-NEXT: @align_SsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_SA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_SlA = {{.*}}global i{{[0-9]+}} 8
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
2018-06-14 22:53:51 +08:00
/* Primary unsigned _Accum */
int size_UsA = sizeof(unsigned short _Accum);
int size_UA = sizeof(unsigned _Accum);
int size_UlA = sizeof(unsigned long _Accum);
int align_UsA = __alignof(unsigned short _Accum);
int align_UA = __alignof(unsigned _Accum);
int align_UlA = __alignof(unsigned long _Accum);
// CHECK-NEXT: @size_UsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_UA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @size_UlA = {{.*}}global i{{[0-9]+}} 8
// CHECK-NEXT: @align_UsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_UA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_UlA = {{.*}}global i{{[0-9]+}} 8
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
2018-06-14 22:53:51 +08:00
/* Primary signed _Fract */
int size_SsF = sizeof(signed short _Fract);
int size_SF = sizeof(signed _Fract);
int size_SlF = sizeof(signed long _Fract);
int align_SsF = __alignof(signed short _Fract);
int align_SF = __alignof(signed _Fract);
int align_SlF = __alignof(signed long _Fract);
// CHECK-NEXT: @size_SsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @size_SF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_SlF = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_SsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @align_SF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_SlF = {{.*}}global i{{[0-9]+}} 4
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
2018-06-14 22:53:51 +08:00
/* Primary unsigned _Fract */
int size_UsF = sizeof(unsigned short _Fract);
int size_UF = sizeof(unsigned _Fract);
int size_UlF = sizeof(unsigned long _Fract);
int align_UsF = __alignof(unsigned short _Fract);
int align_UF = __alignof(unsigned _Fract);
int align_UlF = __alignof(unsigned long _Fract);
// CHECK-NEXT: @size_UsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @size_UF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_UlF = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_UsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @align_UF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_UlF = {{.*}}global i{{[0-9]+}} 4
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
2018-06-14 22:53:51 +08:00
/* Aliased _Accum */
int size_sA = sizeof(short _Accum);
int size_A = sizeof(_Accum);
int size_lA = sizeof(long _Accum);
int align_sA = __alignof(short _Accum);
int align_A = __alignof(_Accum);
int align_lA = __alignof(long _Accum);
// CHECK-NEXT: @size_sA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_A = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @size_lA = {{.*}}global i{{[0-9]+}} 8
// CHECK-NEXT: @align_sA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_A = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_lA = {{.*}}global i{{[0-9]+}} 8
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
2018-06-14 22:53:51 +08:00
/* Aliased _Fract */
int size_sF = sizeof(short _Fract);
int size_F = sizeof(_Fract);
int size_lF = sizeof(long _Fract);
int align_sF = __alignof(short _Fract);
int align_F = __alignof(_Fract);
int align_lF = __alignof(long _Fract);
// CHECK-NEXT: @size_sF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @size_F = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_lF = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_sF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @align_F = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_lF = {{.*}}global i{{[0-9]+}} 4
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
2018-06-14 22:53:51 +08:00
/* Saturated signed _Accum */
int size_SatSsA = sizeof(_Sat signed short _Accum);
int size_SatSA = sizeof(_Sat signed _Accum);
int size_SatSlA = sizeof(_Sat signed long _Accum);
int align_SatSsA = __alignof(_Sat signed short _Accum);
int align_SatSA = __alignof(_Sat signed _Accum);
int align_SatSlA = __alignof(_Sat signed long _Accum);
// CHECK: @size_SatSsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_SatSA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @size_SatSlA = {{.*}}global i{{[0-9]+}} 8
// CHECK-NEXT: @align_SatSsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_SatSA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_SatSlA = {{.*}}global i{{[0-9]+}} 8
/* Saturated unsigned _Accum */
int size_SatUsA = sizeof(_Sat unsigned short _Accum);
int size_SatUA = sizeof(_Sat unsigned _Accum);
int size_SatUlA = sizeof(_Sat unsigned long _Accum);
int align_SatUsA = __alignof(_Sat unsigned short _Accum);
int align_SatUA = __alignof(_Sat unsigned _Accum);
int align_SatUlA = __alignof(_Sat unsigned long _Accum);
// CHECK-NEXT: @size_SatUsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_SatUA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @size_SatUlA = {{.*}}global i{{[0-9]+}} 8
// CHECK-NEXT: @align_SatUsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_SatUA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_SatUlA = {{.*}}global i{{[0-9]+}} 8
/* Saturated signed _Fract */
int size_SatSsF = sizeof(_Sat signed short _Fract);
int size_SatSF = sizeof(_Sat signed _Fract);
int size_SatSlF = sizeof(_Sat signed long _Fract);
int align_SatSsF = __alignof(_Sat signed short _Fract);
int align_SatSF = __alignof(_Sat signed _Fract);
int align_SatSlF = __alignof(_Sat signed long _Fract);
// CHECK-NEXT: @size_SatSsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @size_SatSF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_SatSlF = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_SatSsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @align_SatSF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_SatSlF = {{.*}}global i{{[0-9]+}} 4
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
2018-06-14 22:53:51 +08:00
/* Saturated unsigned _Fract */
int size_SatUsF = sizeof(_Sat unsigned short _Fract);
int size_SatUF = sizeof(_Sat unsigned _Fract);
int size_SatUlF = sizeof(_Sat unsigned long _Fract);
int align_SatUsF = __alignof(_Sat unsigned short _Fract);
int align_SatUF = __alignof(_Sat unsigned _Fract);
int align_SatUlF = __alignof(_Sat unsigned long _Fract);
// CHECK-NEXT: @size_SatUsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @size_SatUF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_SatUlF = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_SatUsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @align_SatUF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_SatUlF = {{.*}}global i{{[0-9]+}} 4
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
2018-06-14 22:53:51 +08:00
/* Aliased saturated signed _Accum */
int size_SatsA = sizeof(_Sat short _Accum);
int size_SatA = sizeof(_Sat _Accum);
int size_SatlA = sizeof(_Sat long _Accum);
int align_SatsA = __alignof(_Sat short _Accum);
int align_SatA = __alignof(_Sat _Accum);
int align_SatlA = __alignof(_Sat long _Accum);
// CHECK-NEXT: @size_SatsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_SatA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @size_SatlA = {{.*}}global i{{[0-9]+}} 8
// CHECK-NEXT: @align_SatsA = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_SatA = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_SatlA = {{.*}}global i{{[0-9]+}} 8
/* Aliased saturated _Fract */
int size_SatsF = sizeof(_Sat short _Fract);
int size_SatF = sizeof(_Sat _Fract);
int size_SatlF = sizeof(_Sat long _Fract);
int align_SatsF = __alignof(_Sat short _Fract);
int align_SatF = __alignof(_Sat _Fract);
int align_SatlF = __alignof(_Sat long _Fract);
// CHECK-NEXT: @size_SatsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @size_SatF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @size_SatlF = {{.*}}global i{{[0-9]+}} 4
// CHECK-NEXT: @align_SatsF = {{.*}}global i{{[0-9]+}} 1
// CHECK-NEXT: @align_SatF = {{.*}}global i{{[0-9]+}} 2
// CHECK-NEXT: @align_SatlF = {{.*}}global i{{[0-9]+}} 4