File: builtins-ppc-xlcompat-test.c

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (73 lines) | stat: -rw-r--r-- 4,713 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm %s \
// RUN:   -target-cpu pwr9 -o - | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm %s \
// RUN:   -target-cpu pwr9 -o - | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm %s \
// RUN:   -target-cpu pwr9 -o - | FileCheck %s
// RUN: %clang_cc1 -triple powerpc-unknown-aix %s -emit-llvm %s \
// RUN:   -target-cpu pwr9 -o - | FileCheck %s
// RUN: not %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm-only %s \
// RUN:   -target-cpu pwr8 2>&1 | FileCheck %s --check-prefix=CHECK-NONPWR9-ERR
// RUN: not %clang_cc1 -target-feature -vsx -target-cpu pwr9 \
// RUN:   -triple powerpc64-unknown-linux-gnu -emit-llvm-only %s 2>&1 \
// RUN:   | FileCheck %s --check-prefix=CHECK-NOVSX-ERR

extern double d;
extern float f;

int test_builtin_ppc_test() {
// CHECK-LABEL: @test_builtin_ppc_test
// CHECK: call i32 @llvm.ppc.compare.exp.uo(double %0, double %1)
// CHECK: call i32 @llvm.ppc.compare.exp.lt(double %3, double %4)
// CHECK: call i32 @llvm.ppc.compare.exp.gt(double %6, double %7)
// CHECK: call i32 @llvm.ppc.compare.exp.eq(double %9, double %10)
// CHECK: call i32 @llvm.ppc.test.data.class.f64(double %12, i32 0)
// CHECK: call i32 @llvm.ppc.test.data.class.f32(float %13, i32 0)
// CHECK: call i32 @llvm.ppc.compare.exp.uo(double %14, double %15)
// CHECK: call i32 @llvm.ppc.compare.exp.lt(double %17, double %18)
// CHECK: call i32 @llvm.ppc.compare.exp.gt(double %20, double %21)
// CHECK: call i32 @llvm.ppc.compare.exp.eq(double %23, double %24)
// CHECK: call i32 @llvm.ppc.test.data.class.f64(double %26, i32 127)
// CHECK: call i32 @llvm.ppc.test.data.class.f32(float %27, i32 127)

// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions

// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
  int i;
  i = __builtin_ppc_compare_exp_uo(d, d);
  i = __builtin_ppc_compare_exp_lt(d, d);
  i = __builtin_ppc_compare_exp_gt(d, d);
  i = __builtin_ppc_compare_exp_eq(d, d);
  i = __builtin_ppc_test_data_class(d, 0);
  i = __builtin_ppc_test_data_class(f, 0);
  i = __compare_exp_uo(d, d);
  i = __compare_exp_lt(d, d);
  i = __compare_exp_gt(d, d);
  i = __compare_exp_eq(d, d);
  i = __test_data_class(d, 127);
  i = __test_data_class(f, 127);
  return i;
}