1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3 ; RUN: -mcpu=pwr8 < %s | FileCheck %s --check-prefix=CHECK
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
5 ; RUN: -mcpu=pwr8 < %s | FileCheck %s --check-prefix=CHECK
6 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-aix \
7 ; RUN: -mcpu=pwr8 < %s | FileCheck %s --check-prefix=CHECK
9 declare i64 @llvm.ppc.ldarx(ptr)
10 define dso_local i64 @test_ldarx(ptr readnone %a) {
11 ; CHECK-LABEL: test_ldarx:
12 ; CHECK: # %bb.0: # %entry
14 ; CHECK-NEXT: ldarx 3, 0, 3
18 %0 = call i64 asm sideeffect "ldarx $0, ${1:y}", "=r,*Z,~{memory}"(ptr elementtype(i64) %a)
22 declare i32 @llvm.ppc.stdcx(ptr, i64)
23 define dso_local i64 @test_stdcx(ptr %a, i64 %b) {
24 ; CHECK-LABEL: test_stdcx:
25 ; CHECK: # %bb.0: # %entry
26 ; CHECK-NEXT: stdcx. 4, 0, 3
27 ; CHECK-NEXT: mfocrf 3, 128
28 ; CHECK-NEXT: srwi 3, 3, 28
29 ; CHECK-NEXT: rlwinm 3, 3, 31, 31, 31
32 %0 = tail call i32 @llvm.ppc.stdcx(ptr %a, i64 %b)
33 %conv = sext i32 %0 to i64