xref: /llvm-project/llvm/test/CodeGen/PowerPC/GlobalISel/fconstant.ll (revision 6ee2f770efb6b1b02438db025af0899ed5bf9313)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2
3; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -code-model=small \
4; RUN:   -verify-machineinstrs -o - < %s | FileCheck %s --check-prefix=SMALL
5; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -code-model=medium \
6; RUN:   -verify-machineinstrs -o - < %s | FileCheck %s --check-prefix=MEDIUM
7; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -code-model=large \
8; RUN:   -verify-machineinstrs -o - < %s | FileCheck %s --check-prefix=LARGE
9
10define float @foo_float() {
11; SMALL-LABEL: foo_float:
12; SMALL:       # %bb.0: # %entry
13; SMALL-NEXT:    ld 3, .LC0@toc(2)
14; SMALL-NEXT:    lfs 1, 0(3)
15; SMALL-NEXT:    blr
16;
17; MEDIUM-LABEL: foo_float:
18; MEDIUM:       # %bb.0: # %entry
19; MEDIUM-NEXT:    addis 3, 2, .LCPI0_0@toc@ha
20; MEDIUM-NEXT:    addi 3, 3, .LCPI0_0@toc@l
21; MEDIUM-NEXT:    lfs 1, 0(3)
22; MEDIUM-NEXT:    blr
23;
24; LARGE-LABEL: foo_float:
25; LARGE:       # %bb.0: # %entry
26; LARGE-NEXT:    addis 3, 2, .LC0@toc@ha
27; LARGE-NEXT:    ld 3, .LC0@toc@l(3)
28; LARGE-NEXT:    lfs 1, 0(3)
29; LARGE-NEXT:    blr
30entry:
31  ret float 1.000000e+00
32}
33
34define double @foo_double() {
35; SMALL-LABEL: foo_double:
36; SMALL:       # %bb.0: # %entry
37; SMALL-NEXT:    ld 3, .LC1@toc(2)
38; SMALL-NEXT:    lfd 1, 0(3)
39; SMALL-NEXT:    blr
40;
41; MEDIUM-LABEL: foo_double:
42; MEDIUM:       # %bb.0: # %entry
43; MEDIUM-NEXT:    addis 3, 2, .LCPI1_0@toc@ha
44; MEDIUM-NEXT:    addi 3, 3, .LCPI1_0@toc@l
45; MEDIUM-NEXT:    lfd 1, 0(3)
46; MEDIUM-NEXT:    blr
47;
48; LARGE-LABEL: foo_double:
49; LARGE:       # %bb.0: # %entry
50; LARGE-NEXT:    addis 3, 2, .LC1@toc@ha
51; LARGE-NEXT:    ld 3, .LC1@toc@l(3)
52; LARGE-NEXT:    lfd 1, 0(3)
53; LARGE-NEXT:    blr
54entry:
55  ret double 1.000000e+00
56}
57