1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=2 -pass-remarks-missed='gisel*' %s -o /dev/null 2>&1 | FileCheck -check-prefix=VI-ERR %s
6 # VI-ERR: remark: <unknown>:0:0: cannot select: %6:vgpr(s16) = G_INTRINSIC intrinsic(@llvm.amdgcn.fmed3), %3:vgpr(s16), %4:vgpr(s16), %5:vgpr(s16) (in function: fmed3_s16_vvvv)
7 # VI-ERR-NEXT: remark: <unknown>:0:0: cannot select: %6:vgpr(s16) = G_INTRINSIC intrinsic(@llvm.amdgcn.fmed3), %3:sgpr(s16), %4:vgpr(s16), %5:vgpr(s16) (in function: fmed3_s16_vsvv)
13 tracksRegLiveness: true
17 liveins: $vgpr0, $vgpr1, $vgpr2
19 ; GCN-LABEL: name: fmed3_s16_vvvv
20 ; GCN: liveins: $vgpr0, $vgpr1, $vgpr2
22 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
23 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
24 ; GCN-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
25 ; GCN-NEXT: [[V_MED3_F16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MED3_F16_e64 0, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, 0, implicit $mode, implicit $exec
26 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_MED3_F16_e64_]]
27 %0:vgpr(s32) = COPY $vgpr0
28 %1:vgpr(s32) = COPY $vgpr1
29 %2:vgpr(s32) = COPY $vgpr2
30 %3:vgpr(s16) = G_TRUNC %0
31 %4:vgpr(s16) = G_TRUNC %1
32 %5:vgpr(s16) = G_TRUNC %2
33 %6:vgpr(s16) = G_INTRINSIC intrinsic(@llvm.amdgcn.fmed3), %3, %4, %5
34 S_ENDPGM 0, implicit %6
41 tracksRegLiveness: true
45 liveins: $sgpr0, $vgpr0, $vgpr1
47 ; GCN-LABEL: name: fmed3_s16_vsvv
48 ; GCN: liveins: $sgpr0, $vgpr0, $vgpr1
50 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
51 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
52 ; GCN-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr1
53 ; GCN-NEXT: [[V_MED3_F16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MED3_F16_e64 0, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, 0, implicit $mode, implicit $exec
54 ; GCN-NEXT: S_ENDPGM 0, implicit [[V_MED3_F16_e64_]]
55 %0:sgpr(s32) = COPY $sgpr0
56 %1:vgpr(s32) = COPY $vgpr0
57 %2:vgpr(s32) = COPY $vgpr1
58 %3:sgpr(s16) = G_TRUNC %0
59 %4:vgpr(s16) = G_TRUNC %1
60 %5:vgpr(s16) = G_TRUNC %2
61 %6:vgpr(s16) = G_INTRINSIC intrinsic(@llvm.amdgcn.fmed3), %3, %4, %5
62 S_ENDPGM 0, implicit %6