1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -global-isel-abort=2 -pass-remarks-missed='gisel*' -verify-machineinstrs %s -o - 2>%t | FileCheck -check-prefix=SI %s
3 # RUN: FileCheck -check-prefix=ERR %s < %t
4 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=GFX9 %s
5 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=GFX9 %s
6 # RUN: llc -march=amdgcn -mcpu=gfx1100 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=GFX9 %s
9 # ERR: remark: <unknown>:0:0: cannot select: %2:sgpr(s32) = G_UMULH %0:sgpr, %1:sgpr (in function: umulh_s32_ss)
19 liveins: $sgpr0, $sgpr1
21 ; SI-LABEL: name: umulh_s32_ss
22 ; SI: liveins: $sgpr0, $sgpr1
24 ; SI-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
25 ; SI-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
26 ; SI-NEXT: [[UMULH:%[0-9]+]]:sgpr(s32) = G_UMULH [[COPY]], [[COPY1]]
27 ; SI-NEXT: S_ENDPGM 0, implicit [[UMULH]](s32)
28 ; GFX9-LABEL: name: umulh_s32_ss
29 ; GFX9: liveins: $sgpr0, $sgpr1
31 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
32 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
33 ; GFX9-NEXT: [[S_MUL_HI_U32_:%[0-9]+]]:sreg_32 = S_MUL_HI_U32 [[COPY]], [[COPY1]]
34 ; GFX9-NEXT: S_ENDPGM 0, implicit [[S_MUL_HI_U32_]]
35 %0:sgpr(s32) = COPY $sgpr0
36 %1:sgpr(s32) = COPY $sgpr1
37 %2:sgpr(s32) = G_UMULH %0, %1
38 S_ENDPGM 0, implicit %2
48 liveins: $sgpr0, $vgpr0
50 ; SI-LABEL: name: umulh_s32_sv
51 ; SI: liveins: $sgpr0, $vgpr0
53 ; SI-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
54 ; SI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
55 ; SI-NEXT: [[V_MUL_HI_U32_e64_:%[0-9]+]]:vgpr_32 = V_MUL_HI_U32_e64 [[COPY]], [[COPY1]], implicit $exec
56 ; SI-NEXT: S_ENDPGM 0, implicit [[V_MUL_HI_U32_e64_]]
57 ; GFX9-LABEL: name: umulh_s32_sv
58 ; GFX9: liveins: $sgpr0, $vgpr0
60 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
61 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
62 ; GFX9-NEXT: [[V_MUL_HI_U32_e64_:%[0-9]+]]:vgpr_32 = V_MUL_HI_U32_e64 [[COPY]], [[COPY1]], implicit $exec
63 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MUL_HI_U32_e64_]]
64 %0:sgpr(s32) = COPY $sgpr0
65 %1:vgpr(s32) = COPY $vgpr0
66 %2:vgpr(s32) = G_UMULH %0, %1
67 S_ENDPGM 0, implicit %2
77 liveins: $sgpr0, $vgpr0
79 ; SI-LABEL: name: umulh_s32_vs
80 ; SI: liveins: $sgpr0, $vgpr0
82 ; SI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
83 ; SI-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
84 ; SI-NEXT: [[V_MUL_HI_U32_e64_:%[0-9]+]]:vgpr_32 = V_MUL_HI_U32_e64 [[COPY]], [[COPY1]], implicit $exec
85 ; SI-NEXT: S_ENDPGM 0, implicit [[V_MUL_HI_U32_e64_]]
86 ; GFX9-LABEL: name: umulh_s32_vs
87 ; GFX9: liveins: $sgpr0, $vgpr0
89 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
90 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
91 ; GFX9-NEXT: [[V_MUL_HI_U32_e64_:%[0-9]+]]:vgpr_32 = V_MUL_HI_U32_e64 [[COPY]], [[COPY1]], implicit $exec
92 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MUL_HI_U32_e64_]]
93 %0:vgpr(s32) = COPY $vgpr0
94 %1:sgpr(s32) = COPY $sgpr0
95 %2:vgpr(s32) = G_UMULH %0, %1
96 S_ENDPGM 0, implicit %2
102 regBankSelected: true
106 liveins: $vgpr0, $vgpr1
108 ; SI-LABEL: name: umulh_s32_vv
109 ; SI: liveins: $vgpr0, $vgpr1
111 ; SI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
112 ; SI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
113 ; SI-NEXT: [[V_MUL_HI_U32_e64_:%[0-9]+]]:vgpr_32 = V_MUL_HI_U32_e64 [[COPY]], [[COPY1]], implicit $exec
114 ; SI-NEXT: S_ENDPGM 0, implicit [[V_MUL_HI_U32_e64_]]
115 ; GFX9-LABEL: name: umulh_s32_vv
116 ; GFX9: liveins: $vgpr0, $vgpr1
118 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
119 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
120 ; GFX9-NEXT: [[V_MUL_HI_U32_e64_:%[0-9]+]]:vgpr_32 = V_MUL_HI_U32_e64 [[COPY]], [[COPY1]], implicit $exec
121 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MUL_HI_U32_e64_]]
122 %0:vgpr(s32) = COPY $vgpr0
123 %1:vgpr(s32) = COPY $vgpr1
124 %2:vgpr(s32) = G_UMULH %0, %1
125 S_ENDPGM 0, implicit %2