File: float-vector-gather.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (65 lines) | stat: -rw-r--r-- 3,122 bytes parent folder | download | duplicates (14)
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
; NOTE: This test ensures that, for both Big and Little Endian cases, a set of
; NOTE: 4 floats is gathered into a v4f32 register using xxmrghw and xxmrgld
; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-vsr-nums-as-vr \
; RUN: -ppc-asm-full-reg-names -mtriple=powerpc64le-unknown-linux-gnu < %s \
; RUN: | FileCheck %s -check-prefix=CHECK-LE
; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-vsr-nums-as-vr \
; RUN: -ppc-asm-full-reg-names -mtriple=powerpc64-unknown-linux-gnu < %s \
; RUN: | FileCheck %s -check-prefix=CHECK-BE
; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-vsr-nums-as-vr \
; RUN: -ppc-asm-full-reg-names -mtriple=powerpc64-ibm-aix-xcoff < %s \
; RUN: | FileCheck %s -check-prefix=CHECK-BE
; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-vsr-nums-as-vr \
; RUN: -ppc-asm-full-reg-names -mtriple=powerpc-ibm-aix-xcoff < %s \
; RUN: | FileCheck %s -check-prefix=CHECK-BE-AIX-32
define dso_local <4 x float> @vector_gatherf(ptr nocapture readonly %a,
ptr nocapture readonly %b, ptr nocapture readonly %c,
ptr nocapture readonly %d) {
; C code from which this IR test case was generated:
; vector float test(ptr a, ptr b, ptr c, ptr d) {
;  return (vector float) { *a, *b, *c, *d };
; }
; CHECK-LE-LABEL: vector_gatherf:
; CHECK-LE:       # %bb.0: # %entry
; CHECK-LE-DAG:    lfiwzx f[[REG0:[0-9]+]], 0, r6
; CHECK-LE-DAG:    lfiwzx f[[REG1:[0-9]+]], 0, r5
; CHECK-LE-DAG:    lfiwzx f[[REG2:[0-9]+]], 0, r4
; CHECK-LE-DAG:    lfiwzx f[[REG3:[0-9]+]], 0, r3
; CHECK-LE-DAG:    xxmrghw vs[[REG0]], vs[[REG0]], vs[[REG1]]
; CHECK-LE-DAG:    xxmrghw vs[[REG4:[0-9]+]], vs[[REG2]], vs[[REG3]]
; CHECK-LE-NEXT:   xxmrgld v[[REG:[0-9]+]], vs[[REG0]], vs[[REG4]]
; CHECK-LE-NEXT:   blr

; CHECK-BE-LABEL: vector_gatherf:
; CHECK-BE:       # %bb.0: # %entry
; CHECK-BE-DAG:    lfiwzx f[[REG0:[0-9]+]], 0, r3
; CHECK-BE-DAG:    lfiwzx f[[REG1:[0-9]+]], 0, r4
; CHECK-BE-DAG:    lfiwzx f[[REG2:[0-9]+]], 0, r5
; CHECK-BE-DAG:    lfiwzx f[[REG3:[0-9]+]], 0, r6
; CHECK-BE-DAG:    xxmrghw vs[[REG0]], vs[[REG0]], vs[[REG1]]
; CHECK-BE-DAG:    xxmrghw vs[[REG4:[0-9]+]], vs[[REG2]], vs[[REG3]]
; CHECK-BE-NEXT:   xxmrgld v[[REG:[0-9]+]], vs[[REG0]], vs[[REG4]]
; CHECK-BE-NEXT:   blr

; CHECK-BE-AIX-32-LABEL: vector_gatherf:
; CHECK-BE-AIX-32-LABEL: # %bb.0: # %entry
; CHECK-BE-AIX-32-DAG: lxsiwzx v[[REG0:[0-9]+]]
; CHECK-BE-AIX-32-DAG: lxsiwzx v[[REG1:[0-9]+]]
; CHECK-BE-AIX-32-DAG: lxsiwzx v[[REG2:[0-9]+]]
; CHECK-BE-AIX-32-DAG: lxsiwzx v[[REG3:[0-9]+]]
; CHECK-BE-AIX-32-DAG: vmrgow v[[REG0]], v[[REG1]], v[[REG0]]
; CHECK-BE-AIX-32-DAG: vmrgow v[[REG3]], v[[REG2]], v[[REG3]]
; CHECK-BE-AIX-32-NEXT: xxmrghd v[[REG0]], v[[REG3]], v[[REG0]]
; CHECK-BE-AIX-32-NEXT: blr
entry:
  %0 = load float, ptr %a, align 4
  %vecinit = insertelement <4 x float> undef, float %0, i32 0
  %1 = load float, ptr %b, align 4
  %vecinit1 = insertelement <4 x float> %vecinit, float %1, i32 1
  %2 = load float, ptr %c, align 4
  %vecinit2 = insertelement <4 x float> %vecinit1, float %2, i32 2
  %3 = load float, ptr %d, align 4
  %vecinit3 = insertelement <4 x float> %vecinit2, float %3, i32 3
  ret <4 x float> %vecinit3
}