xref: /llvm-project/llvm/test/CodeGen/SPARC/fp128-select.ll (revision ac16ea89dbcfc362c6bef841ab543df08bf9e6ec)
1*ac16ea89SKoakuma; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2*ac16ea89SKoakuma; RUN: llc -mtriple=sparcv9 -verify-machineinstrs < %s | FileCheck %s --check-prefix=V9
3*ac16ea89SKoakuma
4*ac16ea89SKoakumadefine fp128 @f128_select_soft(fp128 %a, fp128 %b) #0 {
5*ac16ea89SKoakuma; V9-LABEL: f128_select_soft:
6*ac16ea89SKoakuma; V9:         .cfi_startproc
7*ac16ea89SKoakuma; V9-NEXT:  ! %bb.0: ! %entry
8*ac16ea89SKoakuma; V9-NEXT:    add %sp, -144, %sp
9*ac16ea89SKoakuma; V9-NEXT:    .cfi_def_cfa_register %fp
10*ac16ea89SKoakuma; V9-NEXT:    .cfi_window_save
11*ac16ea89SKoakuma; V9-NEXT:    .cfi_register %o7, %i7
12*ac16ea89SKoakuma; V9-NEXT:    add %sp, 2175, %o0
13*ac16ea89SKoakuma; V9-NEXT:    or %o0, 8, %o0
14*ac16ea89SKoakuma; V9-NEXT:    std %f6, [%o0]
15*ac16ea89SKoakuma; V9-NEXT:    std %f4, [%sp+2175]
16*ac16ea89SKoakuma; V9-NEXT:    ldx [%o0], %o0
17*ac16ea89SKoakuma; V9-NEXT:    ldx [%sp+2175], %o1
18*ac16ea89SKoakuma; V9-NEXT:    sethi 0, %o2
19*ac16ea89SKoakuma; V9-NEXT:    or %o2, 0, %o2
20*ac16ea89SKoakuma; V9-NEXT:    sethi 2097152, %o3
21*ac16ea89SKoakuma; V9-NEXT:    or %o3, 0, %o3
22*ac16ea89SKoakuma; V9-NEXT:    sllx %o3, 32, %o3
23*ac16ea89SKoakuma; V9-NEXT:    or %o3, %o2, %o2
24*ac16ea89SKoakuma; V9-NEXT:    xor %o1, %o2, %o1
25*ac16ea89SKoakuma; V9-NEXT:    or %o0, %o1, %o0
26*ac16ea89SKoakuma; V9-NEXT:    cmp %o0, 0
27*ac16ea89SKoakuma; V9-NEXT:    bne %xcc, .LBB0_2
28*ac16ea89SKoakuma; V9-NEXT:    nop
29*ac16ea89SKoakuma; V9-NEXT:  ! %bb.1:
30*ac16ea89SKoakuma; V9-NEXT:    sethi %h44(.LCPI0_0), %o0
31*ac16ea89SKoakuma; V9-NEXT:    add %o0, %m44(.LCPI0_0), %o0
32*ac16ea89SKoakuma; V9-NEXT:    sllx %o0, 12, %o0
33*ac16ea89SKoakuma; V9-NEXT:    ldd [%o0+%l44(.LCPI0_0)], %f0
34*ac16ea89SKoakuma; V9-NEXT:    add %o0, %l44(.LCPI0_0), %o0
35*ac16ea89SKoakuma; V9-NEXT:    ldd [%o0+8], %f2
36*ac16ea89SKoakuma; V9-NEXT:  .LBB0_2: ! %entry
37*ac16ea89SKoakuma; V9-NEXT:    retl
38*ac16ea89SKoakuma; V9-NEXT:    add %sp, 144, %sp
39*ac16ea89SKoakumaentry:
40*ac16ea89SKoakuma  %0 = bitcast fp128 %b to i128
41*ac16ea89SKoakuma  %xor.i = xor i128 %0, 0
42*ac16ea89SKoakuma  %cmp19.i = icmp eq i128 %xor.i, -170141183460469231731687303715884105728
43*ac16ea89SKoakuma  %spec.select277.i = select i1 %cmp19.i, fp128 0xL00000000000000007FFF800000000000, fp128 %a
44*ac16ea89SKoakuma  ret fp128 %spec.select277.i
45*ac16ea89SKoakuma}
46*ac16ea89SKoakuma
47*ac16ea89SKoakumadefine fp128 @f128_select_hard(fp128 %a, fp128 %b) #1 {
48*ac16ea89SKoakuma; V9-LABEL: f128_select_hard:
49*ac16ea89SKoakuma; V9:         .cfi_startproc
50*ac16ea89SKoakuma; V9-NEXT:  ! %bb.0: ! %entry
51*ac16ea89SKoakuma; V9-NEXT:    add %sp, -144, %sp
52*ac16ea89SKoakuma; V9-NEXT:    .cfi_def_cfa_register %fp
53*ac16ea89SKoakuma; V9-NEXT:    .cfi_window_save
54*ac16ea89SKoakuma; V9-NEXT:    .cfi_register %o7, %i7
55*ac16ea89SKoakuma; V9-NEXT:    stq %f4, [%sp+2175]
56*ac16ea89SKoakuma; V9-NEXT:    add %sp, 2175, %o0
57*ac16ea89SKoakuma; V9-NEXT:    or %o0, 8, %o0
58*ac16ea89SKoakuma; V9-NEXT:    ldx [%o0], %o0
59*ac16ea89SKoakuma; V9-NEXT:    ldx [%sp+2175], %o1
60*ac16ea89SKoakuma; V9-NEXT:    sethi 0, %o2
61*ac16ea89SKoakuma; V9-NEXT:    or %o2, 0, %o2
62*ac16ea89SKoakuma; V9-NEXT:    sethi %h44(.LCPI1_0), %o3
63*ac16ea89SKoakuma; V9-NEXT:    add %o3, %m44(.LCPI1_0), %o3
64*ac16ea89SKoakuma; V9-NEXT:    sllx %o3, 12, %o3
65*ac16ea89SKoakuma; V9-NEXT:    ldq [%o3+%l44(.LCPI1_0)], %f4
66*ac16ea89SKoakuma; V9-NEXT:    sethi 2097152, %o3
67*ac16ea89SKoakuma; V9-NEXT:    or %o3, 0, %o3
68*ac16ea89SKoakuma; V9-NEXT:    sllx %o3, 32, %o3
69*ac16ea89SKoakuma; V9-NEXT:    or %o3, %o2, %o2
70*ac16ea89SKoakuma; V9-NEXT:    xor %o1, %o2, %o1
71*ac16ea89SKoakuma; V9-NEXT:    or %o0, %o1, %o0
72*ac16ea89SKoakuma; V9-NEXT:    fmovrqz %o0, %f4, %f0
73*ac16ea89SKoakuma; V9-NEXT:    retl
74*ac16ea89SKoakuma; V9-NEXT:    add %sp, 144, %sp
75*ac16ea89SKoakumaentry:
76*ac16ea89SKoakuma  %0 = bitcast fp128 %b to i128
77*ac16ea89SKoakuma  %xor.i = xor i128 %0, 0
78*ac16ea89SKoakuma  %cmp19.i = icmp eq i128 %xor.i, -170141183460469231731687303715884105728
79*ac16ea89SKoakuma  %spec.select277.i = select i1 %cmp19.i, fp128 0xL00000000000000007FFF800000000000, fp128 %a
80*ac16ea89SKoakuma  ret fp128 %spec.select277.i
81*ac16ea89SKoakuma}
82*ac16ea89SKoakuma
83*ac16ea89SKoakumaattributes #0 = { "target-features"="-hard-quad-float" }
84*ac16ea89SKoakumaattributes #1 = { "target-features"="+hard-quad-float" }
85