| 1 |
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx10.2-256 -fclangir -emit-cir -o %t.cir -Wno-invalid-feature-combination -Wall -Werror -Wsign-conversion |
| 2 |
// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 3 |
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx10.2-256 -fclangir -emit-llvm -o %t.ll -Wno-invalid-feature-combination -Wall -Werror -Wsign-conversion |
| 4 |
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s |
| 5 |
|
| 6 |
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx10.2 -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=OGCG |
| 7 |
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx10.2 -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=OGCG |
| 8 |
|
| 9 |
#include <immintrin.h> |
| 10 |
|
| 11 |
__m128bh test_mm_undefined_pbh(void) { |
| 12 |
// CIR-LABEL: _mm_undefined_pbh |
| 13 |
// CIR: %[[A:.*]] = cir.const #cir.zero : !cir.vector<2 x !cir.double> |
| 14 |
// CIR: %{{.*}} = cir.cast bitcast %[[A]] : !cir.vector<2 x !cir.double> -> !cir.vector<8 x !cir.bf16> |
| 15 |
// CIR: cir.return %{{.*}} : !cir.vector<8 x !cir.bf16> |
| 16 |
|
| 17 |
// CIR-LABEL: cir.func {{.*}}test_mm_undefined_pbh |
| 18 |
// CIR: call @_mm_undefined_pbh |
| 19 |
|
| 20 |
// LLVM-LABEL: @test_mm_undefined_pbh |
| 21 |
// LLVM: store <8 x bfloat> zeroinitializer, ptr %[[A:.*]], align 16 |
| 22 |
// LLVM: %{{.*}} = load <8 x bfloat>, ptr %[[A]], align 16 |
| 23 |
// LLVM: ret <8 x bfloat> %{{.*}} |
| 24 |
|
| 25 |
// OGCG-LABEL: test_mm_undefined_pbh |
| 26 |
// OGCG: ret <8 x bfloat> zeroinitializer |
| 27 |
return _mm_undefined_pbh(); |
| 28 |
} |
| 29 |
|
| 30 |
__m256bh test_mm256_undefined_pbh(void) { |
| 31 |
// CIR-LABEL: _mm256_undefined_pbh |
| 32 |
// CIR: %[[A:.*]] = cir.const #cir.zero : !cir.vector<4 x !cir.double> |
| 33 |
// CIR: %{{.*}} = cir.cast bitcast %[[A]] : !cir.vector<4 x !cir.double> -> !cir.vector<16 x !cir.bf16> |
| 34 |
// CIR: cir.return %{{.*}} : !cir.vector<16 x !cir.bf16> |
| 35 |
|
| 36 |
// CIR-LABEL: cir.func {{.*}}test_mm256_undefined_pbh |
| 37 |
// CIR: call @_mm256_undefined_pbh |
| 38 |
|
| 39 |
// LLVM-LABEL: @test_mm256_undefined_pbh |
| 40 |
// LLVM: store <16 x bfloat> zeroinitializer, ptr %[[A:.*]], align 32 |
| 41 |
// LLVM: %{{.*}} = load <16 x bfloat>, ptr %[[A]], align 32 |
| 42 |
// LLVM: ret <16 x bfloat> %{{.*}} |
| 43 |
|
| 44 |
// OGCG-LABEL: test_mm256_undefined_pbh |
| 45 |
// OGCG: ret <16 x bfloat> zeroinitializer |
| 46 |
return _mm256_undefined_pbh(); |
| 47 |
} |