|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 |
| 2 | +; RUN: llc -verify-machineinstrs -O3 -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu \ |
| 3 | +; RUN: -ppc-asm-full-reg-names --ppc-vsr-nums-as-vr < %s | FileCheck %s |
| 4 | + |
| 5 | +; RUN: llc -verify-machineinstrs -O3 -mcpu=pwr9 -mtriple=powerpc64-ibm-aix \ |
| 6 | +; RUN: -ppc-asm-full-reg-names --ppc-vsr-nums-as-vr < %s | FileCheck %s |
| 7 | + |
| 8 | +; RUN: llc -verify-machineinstrs -O3 -mcpu=pwr9 -mtriple=powerpc-ibm-aix \ |
| 9 | +; RUN: -ppc-asm-full-reg-names --ppc-vsr-nums-as-vr < %s | FileCheck %s |
| 10 | + |
| 11 | +; The addition of vector `A` with vector of 1s currently uses `vspltisw` to generate vector of 1s followed by add operation. |
| 12 | + |
| 13 | +; Function for the vector type v2i64 `a + {1, 1}` |
| 14 | +define <2 x i64> @test_v2i64(<2 x i64> %a) { |
| 15 | +; CHECK-LABEL: test_v2i64: |
| 16 | +; CHECK: # %bb.0: # %entry |
| 17 | +; CHECK-NEXT: vspltisw v3, 1 |
| 18 | +; CHECK-NEXT: vupklsw v3, v3 |
| 19 | +; CHECK-NEXT: vaddudm v2, v2, v3 |
| 20 | +; CHECK-NEXT: blr |
| 21 | +entry: |
| 22 | + %add = add <2 x i64> %a, splat (i64 1) |
| 23 | + ret <2 x i64> %add |
| 24 | +} |
| 25 | + |
| 26 | +; Function for the vector type v4i32 `a + {1, 1, 1, 1}` |
| 27 | +define <4 x i32> @test_v4i32(<4 x i32> %a) { |
| 28 | +; CHECK-LABEL: test_v4i32: |
| 29 | +; CHECK: # %bb.0: # %entry |
| 30 | +; CHECK-NEXT: vspltisw v3, 1 |
| 31 | +; CHECK-NEXT: vadduwm v2, v2, v3 |
| 32 | +; CHECK-NEXT: blr |
| 33 | +entry: |
| 34 | + %add = add <4 x i32> %a, splat (i32 1) |
| 35 | + ret <4 x i32> %add |
| 36 | +} |
| 37 | + |
| 38 | +; Function for the vector type v8i16 `a + {1, 1, 1, 1, 1, 1, 1, 1}` |
| 39 | +define <8 x i16> @test_v8i16(<8 x i16> %a) { |
| 40 | +; CHECK-LABEL: test_v8i16: |
| 41 | +; CHECK: # %bb.0: # %entry |
| 42 | +; CHECK-NEXT: vspltish v3, 1 |
| 43 | +; CHECK-NEXT: vadduhm v2, v2, v3 |
| 44 | +; CHECK-NEXT: blr |
| 45 | +entry: |
| 46 | + %add = add <8 x i16> %a, splat (i16 1) |
| 47 | + ret <8 x i16> %add |
| 48 | +} |
| 49 | + |
| 50 | +; Function for the vector type v16i8 `a + {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}` |
| 51 | +define <16 x i8> @test_16i8(<16 x i8> %a) { |
| 52 | +; CHECK-LABEL: test_16i8: |
| 53 | +; CHECK: # %bb.0: # %entry |
| 54 | +; CHECK-NEXT: xxspltib v3, 1 |
| 55 | +; CHECK-NEXT: vaddubm v2, v2, v3 |
| 56 | +; CHECK-NEXT: blr |
| 57 | +entry: |
| 58 | + %add = add <16 x i8> %a, splat (i8 1) |
| 59 | + ret <16 x i8> %add |
| 60 | +} |
0 commit comments