• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 %s -triple=x86_64-unknown-unknown -target-feature +sha -emit-llvm -o - | FileCheck %s
2 
3 // Don't include mm_malloc.h, it's system specific.
4 #define __MM_MALLOC_H
5 
6 #include <immintrin.h>
7 
test_sha1rnds4(__m128i a,__m128i b)8 __m128i test_sha1rnds4(__m128i a, __m128i b) {
9   // CHECK: call <4 x i32> @llvm.x86.sha1rnds4
10   return _mm_sha1rnds4_epu32(a, b, 3);
11 }
test_sha1nexte(__m128i a,__m128i b)12 __m128i test_sha1nexte(__m128i a, __m128i b) {
13   // CHECK: call <4 x i32> @llvm.x86.sha1nexte
14   return _mm_sha1nexte_epu32(a, b);
15 }
test_sha1msg1(__m128i a,__m128i b)16 __m128i test_sha1msg1(__m128i a, __m128i b) {
17   // CHECK: call <4 x i32> @llvm.x86.sha1msg1
18   return _mm_sha1msg1_epu32(a, b);
19 }
test_sha1msg2(__m128i a,__m128i b)20 __m128i test_sha1msg2(__m128i a, __m128i b) {
21   // CHECK: call <4 x i32> @llvm.x86.sha1msg2
22   return _mm_sha1msg2_epu32(a, b);
23 }
test_sha256rnds2(__m128i a,__m128i b,__m128i c)24 __m128i test_sha256rnds2(__m128i a, __m128i b, __m128i c) {
25   // CHECK: call <4 x i32> @llvm.x86.sha256rnds2
26   return _mm_sha256rnds2_epu32(a, b, c);
27 }
test_sha256msg1(__m128i a,__m128i b)28 __m128i test_sha256msg1(__m128i a, __m128i b) {
29   // CHECK: call <4 x i32> @llvm.x86.sha256msg1
30   return _mm_sha256msg1_epu32(a, b);
31 }
test_sha256msg2(__m128i a,__m128i b)32 __m128i test_sha256msg2(__m128i a, __m128i b) {
33   // CHECK: call <4 x i32> @llvm.x86.sha256msg2
34   return _mm_sha256msg2_epu32(a, b);
35 }
36