2018-12-18 17:39:56 +08:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
2019-01-21 03:10:31 +08:00
|
|
|
# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer %s -o - | FileCheck -check-prefix=SI %s
|
|
|
|
# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer %s -o - | FileCheck -check-prefix=VI %s
|
|
|
|
# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -run-pass=legalizer %s -o - | FileCheck -check-prefix=GFX9 %s
|
2018-12-18 17:39:56 +08:00
|
|
|
|
|
|
|
---
|
2019-01-21 03:10:31 +08:00
|
|
|
name: test_fma_s32
|
2018-12-18 17:39:56 +08:00
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0, $vgpr1, $vgpr2
|
|
|
|
|
2019-01-21 03:10:31 +08:00
|
|
|
; SI-LABEL: name: test_fma_s32
|
|
|
|
; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
|
|
|
|
; SI: [[FMA:%[0-9]+]]:_(s32) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
|
|
|
|
; SI: $vgpr0 = COPY [[FMA]](s32)
|
|
|
|
; VI-LABEL: name: test_fma_s32
|
|
|
|
; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
|
|
|
|
; VI: [[FMA:%[0-9]+]]:_(s32) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
|
|
|
|
; VI: $vgpr0 = COPY [[FMA]](s32)
|
|
|
|
; GFX9-LABEL: name: test_fma_s32
|
|
|
|
; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
|
|
|
|
; GFX9: [[FMA:%[0-9]+]]:_(s32) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
|
|
|
|
; GFX9: $vgpr0 = COPY [[FMA]](s32)
|
2018-12-18 17:39:56 +08:00
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s32) = COPY $vgpr1
|
|
|
|
%2:_(s32) = COPY $vgpr2
|
|
|
|
%3:_(s32) = G_FMA %0, %1, %2
|
|
|
|
$vgpr0 = COPY %3
|
|
|
|
...
|
|
|
|
---
|
2019-01-21 03:10:31 +08:00
|
|
|
name: test_fma_s64
|
2018-12-18 17:39:56 +08:00
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5
|
|
|
|
|
2019-01-21 03:10:31 +08:00
|
|
|
; SI-LABEL: name: test_fma_s64
|
|
|
|
; SI: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
|
|
|
|
; SI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; SI: [[COPY2:%[0-9]+]]:_(s64) = COPY $vgpr4_vgpr5
|
|
|
|
; SI: [[FMA:%[0-9]+]]:_(s64) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
|
|
|
|
; SI: $vgpr0_vgpr1 = COPY [[FMA]](s64)
|
|
|
|
; VI-LABEL: name: test_fma_s64
|
|
|
|
; VI: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
|
|
|
|
; VI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; VI: [[COPY2:%[0-9]+]]:_(s64) = COPY $vgpr4_vgpr5
|
|
|
|
; VI: [[FMA:%[0-9]+]]:_(s64) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
|
|
|
|
; VI: $vgpr0_vgpr1 = COPY [[FMA]](s64)
|
|
|
|
; GFX9-LABEL: name: test_fma_s64
|
|
|
|
; GFX9: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
|
|
|
|
; GFX9: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; GFX9: [[COPY2:%[0-9]+]]:_(s64) = COPY $vgpr4_vgpr5
|
|
|
|
; GFX9: [[FMA:%[0-9]+]]:_(s64) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
|
|
|
|
; GFX9: $vgpr0_vgpr1 = COPY [[FMA]](s64)
|
2018-12-18 17:39:56 +08:00
|
|
|
%0:_(s64) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
%2:_(s64) = COPY $vgpr4_vgpr5
|
|
|
|
%3:_(s64) = G_FMA %0, %1, %2
|
|
|
|
$vgpr0_vgpr1 = COPY %3
|
|
|
|
...
|
2019-01-21 03:10:31 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: test_fma_s16
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0, $vgpr1, $vgpr2
|
|
|
|
|
|
|
|
; SI-LABEL: name: test_fma_s16
|
|
|
|
; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
|
|
|
|
; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
|
|
|
|
; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY2]](s32)
|
|
|
|
; SI: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC]](s16)
|
|
|
|
; SI: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC1]](s16)
|
|
|
|
; SI: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC2]](s16)
|
|
|
|
; SI: [[FMA:%[0-9]+]]:_(s32) = G_FMA [[FPEXT]], [[FPEXT1]], [[FPEXT2]]
|
|
|
|
; SI: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FMA]](s32)
|
|
|
|
; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
|
|
|
|
; SI: $vgpr0 = COPY [[ANYEXT]](s32)
|
|
|
|
; VI-LABEL: name: test_fma_s16
|
|
|
|
; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
|
|
|
|
; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
|
|
|
|
; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY2]](s32)
|
|
|
|
; VI: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC]](s16)
|
|
|
|
; VI: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC1]](s16)
|
|
|
|
; VI: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC2]](s16)
|
|
|
|
; VI: [[FMA:%[0-9]+]]:_(s32) = G_FMA [[FPEXT]], [[FPEXT1]], [[FPEXT2]]
|
|
|
|
; VI: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FMA]](s32)
|
|
|
|
; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
|
|
|
|
; VI: $vgpr0 = COPY [[ANYEXT]](s32)
|
|
|
|
; GFX9-LABEL: name: test_fma_s16
|
|
|
|
; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
|
|
|
|
; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
|
|
|
|
; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY2]](s32)
|
|
|
|
; GFX9: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC]](s16)
|
|
|
|
; GFX9: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC1]](s16)
|
|
|
|
; GFX9: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC2]](s16)
|
|
|
|
; GFX9: [[FMA:%[0-9]+]]:_(s32) = G_FMA [[FPEXT]], [[FPEXT1]], [[FPEXT2]]
|
|
|
|
; GFX9: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FMA]](s32)
|
|
|
|
; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
|
|
|
|
; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
|
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s32) = COPY $vgpr1
|
|
|
|
%2:_(s32) = COPY $vgpr1
|
|
|
|
%3:_(s16) = G_TRUNC %0
|
|
|
|
%4:_(s16) = G_TRUNC %1
|
|
|
|
%5:_(s16) = G_TRUNC %2
|
|
|
|
|
|
|
|
%6:_(s16) = G_FMA %3, %4, %5
|
|
|
|
%7:_(s32) = G_ANYEXT %6
|
|
|
|
$vgpr0 = COPY %7
|
|
|
|
...
|