Debian Codegraph @

clang/test/CodeGen/PowerPC/builtins-bcd-transform.c

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2 // Testfile that verifies positive cases (0 or 1 only) for BCD builtins national2packed, packed2zoned and zoned2packed.
3 // REQUIRES: powerpc-registered-target
4 // RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -O2 -target-cpu pwr9 \
5 // RUN: -emit-llvm %s -o - | FileCheck %s
6 // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -O2 -target-cpu pwr9 \
7 // RUN: -emit-llvm %s -o - | FileCheck %s
8 // RUN: %clang_cc1 -triple powerpc-unknown-unknown -O2 -target-cpu pwr9 \
9 // RUN: -emit-llvm %s -o - | FileCheck %s
10
11 // CHECK-LABEL: define dso_local <16 x i8> @tBcd_National2packed_imm1(
12 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
13 // CHECK-NEXT: [[ENTRY:.*:]]
14 // CHECK-NEXT: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.national2packed(<16 x i8> [[A]], i32 1)
15 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
16 //
17 vector unsigned char tBcd_National2packed_imm1(vector unsigned char a) {
18 return __builtin_ppc_national2packed (a,'\1');
19 }
20
21 // CHECK-LABEL: define dso_local <16 x i8> @tBcd_National2packed_imm0(
22 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
23 // CHECK-NEXT: [[ENTRY:.*:]]
24 // CHECK-NEXT: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.national2packed(<16 x i8> [[A]], i32 0)
25 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
26 //
27 vector unsigned char tBcd_National2packed_imm0(vector unsigned char a) {
28 return __builtin_ppc_national2packed (a,'\0');
29 }
30
31 // CHECK-LABEL: define dso_local <16 x i8> @tBcd_Packed2national(
32 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
33 // CHECK-NEXT: [[ENTRY:.*:]]
34 // CHECK-NEXT: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.packed2national(<16 x i8> [[A]])
35 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
36 //
37 vector unsigned char tBcd_Packed2national(vector unsigned char a){
38 return __builtin_ppc_packed2national(a);
39 }
40
41 // CHECK-LABEL: define dso_local <16 x i8> @tBcd_Packed2zoned_imm0(
42 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
43 // CHECK-NEXT: [[ENTRY:.*:]]
44 // CHECK-NEXT: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.packed2zoned(<16 x i8> [[A]], i32 0)
45 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
46 //
47 vector unsigned char tBcd_Packed2zoned_imm0(vector unsigned char a){
48 return __builtin_ppc_packed2zoned(a,'\0');
49 }
50
51 // CHECK-LABEL: define dso_local <16 x i8> @tBcd_Packed2zoned_imm1(
52 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
53 // CHECK-NEXT: [[ENTRY:.*:]]
54 // CHECK-NEXT: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.packed2zoned(<16 x i8> [[A]], i32 1)
55 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
56 //
57 vector unsigned char tBcd_Packed2zoned_imm1(vector unsigned char a){
58 return __builtin_ppc_packed2zoned(a,'\1');
59 }
60
61 // CHECK-LABEL: define dso_local <16 x i8> @tBcd_Zoned2packed_imm0(
62 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
63 // CHECK-NEXT: [[ENTRY:.*:]]
64 // CHECK-NEXT: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.zoned2packed(<16 x i8> [[A]], i32 0)
65 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
66 //
67 vector unsigned char tBcd_Zoned2packed_imm0(vector unsigned char a){
68 return __builtin_ppc_zoned2packed(a,'\0');
69 }
70
71 // CHECK-LABEL: define dso_local <16 x i8> @tBcd_Zoned2packed_imm1(
72 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR0]] {
73 // CHECK-NEXT: [[ENTRY:.*:]]
74 // CHECK-NEXT: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.zoned2packed(<16 x i8> [[A]], i32 1)
75 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
76 //
77 vector unsigned char tBcd_Zoned2packed_imm1(vector unsigned char a){
78 return __builtin_ppc_zoned2packed(a,'\1');
79 }