File: complex-return.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (55 lines) | stat: -rw-r--r-- 2,317 bytes parent folder | download | duplicates (12)
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
; RUN: llc -verify-machineinstrs -mcpu=ppc64 -O0 < %s | FileCheck %s

target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
target triple = "powerpc64-unknown-linux-gnu"

define { ppc_fp128, ppc_fp128 } @foo() nounwind {
entry:
  %retval = alloca { ppc_fp128, ppc_fp128 }, align 16
  %x = alloca { ppc_fp128, ppc_fp128 }, align 16
  %real = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr %x, i32 0, i32 0
  %imag = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr %x, i32 0, i32 1
  store ppc_fp128 0xM400C0000000000300000000010000000, ptr %real
  store ppc_fp128 0xMC00547AE147AE1483CA47AE147AE147A, ptr %imag
  %x.realp = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr %x, i32 0, i32 0
  %x.real = load ppc_fp128, ptr %x.realp
  %x.imagp = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr %x, i32 0, i32 1
  %x.imag = load ppc_fp128, ptr %x.imagp
  %real1 = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr %retval, i32 0, i32 0
  %imag2 = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr %retval, i32 0, i32 1
  store ppc_fp128 %x.real, ptr %real1
  store ppc_fp128 %x.imag, ptr %imag2
  %0 = load { ppc_fp128, ppc_fp128 }, ptr %retval
  ret { ppc_fp128, ppc_fp128 } %0
}

; CHECK-LABEL: foo:
; CHECK-DAG: lfd 1
; CHECK-DAG: lfd 2
; CHECK-DAG: lfd 3
; CHECK-DAG: lfd 4

define { float, float } @oof() nounwind {
entry:
  %retval = alloca { float, float }, align 4
  %x = alloca { float, float }, align 4
  %real = getelementptr inbounds { float, float }, ptr %x, i32 0, i32 0
  %imag = getelementptr inbounds { float, float }, ptr %x, i32 0, i32 1
  store float 3.500000e+00, ptr %real
  store float 0xC00547AE20000000, ptr %imag
  %x.realp = getelementptr inbounds { float, float }, ptr %x, i32 0, i32 0
  %x.real = load float, ptr %x.realp
  %x.imagp = getelementptr inbounds { float, float }, ptr %x, i32 0, i32 1
  %x.imag = load float, ptr %x.imagp
  %real1 = getelementptr inbounds { float, float }, ptr %retval, i32 0, i32 0
  %imag2 = getelementptr inbounds { float, float }, ptr %retval, i32 0, i32 1
  store float %x.real, ptr %real1
  store float %x.imag, ptr %imag2
  %0 = load { float, float }, ptr %retval
  ret { float, float } %0
}

; CHECK-LABEL: oof:
; CHECK-DAG: lfs 2
; CHECK-DAG: lfs 1