xref: /llvm-project/clang/test/CodeGen/X86/sm3-builtins.c (revision c6f66de21af060ead6e5402858351e9e869dc15f)
1 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -target-feature +sm3 -emit-llvm -o - -Wall -Werror | FileCheck %s
2 // RUN: %clang_cc1 %s -ffreestanding -triple=i386-unknown-unknown -target-feature +sm3 -emit-llvm -o - -Wall -Werror | FileCheck %s
3 
4 #include <immintrin.h>
5 
test_mm_sm3msg1_epi32(__m128i __A,__m128i __B,__m128i __C)6 __m128i test_mm_sm3msg1_epi32(__m128i __A, __m128i __B, __m128i __C) {
7   // CHECK-LABEL: @test_mm_sm3msg1_epi32(
8   // CHECK: call <4 x i32> @llvm.x86.vsm3msg1(<4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> %{{.*}})
9   return _mm_sm3msg1_epi32(__A, __B, __C);
10 }
11 
test_mm_sm3msg2_epi32(__m128i __A,__m128i __B,__m128i __C)12 __m128i test_mm_sm3msg2_epi32(__m128i __A, __m128i __B, __m128i __C) {
13   // CHECK-LABEL: @test_mm_sm3msg2_epi32(
14   // CHECK: call <4 x i32> @llvm.x86.vsm3msg2(<4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> %{{.*}})
15   return _mm_sm3msg2_epi32(__A, __B, __C);
16 }
17 
test_mm_sm3rnds2_epi32(__m128i __A,__m128i __B,__m128i __C)18 __m128i test_mm_sm3rnds2_epi32(__m128i __A, __m128i __B, __m128i __C) {
19   // CHECK-LABEL: @test_mm_sm3rnds2_epi32(
20   // CHECK: call <4 x i32> @llvm.x86.vsm3rnds2(<4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> %{{.*}}, i32 127)
21   return _mm_sm3rnds2_epi32(__A, __B, __C, 127);
22 }
23