Home | History | Annotate | Download | only in CodeGen
      1 // REQUIRES: aarch64-registered-target
      2 // RUN: %clang_cc1 -triple arm64-none-linux-gnu \
      3 // RUN:   -O3 -S -emit-llvm -o - %s | FileCheck %s
      4 
      5 int crc32b(int a, char b)
      6 {
      7         return __builtin_arm_crc32b(a,b);
      8 // CHECK: [[T0:%[0-9]+]] = zext i8 %b to i32
      9 // CHECK: call i32 @llvm.aarch64.crc32b(i32 %a, i32 [[T0]])
     10 }
     11 
     12 int crc32cb(int a, char b)
     13 {
     14         return __builtin_arm_crc32cb(a,b);
     15 // CHECK: [[T0:%[0-9]+]] = zext i8 %b to i32
     16 // CHECK: call i32 @llvm.aarch64.crc32cb(i32 %a, i32 [[T0]])
     17 }
     18 
     19 int crc32h(int a, short b)
     20 {
     21         return __builtin_arm_crc32h(a,b);
     22 // CHECK: [[T0:%[0-9]+]] = zext i16 %b to i32
     23 // CHECK: call i32 @llvm.aarch64.crc32h(i32 %a, i32 [[T0]])
     24 }
     25 
     26 int crc32ch(int a, short b)
     27 {
     28         return __builtin_arm_crc32ch(a,b);
     29 // CHECK: [[T0:%[0-9]+]] = zext i16 %b to i32
     30 // CHECK: call i32 @llvm.aarch64.crc32ch(i32 %a, i32 [[T0]])
     31 }
     32 
     33 int crc32w(int a, int b)
     34 {
     35         return __builtin_arm_crc32w(a,b);
     36 // CHECK: call i32 @llvm.aarch64.crc32w(i32 %a, i32 %b)
     37 }
     38 
     39 int crc32cw(int a, int b)
     40 {
     41         return __builtin_arm_crc32cw(a,b);
     42 // CHECK: call i32 @llvm.aarch64.crc32cw(i32 %a, i32 %b)
     43 }
     44 
     45 int crc32d(int a, long b)
     46 {
     47         return __builtin_arm_crc32d(a,b);
     48 // CHECK: call i32 @llvm.aarch64.crc32x(i32 %a, i64 %b)
     49 }
     50 
     51 int crc32cd(int a, long b)
     52 {
     53         return __builtin_arm_crc32cd(a,b);
     54 // CHECK: call i32 @llvm.aarch64.crc32cx(i32 %a, i64 %b)
     55 }
     56