File: pr18014.ll

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8%2Bdeb10u2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 734,616 kB
  • sloc: cpp: 3,776,926; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; javascript: 518; ruby: 156
file content (23 lines) | stat: -rw-r--r-- 881 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse4.1 | FileCheck %s

; Ensure PSRAD is generated as the condition is consumed by both PADD and
; BLENDVPS. PAND requires all bits setting properly.

define <4 x i32> @foo(<4 x i32>* %p, <4 x i1> %cond, <4 x i32> %v1, <4 x i32> %v2, <4 x i32> %v3) {
; CHECK-LABEL: foo:
; CHECK:       # %bb.0:
; CHECK-NEXT:    pslld $31, %xmm0
; CHECK-NEXT:    psrad $31, %xmm0
; CHECK-NEXT:    blendvps %xmm0, %xmm1, %xmm2
; CHECK-NEXT:    paddd %xmm0, %xmm1
; CHECK-NEXT:    movaps %xmm2, (%rdi)
; CHECK-NEXT:    movdqa %xmm1, %xmm0
; CHECK-NEXT:    retq
  %sext_cond = sext <4 x i1> %cond to <4 x i32>
  %t1 = add <4 x i32> %v1, %sext_cond
  %t2 = select <4 x i1> %cond, <4 x i32> %v1, <4 x i32> %v2
  store <4 x i32> %t2, <4 x i32>* %p
  ret <4 x i32> %t1
}