1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=GFX6 %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=GFX9 %s
4 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=GFX9 %s
7 name: smax_neg_abs_pattern_s32_ss
10 tracksRegLiveness: true
16 ; GFX6-LABEL: name: smax_neg_abs_pattern_s32_ss
17 ; GFX6: liveins: $sgpr0
18 ; GFX6: %src0:sreg_32 = COPY $sgpr0
19 ; GFX6: %smax:sreg_32 = S_ABS_I32 %src0, implicit-def $scc
20 ; GFX6: S_ENDPGM 0, implicit %smax
21 ; GFX9-LABEL: name: smax_neg_abs_pattern_s32_ss
22 ; GFX9: liveins: $sgpr0
23 ; GFX9: %src0:sreg_32 = COPY $sgpr0
24 ; GFX9: %smax:sreg_32 = S_ABS_I32 %src0, implicit-def $scc
25 ; GFX9: S_ENDPGM 0, implicit %smax
26 %src0:sgpr(s32) = COPY $sgpr0
27 %zero:sgpr(s32) = G_CONSTANT i32 0
28 %ineg:sgpr(s32) = G_SUB %zero, %src0
29 %smax:sgpr(s32) = G_SMAX %src0, %ineg
30 S_ENDPGM 0, implicit %smax
34 name: smax_neg_abs_pattern_s32_ss_commute
37 tracksRegLiveness: true
43 ; GFX6-LABEL: name: smax_neg_abs_pattern_s32_ss_commute
44 ; GFX6: liveins: $sgpr0
45 ; GFX6: %src0:sreg_32 = COPY $sgpr0
46 ; GFX6: %smax:sreg_32 = S_ABS_I32 %src0, implicit-def $scc
47 ; GFX6: S_ENDPGM 0, implicit %smax
48 ; GFX9-LABEL: name: smax_neg_abs_pattern_s32_ss_commute
49 ; GFX9: liveins: $sgpr0
50 ; GFX9: %src0:sreg_32 = COPY $sgpr0
51 ; GFX9: %smax:sreg_32 = S_ABS_I32 %src0, implicit-def $scc
52 ; GFX9: S_ENDPGM 0, implicit %smax
53 %src0:sgpr(s32) = COPY $sgpr0
54 %zero:sgpr(s32) = G_CONSTANT i32 0
55 %ineg:sgpr(s32) = G_SUB %zero, %src0
56 %smax:sgpr(s32) = G_SMAX %ineg, %src0
57 S_ENDPGM 0, implicit %smax
61 name: smax_neg_abs_pattern_s32_vv
64 tracksRegLiveness: true
70 ; GFX6-LABEL: name: smax_neg_abs_pattern_s32_vv
71 ; GFX6: liveins: $vgpr0
72 ; GFX6: %src0:vgpr_32 = COPY $vgpr0
73 ; GFX6: %zero:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
74 ; GFX6: %ineg:vgpr_32, dead %4:sreg_64_xexec = V_SUB_CO_U32_e64 %zero, %src0, 0, implicit $exec
75 ; GFX6: %smax:vgpr_32 = V_MAX_I32_e64 %src0, %ineg, implicit $exec
76 ; GFX6: S_ENDPGM 0, implicit %smax
77 ; GFX9-LABEL: name: smax_neg_abs_pattern_s32_vv
78 ; GFX9: liveins: $vgpr0
79 ; GFX9: %src0:vgpr_32 = COPY $vgpr0
80 ; GFX9: %zero:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
81 ; GFX9: %ineg:vgpr_32 = V_SUB_U32_e64 %zero, %src0, 0, implicit $exec
82 ; GFX9: %smax:vgpr_32 = V_MAX_I32_e64 %src0, %ineg, implicit $exec
83 ; GFX9: S_ENDPGM 0, implicit %smax
84 %src0:vgpr(s32) = COPY $vgpr0
85 %zero:vgpr(s32) = G_CONSTANT i32 0
86 %ineg:vgpr(s32) = G_SUB %zero, %src0
87 %smax:vgpr(s32) = G_SMAX %src0, %ineg
88 S_ENDPGM 0, implicit %smax
91 # FIXME: Violates constant bus restriction
93 # name: smax_neg_abs_pattern_s32_vs
95 # regBankSelected: true
101 # %src0:sgpr(s32) = COPY $sgpr0
102 # %zero:sgpr(s32) = G_CONSTANT i32 0
103 # %ineg:sgpr(s32) = G_SUB %zero, %src0
104 # %smax:vgpr(s32) = G_SMAX %src0, %ineg
105 # S_ENDPGM 0, implicit %smax