1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-unknown \
3 ; RUN: --ppc-asm-full-reg-names -mcpu=pwr7 < %s | FileCheck %s
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \
5 ; RUN: --ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s
6 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-aix \
7 ; RUN: --ppc-asm-full-reg-names -mcpu=pwr7 < %s | FileCheck %s --check-prefix=CHECK-AIX
9 define dso_local i64 @test_builtin_ppc_popcntb_i64(i64 %a) local_unnamed_addr {
10 ; CHECK-LABEL: test_builtin_ppc_popcntb_i64:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: popcntb r3, r3
15 ; CHECK-AIX-LABEL: test_builtin_ppc_popcntb_i64:
16 ; CHECK-AIX: # %bb.0: # %entry
17 ; CHECK-AIX-NEXT: popcntb 3, 3
20 %popcntb = tail call i64 @llvm.ppc.popcntb.i64.i64(i64 %a)
23 declare i64 @llvm.ppc.popcntb.i64.i64(i64)
25 define dso_local void @test_builtin_ppc_eieio() {
26 ; CHECK-LABEL: test_builtin_ppc_eieio:
27 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: ori r2, r2, 0
29 ; CHECK-NEXT: ori r2, r2, 0
33 ; CHECK-AIX-LABEL: test_builtin_ppc_eieio:
34 ; CHECK-AIX: # %bb.0: # %entry
35 ; CHECK-AIX-NEXT: ori 2, 2, 0
36 ; CHECK-AIX-NEXT: ori 2, 2, 0
37 ; CHECK-AIX-NEXT: eieio
40 call void @llvm.ppc.eieio()
43 declare void @llvm.ppc.eieio()
45 define dso_local void @test_builtin_ppc_iospace_eieio() {
46 ; CHECK-LABEL: test_builtin_ppc_iospace_eieio:
47 ; CHECK: # %bb.0: # %entry
48 ; CHECK-NEXT: ori r2, r2, 0
49 ; CHECK-NEXT: ori r2, r2, 0
53 ; CHECK-AIX-LABEL: test_builtin_ppc_iospace_eieio:
54 ; CHECK-AIX: # %bb.0: # %entry
55 ; CHECK-AIX-NEXT: ori 2, 2, 0
56 ; CHECK-AIX-NEXT: ori 2, 2, 0
57 ; CHECK-AIX-NEXT: eieio
60 call void @llvm.ppc.iospace.eieio()
63 declare void @llvm.ppc.iospace.eieio()
65 define dso_local void @test_builtin_ppc_iospace_lwsync() {
66 ; CHECK-LABEL: test_builtin_ppc_iospace_lwsync:
67 ; CHECK: # %bb.0: # %entry
71 ; CHECK-AIX-LABEL: test_builtin_ppc_iospace_lwsync:
72 ; CHECK-AIX: # %bb.0: # %entry
73 ; CHECK-AIX-NEXT: lwsync
76 call void @llvm.ppc.iospace.lwsync()
79 declare void @llvm.ppc.iospace.lwsync()
81 define dso_local void @test_builtin_ppc_iospace_sync() {
82 ; CHECK-LABEL: test_builtin_ppc_iospace_sync:
83 ; CHECK: # %bb.0: # %entry
87 ; CHECK-AIX-LABEL: test_builtin_ppc_iospace_sync:
88 ; CHECK-AIX: # %bb.0: # %entry
89 ; CHECK-AIX-NEXT: sync
92 call void @llvm.ppc.iospace.sync()
95 declare void @llvm.ppc.iospace.sync()
97 define dso_local void @test_builtin_ppc_icbt() {
98 ; CHECK-LABEL: test_builtin_ppc_icbt:
99 ; CHECK: # %bb.0: # %entry
100 ; CHECK-NEXT: ld r3, -8(r1)
101 ; CHECK-NEXT: icbt 0, 0, r3
104 ; CHECK-AIX-LABEL: test_builtin_ppc_icbt:
105 ; CHECK-AIX: # %bb.0: # %entry
106 ; CHECK-AIX-NEXT: ld 3, -8(1)
107 ; CHECK-AIX-NEXT: icbt 0, 0, 3
108 ; CHECK-AIX-NEXT: blr
110 %a = alloca i8*, align 8
111 %0 = load i8*, i8** %a, align 8
112 call void @llvm.ppc.icbt(i8* %0)
115 declare void @llvm.ppc.icbt(i8*)