aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/PowerPC/splat-extend.ll
blob: 853967eb0eaf3f80ab0f20dd63d717536f49312b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
; RUN:   -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
; RUN:   FileCheck %s
; RUN: llc -verify-machineinstrs  -mtriple=powerpc64-aix-xcoff \
; RUN:   -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
; RUN:   FileCheck %s
; RUN: llc -verify-machineinstrs  -mtriple=powerpc-aix-xcoff \
; RUN:   -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
; RUN:   FileCheck %s

define dso_local noundef <8 x i16> @v103s() local_unnamed_addr {
; CHECK-LABEL: v103s:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    xxspltib v2, 103
; CHECK-NEXT:    vupklsb v2, v2
; CHECK-NEXT:    blr
entry:
  ret <8 x i16> splat (i16 103)
}

define dso_local noundef <2 x i64> @v103l() local_unnamed_addr {
; CHECK-LABEL: v103l:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    xxspltib v2, 103
; CHECK-NEXT:    vextsb2d v2, v2
; CHECK-NEXT:    blr
entry:
  ret <2 x i64> splat (i64 103)
}

define dso_local noundef <4 x i32> @v103i() local_unnamed_addr {
; CHECK-LABEL: v103i:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    xxspltib v2, 103
; CHECK-NEXT:    vextsb2w v2, v2
; CHECK-NEXT:    blr
entry:
  ret <4 x i32> splat (i32 103)
}

define dso_local noundef <2 x i64> @v11l() local_unnamed_addr {
; CHECK-LABEL: v11l:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    vspltisw v2, -11
; CHECK-NEXT:    vupklsw v2, v2
; CHECK-NEXT:    blr
entry:
  ret <2 x i64> splat (i64 -11)
}

declare <4 x i32> @llvm.ppc.altivec.vextsb2w(<16 x i8>)

define i32 @crash(ptr %p) {
; CHECK-LABEL: crash:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    xxspltib v2, 127
; CHECK-NEXT:    vextsb2w v2, v2
; CHECK-NEXT:    stxv v2, 0(r3)
; CHECK-NEXT:    li r3, 0
; CHECK-NEXT:    stxv v2, 0(0)
; CHECK-NEXT:    blr
entry:
  store <4 x i32> <i32 127, i32 127, i32 127, i32 127>, ptr %p, align 16
  %0 = call <4 x i32> @llvm.ppc.altivec.vextsb2w(<16 x i8> <i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127, i8 127>)
  store <4 x i32> %0, ptr null, align 16
  ret i32 0
}