Home | History | Annotate | Download | only in CodeGen
      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 
      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 }
     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 }
     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 }
     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 }
     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 }
     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 }
     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