1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx1010 -enable-unsafe-fp-math -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=gfx1100 -enable-unsafe-fp-math -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
9 tracksRegLiveness: true
15 ; CHECK-LABEL: name: fract_f64_neg
16 ; CHECK: liveins: $sgpr0_sgpr1
18 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
19 ; CHECK-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]]:sgpr_128 = S_LOAD_DWORDX4_IMM [[COPY]], 36, 0 :: (dereferenceable invariant load (<2 x s64>), align 4, addrspace 4)
20 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY [[S_LOAD_DWORDX4_IMM]].sub0_sub1
21 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:sreg_64 = COPY [[S_LOAD_DWORDX4_IMM]].sub2_sub3
22 ; CHECK-NEXT: [[S_LOAD_DWORDX2_IMM:%[0-9]+]]:sreg_64_xexec = S_LOAD_DWORDX2_IMM [[COPY2]], 0, 0 :: (load (s64), addrspace 1)
23 ; CHECK-NEXT: [[S_MOV_B:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO -9223372036854775808
24 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vreg_64 = COPY [[S_MOV_B]]
25 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:vreg_64 = COPY [[S_LOAD_DWORDX2_IMM]]
26 ; CHECK-NEXT: [[V_ADD_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[COPY3]], 1, [[COPY4]], 0, 0, implicit $mode, implicit $exec
27 ; CHECK-NEXT: [[V_FLOOR_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_FLOOR_F64_e64 0, [[V_ADD_F64_e64_]], 0, 0, implicit $mode, implicit $exec
28 ; CHECK-NEXT: [[V_ADD_F64_e64_1:%[0-9]+]]:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[V_ADD_F64_e64_]], 1, [[V_FLOOR_F64_e64_]], 0, 0, implicit $mode, implicit $exec
29 ; CHECK-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
30 ; CHECK-NEXT: GLOBAL_STORE_DWORDX2_SADDR [[V_MOV_B32_e32_]], [[V_ADD_F64_e64_1]], [[COPY1]], 0, 0, implicit $exec :: (store (s64), addrspace 1)
31 ; CHECK-NEXT: S_ENDPGM 0
32 %2:sgpr(p4) = COPY $sgpr0_sgpr1
33 %7:sgpr(s64) = G_CONSTANT i64 36
34 %8:sgpr(p4) = G_PTR_ADD %2, %7(s64)
35 %9:sgpr(<2 x s64>) = G_LOAD %8(p4) :: (dereferenceable invariant load (<2 x s64>), align 4, addrspace 4)
36 %10:sgpr(s64), %13:sgpr(s64) = G_UNMERGE_VALUES %9(<2 x s64>)
37 %15:sgpr(p1) = G_INTTOPTR %13(s64)
38 %18:sgpr(s64) = G_LOAD %15(p1) :: (load (s64), addrspace 1)
39 %19:sgpr(s64) = G_FCONSTANT double -0.000000e+00
40 %24:sgpr(s64) = G_FNEG %18
41 %25:vgpr(s64) = COPY %19(s64)
42 %26:vgpr(s64) = COPY %24(s64)
43 %20:vgpr(s64) = G_FADD %25, %26
44 %21:vgpr(s64) = G_FFLOOR %20
45 %23:vgpr(s64) = G_FNEG %21
46 %22:vgpr(s64) = G_FADD %20, %23
47 %12:sgpr(p1) = G_INTTOPTR %10(s64)
48 %27:vgpr(p1) = COPY %12(p1)
49 G_STORE %22(s64), %27(p1) :: (store (s64), addrspace 1)
54 name: fract_f64_neg_abs
57 tracksRegLiveness: true
63 ; CHECK-LABEL: name: fract_f64_neg_abs
64 ; CHECK: liveins: $sgpr0_sgpr1
66 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
67 ; CHECK-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]]:sgpr_128 = S_LOAD_DWORDX4_IMM [[COPY]], 36, 0 :: (dereferenceable invariant load (<2 x s64>), align 4, addrspace 4)
68 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY [[S_LOAD_DWORDX4_IMM]].sub0_sub1
69 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:sreg_64 = COPY [[S_LOAD_DWORDX4_IMM]].sub2_sub3
70 ; CHECK-NEXT: [[S_LOAD_DWORDX2_IMM:%[0-9]+]]:sreg_64_xexec = S_LOAD_DWORDX2_IMM [[COPY2]], 0, 0 :: (load (s64), addrspace 1)
71 ; CHECK-NEXT: [[S_MOV_B:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO -9223372036854775808
72 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vreg_64 = COPY [[S_MOV_B]]
73 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:vreg_64 = COPY [[S_LOAD_DWORDX2_IMM]]
74 ; CHECK-NEXT: [[V_ADD_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[COPY3]], 3, [[COPY4]], 0, 0, implicit $mode, implicit $exec
75 ; CHECK-NEXT: [[V_FLOOR_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_FLOOR_F64_e64 0, [[V_ADD_F64_e64_]], 0, 0, implicit $mode, implicit $exec
76 ; CHECK-NEXT: [[V_ADD_F64_e64_1:%[0-9]+]]:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[V_ADD_F64_e64_]], 1, [[V_FLOOR_F64_e64_]], 0, 0, implicit $mode, implicit $exec
77 ; CHECK-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
78 ; CHECK-NEXT: GLOBAL_STORE_DWORDX2_SADDR [[V_MOV_B32_e32_]], [[V_ADD_F64_e64_1]], [[COPY1]], 0, 0, implicit $exec :: (store (s64), addrspace 1)
79 ; CHECK-NEXT: S_ENDPGM 0
80 %2:sgpr(p4) = COPY $sgpr0_sgpr1
81 %7:sgpr(s64) = G_CONSTANT i64 36
82 %8:sgpr(p4) = G_PTR_ADD %2, %7(s64)
83 %9:sgpr(<2 x s64>) = G_LOAD %8(p4) :: (dereferenceable invariant load (<2 x s64>), align 4, addrspace 4)
84 %10:sgpr(s64), %13:sgpr(s64) = G_UNMERGE_VALUES %9(<2 x s64>)
85 %15:sgpr(p1) = G_INTTOPTR %13(s64)
86 %18:sgpr(s64) = G_LOAD %15(p1) :: (load (s64), addrspace 1)
87 %19:sgpr(s64) = G_FABS %18
88 %20:sgpr(s64) = G_FCONSTANT double -0.000000e+00
89 %25:sgpr(s64) = G_FNEG %19
90 %26:vgpr(s64) = COPY %20(s64)
91 %27:vgpr(s64) = COPY %25(s64)
92 %21:vgpr(s64) = G_FADD %26, %27
93 %22:vgpr(s64) = G_FFLOOR %21
94 %24:vgpr(s64) = G_FNEG %22
95 %23:vgpr(s64) = G_FADD %21, %24
96 %12:sgpr(p1) = G_INTTOPTR %10(s64)
97 %28:vgpr(p1) = COPY %12(p1)
98 G_STORE %23(s64), %28(p1) :: (store (s64), addrspace 1)