File: load-two-flts.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 (59 lines) | stat: -rw-r--r-- 1,983 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
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s
target datalayout = "E-m:e-i64:64-n32:64"

define void @_Z4testSt7complexIfE(float %v0, float %v1, ptr %ref.tmp, ptr %_M_value.realp.i.i, ptr %_M_value.imagp.i.i) {
entry:
  %v2 = load i64, ptr %ref.tmp, align 8
  %v3 = lshr i64 %v2, 32
  %v4 = trunc i64 %v3 to i32
  %v5 = bitcast i32 %v4 to float
  %v6 = trunc i64 %v2 to i32
  %v7 = bitcast i32 %v6 to float
  %mul_ad.i.i = fmul float %v5, %v1
  %mul_bc.i.i = fmul float %v7, %v0
  %mul_i.i.i = fadd float %mul_ad.i.i, %mul_bc.i.i
  %mul_ac.i.i = fmul float %v5, %v0
  %mul_bd.i.i = fmul float %v7, %v1
  %mul_r.i.i = fsub float %mul_ac.i.i, %mul_bd.i.i
  store float %mul_r.i.i, ptr %_M_value.realp.i.i, align 4
  store float %mul_i.i.i, ptr %_M_value.imagp.i.i, align 4
  ret void

; CHECK-LABEL: @_Z4testSt7complexIfE
; CHECK-NOT: ld {{[0-9]+}}, 0(5)
; CHECK-NOT: stw
; CHECK-NOT: rldicl
; CHECK-DAG: lfs {{[0-9]+}}, 4(5)
; CHECK-DAG: lfs {{[0-9]+}}, 0(5)
; CHECK: blr
}

define ptr @_Z4testSt7complexIfE_idx(float %v0, float %v1, ptr %ref.tmp, ptr %_M_value.realp.i.i, ptr %_M_value.imagp.i.i) {
entry:
  %r = getelementptr i64, ptr %ref.tmp, i64 1
  %v2 = load i64, ptr %r, align 8
  %v3 = lshr i64 %v2, 32
  %v4 = trunc i64 %v3 to i32
  %v5 = bitcast i32 %v4 to float
  %v6 = trunc i64 %v2 to i32
  %v7 = bitcast i32 %v6 to float
  %mul_ad.i.i = fmul float %v5, %v1
  %mul_bc.i.i = fmul float %v7, %v0
  %mul_i.i.i = fadd float %mul_ad.i.i, %mul_bc.i.i
  %mul_ac.i.i = fmul float %v5, %v0
  %mul_bd.i.i = fmul float %v7, %v1
  %mul_r.i.i = fsub float %mul_ac.i.i, %mul_bd.i.i
  store float %mul_r.i.i, ptr %_M_value.realp.i.i, align 4
  store float %mul_i.i.i, ptr %_M_value.imagp.i.i, align 4
  ret ptr %r

; CHECK-LABEL: @_Z4testSt7complexIfE
; CHECK-NOT: ld {{[0-9]+}}, 8(5)
; CHECK-NOT: ldu {{[0-9]+}}, 8(5)
; CHECK-NOT: stw
; CHECK-NOT: rldicl
; CHECK-DAG: lfsu {{[0-9]+}}, 8(3)
; CHECK-DAG: lfs {{[0-9]+}}, 4(3)
; CHECK: blr
}