brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.5 KiB · 82fa435 Raw
76 lines · c
1// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -fclangir -emit-cir -o %t.cir -Wall -Werror2// RUN: FileCheck --check-prefixes=CIR --input-file=%t.cir %s3// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -fno-signed-char -fclangir -emit-cir -o %t.cir -Wall -Werror4// RUN: FileCheck --check-prefixes=CIR --input-file=%t.cir %s5 6// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -fclangir -emit-llvm -o %t.ll -Wall -Werror7// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s8// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -fno-signed-char -fclangir -emit-llvm -o %t.ll -Wall -Werror9// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s10 11// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -fclangir -emit-cir -o %t.cir -Wall -Werror12// RUN: FileCheck --check-prefixes=CIR --input-file=%t.cir %s13// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -fno-signed-char -fclangir -emit-cir -o %t.cir -Wall -Werror14// RUN: FileCheck --check-prefixes=CIR --input-file=%t.cir %s15 16// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -fclangir -emit-llvm -o %t.ll -Wall -Werror17// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s18// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx -fno-signed-char -fclangir -emit-llvm -o %t.ll -Wall -Werror19// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s20 21// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG22// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG23// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG24// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG25 26// This test mimics clang/test/CodeGen/X86/avx-builtins.c, which eventually27// CIR shall be able to support fully.28 29#include <immintrin.h>30 31__m256 test_mm256_undefined_ps(void) {32  // CIR-LABEL: _mm256_undefined_ps33  // CIR: %[[A:.*]] = cir.const #cir.zero : !cir.vector<4 x !cir.double>34  // CIR: %{{.*}} = cir.cast bitcast %[[A]] : !cir.vector<4 x !cir.double> -> !cir.vector<8 x !cir.float>35  // CIR: cir.return %{{.*}} : !cir.vector<8 x !cir.float>36 37  // LLVM-LABEL: test_mm256_undefined_ps38  // LLVM: store <8 x float> zeroinitializer, ptr %[[A:.*]], align 3239  // LLVM: %{{.*}} = load <8 x float>, ptr %[[A]], align 3240  // LLVM: ret <8 x float> %{{.*}}41 42  // OGCG-LABEL: test_mm256_undefined_ps43  // OGCG: ret <8 x float> zeroinitializer44  return _mm256_undefined_ps();45}46 47__m256d test_mm256_undefined_pd(void) {48  // CIR-LABEL: _mm256_undefined_pd49  // CIR: %{{.*}} = cir.const #cir.zero : !cir.vector<4 x !cir.double>50  // CIR: cir.return %{{.*}} : !cir.vector<4 x !cir.double>51 52  // LLVM-LABEL: test_mm256_undefined_pd53  // LLVM: store <4 x double> zeroinitializer, ptr %[[A:.*]], align 3254  // LLVM: %{{.*}} = load <4 x double>, ptr %[[A]], align 3255  // LLVM: ret <4 x double> %{{.*}}56 57  // OGCG-LABEL: test_mm256_undefined_pd58  // OGCG: ret <4 x double> zeroinitializer59  return _mm256_undefined_pd();60}61 62__m256i test_mm256_undefined_si256(void) {63  // CIR-LABEL: _mm256_undefined_si25664  // CIR: %[[A:.*]] = cir.const #cir.zero : !cir.vector<4 x !cir.double>65  // CIR: %{{.*}} = cir.cast bitcast %[[A]] : !cir.vector<4 x !cir.double> -> !cir.vector<4 x !s64i>66  // CIR: cir.return %{{.*}} : !cir.vector<4 x !s64i>67 68  // LLVM-LABEL: test_mm256_undefined_si25669  // LLVM: store <4 x i64> zeroinitializer, ptr %[[A:.*]], align 3270  // LLVM: %{{.*}} = load <4 x i64>, ptr %[[A]], align 3271  // LLVM: ret <4 x i64> %{{.*}}72 73  // OGCG-LABEL: test_mm256_undefined_si25674  // OGCG: ret <4 x i64> zeroinitializer75  return _mm256_undefined_si256();76}