| 1 |
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 |
; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr7 -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,BE |
| 3 |
; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr7 -mtriple=powerpc64-ibm-aix-xcoff -vec-extabi < %s | FileCheck %s --check-prefixes=CHECK,BE |
| 4 |
; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr7 -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,LE |
| 5 |
|
| 6 |
; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr7 -mtriple=powerpc64-unknown-linux-gnu -use-constant-int-for-fixed-length-splat -use-constant-fp-for-fixed-length-splat < %s | FileCheck %s --check-prefixes=CHECK,BE |
| 7 |
; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr7 -mtriple=powerpc64-ibm-aix-xcoff -vec-extabi -use-constant-int-for-fixed-length-splat -use-constant-fp-for-fixed-length-splat < %s | FileCheck %s --check-prefixes=CHECK,BE |
| 8 |
; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr7 -mtriple=powerpc64le-unknown-linux-gnu -use-constant-int-for-fixed-length-splat -use-constant-fp-for-fixed-length-splat < %s | FileCheck %s --check-prefixes=CHECK,LE |
| 9 |
|
| 10 |
define void @test1(ptr %P1, ptr %P2, ptr %P3) nounwind { |
| 11 |
; BE-LABEL: test1: |
| 12 |
; BE: # %bb.0: |
| 13 |
; BE-NEXT: lxvw4x 0, 0, 3 |
| 14 |
; BE-NEXT: vspltisb 2, -1 |
| 15 |
; BE-NEXT: vslw 2, 2, 2 |
| 16 |
; BE-NEXT: xxland 0, 0, 34 |
| 17 |
; BE-NEXT: stxvw4x 0, 0, 3 |
| 18 |
; BE-NEXT: lxvw4x 0, 0, 4 |
| 19 |
; BE-NEXT: xxlandc 0, 0, 34 |
| 20 |
; BE-NEXT: stxvw4x 0, 0, 4 |
| 21 |
; BE-NEXT: lxvw4x 0, 0, 5 |
| 22 |
; BE-NEXT: xvabssp 0, 0 |
| 23 |
; BE-NEXT: stxvw4x 0, 0, 5 |
| 24 |
; BE-NEXT: blr |
| 25 |
; |
| 26 |
; LE-LABEL: test1: |
| 27 |
; LE: # %bb.0: |
| 28 |
; LE-NEXT: lxvd2x 0, 0, 3 |
| 29 |
; LE-NEXT: xxswapd 34, 0 |
| 30 |
; LE-NEXT: vspltisb 3, -1 |
| 31 |
; LE-NEXT: vslw 3, 3, 3 |
| 32 |
; LE-NEXT: xxland 0, 34, 35 |
| 33 |
; LE-NEXT: xxswapd 0, 0 |
| 34 |
; LE-NEXT: stxvd2x 0, 0, 3 |
| 35 |
; LE-NEXT: lxvd2x 0, 0, 4 |
| 36 |
; LE-NEXT: xxswapd 34, 0 |
| 37 |
; LE-NEXT: xxlandc 0, 34, 35 |
| 38 |
; LE-NEXT: xxswapd 0, 0 |
| 39 |
; LE-NEXT: stxvd2x 0, 0, 4 |
| 40 |
; LE-NEXT: lxvd2x 0, 0, 5 |
| 41 |
; LE-NEXT: xxswapd 34, 0 |
| 42 |
; LE-NEXT: xvabssp 0, 34 |
| 43 |
; LE-NEXT: xxswapd 0, 0 |
| 44 |
; LE-NEXT: stxvd2x 0, 0, 5 |
| 45 |
; LE-NEXT: blr |
| 46 |
%tmp = load <4 x i32>, ptr %P1 ; <<4 x i32>> [#uses=1] |
| 47 |
%tmp4 = and <4 x i32> %tmp, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1] |
| 48 |
store <4 x i32> %tmp4, ptr %P1 |
| 49 |
%tmp7 = load <4 x i32>, ptr %P2 ; <<4 x i32>> [#uses=1] |
| 50 |
%tmp9 = and <4 x i32> %tmp7, < i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647 > ; <<4 x i32>> [#uses=1] |
| 51 |
store <4 x i32> %tmp9, ptr %P2 |
| 52 |
%tmp.upgrd.1 = load <4 x float>, ptr %P3 ; <<4 x float>> [#uses=1] |
| 53 |
%tmp11 = bitcast <4 x float> %tmp.upgrd.1 to <4 x i32> ; <<4 x i32>> [#uses=1] |
| 54 |
%tmp12 = and <4 x i32> %tmp11, < i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647 > ; <<4 x i32>> [#uses=1] |
| 55 |
%tmp13 = bitcast <4 x i32> %tmp12 to <4 x float> ; <<4 x float>> [#uses=1] |
| 56 |
store <4 x float> %tmp13, ptr %P3 |
| 57 |
ret void |
| 58 |
|
| 59 |
} |
| 60 |
|
| 61 |
define <4 x i32> @test_30() nounwind { |
| 62 |
; CHECK-LABEL: test_30: |
| 63 |
; CHECK: # %bb.0: |
| 64 |
; CHECK-NEXT: vspltisw 2, 15 |
| 65 |
; CHECK-NEXT: vadduwm 2, 2, 2 |
| 66 |
; CHECK-NEXT: blr |
| 67 |
ret <4 x i32> < i32 30, i32 30, i32 30, i32 30 > |
| 68 |
} |
| 69 |
|
| 70 |
define <4 x i32> @test_29() nounwind { |
| 71 |
; CHECK-LABEL: test_29: |
| 72 |
; CHECK: # %bb.0: |
| 73 |
; CHECK-NEXT: vspltisw 3, -16 |
| 74 |
; CHECK-NEXT: vspltisw 2, 13 |
| 75 |
; CHECK-NEXT: vsubuwm 2, 2, 3 |
| 76 |
; CHECK-NEXT: blr |
| 77 |
ret <4 x i32> < i32 29, i32 29, i32 29, i32 29 > |
| 78 |
} |
| 79 |
|
| 80 |
define <8 x i16> @test_n30() nounwind { |
| 81 |
; CHECK-LABEL: test_n30: |
| 82 |
; CHECK: # %bb.0: |
| 83 |
; CHECK-NEXT: vspltish 2, -15 |
| 84 |
; CHECK-NEXT: vadduhm 2, 2, 2 |
| 85 |
; CHECK-NEXT: blr |
| 86 |
ret <8 x i16> < i16 -30, i16 -30, i16 -30, i16 -30, i16 -30, i16 -30, i16 -30, i16 -30 > |
| 87 |
} |
| 88 |
|
| 89 |
define <16 x i8> @test_n104() nounwind { |
| 90 |
; CHECK-LABEL: test_n104: |
| 91 |
; CHECK: # %bb.0: |
| 92 |
; CHECK-NEXT: vspltisb 2, -13 |
| 93 |
; CHECK-NEXT: vslb 2, 2, 2 |
| 94 |
; CHECK-NEXT: blr |
| 95 |
ret <16 x i8> < i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104 > |
| 96 |
} |
| 97 |
|
| 98 |
define <4 x i32> @test_vsldoi() nounwind { |
| 99 |
; CHECK-LABEL: test_vsldoi: |
| 100 |
; CHECK: # %bb.0: |
| 101 |
; CHECK-NEXT: vspltisw 2, 2 |
| 102 |
; CHECK-NEXT: vsldoi 2, 2, 2, 1 |
| 103 |
; CHECK-NEXT: blr |
| 104 |
ret <4 x i32> < i32 512, i32 512, i32 512, i32 512 > |
| 105 |
} |
| 106 |
|
| 107 |
define <8 x i16> @test_vsldoi_65023() nounwind { |
| 108 |
; CHECK-LABEL: test_vsldoi_65023: |
| 109 |
; CHECK: # %bb.0: |
| 110 |
; CHECK-NEXT: vspltish 2, -3 |
| 111 |
; CHECK-NEXT: vsldoi 2, 2, 2, 1 |
| 112 |
; CHECK-NEXT: blr |
| 113 |
ret <8 x i16> < i16 65023, i16 65023,i16 65023,i16 65023,i16 65023,i16 65023,i16 65023,i16 65023 > |
| 114 |
} |
| 115 |
|
| 116 |
define <4 x i32> @test_vsldoi_x16() nounwind { |
| 117 |
; CHECK-LABEL: test_vsldoi_x16: |
| 118 |
; CHECK: # %bb.0: |
| 119 |
; CHECK-NEXT: vspltisw 2, -3 |
| 120 |
; CHECK-NEXT: vsldoi 2, 2, 2, 2 |
| 121 |
; CHECK-NEXT: blr |
| 122 |
ret <4 x i32> <i32 -131073, i32 -131073, i32 -131073, i32 -131073> |
| 123 |
} |
| 124 |
|
| 125 |
define <4 x i32> @test_vsldoi_x24() nounwind { |
| 126 |
; CHECK-LABEL: test_vsldoi_x24: |
| 127 |
; CHECK: # %bb.0: |
| 128 |
; CHECK-NEXT: vspltisw 2, -3 |
| 129 |
; CHECK-NEXT: vsldoi 2, 2, 2, 3 |
| 130 |
; CHECK-NEXT: blr |
| 131 |
ret <4 x i32> <i32 -33554433, i32 -33554433, i32 -33554433, i32 -33554433> |
| 132 |
} |
| 133 |
|
| 134 |
define <4 x i32> @test_rol() nounwind { |
| 135 |
; CHECK-LABEL: test_rol: |
| 136 |
; CHECK: # %bb.0: |
| 137 |
; CHECK-NEXT: vspltisw 2, -12 |
| 138 |
; CHECK-NEXT: vrlw 2, 2, 2 |
| 139 |
; CHECK-NEXT: blr |
| 140 |
ret <4 x i32> < i32 -11534337, i32 -11534337, i32 -11534337, i32 -11534337 > |
| 141 |
} |