Nemanja Ivanovic | e22ebea | 2017-09-26 20:42:47 +0000 | [diff] [blame] | 1 | ; XFAIL: * |
Nemanja Ivanovic | 35db4f9 | 2017-09-23 12:53:03 +0000 | [diff] [blame] | 2 | ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \ |
| 3 | ; RUN: -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \ |
| 4 | ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl |
| 5 | ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \ |
| 6 | ; RUN: -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \ |
| 7 | ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl |
| 8 | |
| 9 | @glob = common local_unnamed_addr global i32 0, align 4 |
| 10 | |
| 11 | ; Function Attrs: norecurse nounwind readnone |
| 12 | define signext i32 @test_iltui(i32 zeroext %a, i32 zeroext %b) { |
| 13 | ; CHECK-LABEL: test_iltui: |
| 14 | ; CHECK: sub [[REG:r[0-9]+]], r3, r4 |
| 15 | ; CHECK-NEXT: rldicl r3, [[REG]], 1, 63 |
| 16 | ; CHECK-NEXT: blr |
| 17 | entry: |
| 18 | %cmp = icmp ult i32 %a, %b |
| 19 | %conv = zext i1 %cmp to i32 |
| 20 | ret i32 %conv |
| 21 | } |
| 22 | |
| 23 | ; Function Attrs: norecurse nounwind readnone |
| 24 | define signext i32 @test_iltui_sext(i32 zeroext %a, i32 zeroext %b) { |
| 25 | ; CHECK-LABEL: test_iltui_sext: |
| 26 | ; CHECK: sub [[REG:r[0-9]+]], r3, r4 |
| 27 | ; CHECK-NEXT: sradi r3, [[REG]], 63 |
| 28 | ; CHECK-NEXT: blr |
| 29 | entry: |
| 30 | %cmp = icmp ult i32 %a, %b |
| 31 | %sub = sext i1 %cmp to i32 |
| 32 | ret i32 %sub |
| 33 | } |
| 34 | |
| 35 | ; Function Attrs: norecurse nounwind |
| 36 | define void @test_iltui_store(i32 zeroext %a, i32 zeroext %b) { |
| 37 | ; CHECK-LABEL: test_iltui_store: |
| 38 | ; CHECK: sub [[REG:r[2-9]+]], r3, r4 |
| 39 | ; CHECK: rldicl {{r[0-9]+}}, [[REG]], 1, 63 |
| 40 | entry: |
| 41 | %cmp = icmp ult i32 %a, %b |
| 42 | %conv = zext i1 %cmp to i32 |
| 43 | store i32 %conv, i32* @glob, align 4 |
| 44 | ret void |
| 45 | } |
| 46 | |
| 47 | ; Function Attrs: norecurse nounwind |
| 48 | define void @test_iltui_sext_store(i32 zeroext %a, i32 zeroext %b) { |
| 49 | ; CHECK-LABEL: test_iltui_sext_store: |
| 50 | ; CHECK: sub [[REG:r[0-9]+]], r3, r4 |
| 51 | ; CHECK: sradi {{r[0-9]+}}, [[REG]], 63 |
| 52 | entry: |
| 53 | %cmp = icmp ult i32 %a, %b |
| 54 | %sub = sext i1 %cmp to i32 |
| 55 | store i32 %sub, i32* @glob, align 4 |
| 56 | ret void |
| 57 | } |