File: attr-mode-vector-types.c

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 995,836 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (41 lines) | stat: -rw-r--r-- 1,241 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s

typedef int __attribute__((mode(byte))) __attribute__((vector_size(4))) vec_t1;
typedef int __attribute__((mode(QI))) __attribute__((vector_size(8))) vec_t2;
typedef int __attribute__((mode(SI))) __attribute__((vector_size(16))) vec_t3;
typedef int __attribute__((mode(DI))) __attribute__((vector_size(64)))vec_t4;
typedef float __attribute__((mode(SF))) __attribute__((vector_size(128))) vec_t5;
typedef float __attribute__((mode(DF))) __attribute__((vector_size(256))) vec_t6;

void check() {
  // CHECK: alloca <4 x i8>
  vec_t1 v1;
  // CHECK: alloca <8 x i8>
  vec_t2 v2;
  // CHECK: alloca <4 x i32>
  vec_t3 v3;
  // CHECK: alloca <8 x i64>
  vec_t4 v4;
  // CHECK: alloca <32 x float>
  vec_t5 v5;
  // CHECK: alloca <32 x double>
  vec_t6 v6;
}

// CHECK: ret i32 4
int check_size1() { return sizeof(vec_t1); }

// CHECK: ret i32 8
int check_size2() { return sizeof(vec_t2); }

// CHECK: ret i32 16
int check_size3() { return sizeof(vec_t3); }

// CHECK: ret i32 64
int check_size4() { return sizeof(vec_t4); }

// CHECK: ret i32 128
int check_size5() { return sizeof(vec_t5); }

// CHECK: ret i32 256
int check_size6() { return sizeof(vec_t6); }