2018-12-18 17:19:03 +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:19:03 +08:00
|
|
|
|
|
|
|
---
|
2019-01-21 03:10:31 +08:00
|
|
|
name: test_fsub_s32
|
2018-12-18 17:19:03 +08:00
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0, $vgpr1
|
|
|
|
|
2019-01-21 03:10:31 +08:00
|
|
|
; SI-LABEL: name: test_fsub_s32
|
|
|
|
; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; SI: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[COPY1]]
|
|
|
|
; SI: $vgpr0 = COPY [[FSUB]](s32)
|
|
|
|
; VI-LABEL: name: test_fsub_s32
|
|
|
|
; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; VI: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[COPY1]]
|
|
|
|
; VI: $vgpr0 = COPY [[FSUB]](s32)
|
|
|
|
; GFX9-LABEL: name: test_fsub_s32
|
|
|
|
; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; GFX9: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[COPY1]]
|
|
|
|
; GFX9: $vgpr0 = COPY [[FSUB]](s32)
|
2018-12-18 17:19:03 +08:00
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s32) = COPY $vgpr1
|
|
|
|
%2:_(s32) = G_FSUB %0, %1
|
|
|
|
$vgpr0 = COPY %2
|
|
|
|
...
|
|
|
|
---
|
2019-01-21 03:10:31 +08:00
|
|
|
name: test_fsub_s64
|
2018-12-18 17:19:03 +08:00
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
|
|
|
|
|
2019-01-21 03:10:31 +08:00
|
|
|
; SI-LABEL: name: test_fsub_s64
|
|
|
|
; SI: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
|
|
|
|
; SI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; SI: [[FNEG:%[0-9]+]]:_(s64) = G_FNEG [[COPY1]]
|
|
|
|
; SI: [[FADD:%[0-9]+]]:_(s64) = G_FADD [[COPY]], [[FNEG]]
|
|
|
|
; SI: $vgpr0_vgpr1 = COPY [[FADD]](s64)
|
|
|
|
; VI-LABEL: name: test_fsub_s64
|
|
|
|
; VI: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
|
|
|
|
; VI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; VI: [[FNEG:%[0-9]+]]:_(s64) = G_FNEG [[COPY1]]
|
|
|
|
; VI: [[FADD:%[0-9]+]]:_(s64) = G_FADD [[COPY]], [[FNEG]]
|
|
|
|
; VI: $vgpr0_vgpr1 = COPY [[FADD]](s64)
|
|
|
|
; GFX9-LABEL: name: test_fsub_s64
|
|
|
|
; GFX9: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
|
|
|
|
; GFX9: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; GFX9: [[FNEG:%[0-9]+]]:_(s64) = G_FNEG [[COPY1]]
|
|
|
|
; GFX9: [[FADD:%[0-9]+]]:_(s64) = G_FADD [[COPY]], [[FNEG]]
|
|
|
|
; GFX9: $vgpr0_vgpr1 = COPY [[FADD]](s64)
|
2018-12-18 17:19:03 +08:00
|
|
|
%0:_(s64) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
%2:_(s64) = G_FSUB %0, %1
|
|
|
|
$vgpr0_vgpr1 = COPY %2
|
|
|
|
...
|
2019-01-21 03:10:31 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: test_fsub_s16
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0, $vgpr1
|
|
|
|
|
|
|
|
; SI-LABEL: name: test_fsub_s16
|
|
|
|
; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
|
|
|
|
; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
|
|
|
|
; SI: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC1]](s16)
|
|
|
|
; SI: [[FNEG:%[0-9]+]]:_(s32) = G_FNEG [[FPEXT]]
|
|
|
|
; SI: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEG]](s32)
|
|
|
|
; SI: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC]](s16)
|
|
|
|
; SI: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[FPTRUNC]](s16)
|
|
|
|
; SI: [[FADD:%[0-9]+]]:_(s32) = G_FADD [[FPEXT1]], [[FPEXT2]]
|
|
|
|
; SI: [[FPTRUNC1:%[0-9]+]]:_(s16) = G_FPTRUNC [[FADD]](s32)
|
|
|
|
; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC1]](s16)
|
|
|
|
; SI: $vgpr0 = COPY [[ANYEXT]](s32)
|
|
|
|
; VI-LABEL: name: test_fsub_s16
|
|
|
|
; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
|
|
|
|
; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
|
|
|
|
; VI: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC1]](s16)
|
|
|
|
; VI: [[FNEG:%[0-9]+]]:_(s32) = G_FNEG [[FPEXT]]
|
|
|
|
; VI: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEG]](s32)
|
|
|
|
; VI: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC]](s16)
|
|
|
|
; VI: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[FPTRUNC]](s16)
|
|
|
|
; VI: [[FADD:%[0-9]+]]:_(s32) = G_FADD [[FPEXT1]], [[FPEXT2]]
|
|
|
|
; VI: [[FPTRUNC1:%[0-9]+]]:_(s16) = G_FPTRUNC [[FADD]](s32)
|
|
|
|
; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC1]](s16)
|
|
|
|
; VI: $vgpr0 = COPY [[ANYEXT]](s32)
|
|
|
|
; GFX9-LABEL: name: test_fsub_s16
|
|
|
|
; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
|
|
|
|
; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
|
|
|
; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
|
|
|
|
; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
|
|
|
|
; GFX9: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC1]](s16)
|
|
|
|
; GFX9: [[FNEG:%[0-9]+]]:_(s32) = G_FNEG [[FPEXT]]
|
|
|
|
; GFX9: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEG]](s32)
|
|
|
|
; GFX9: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC]](s16)
|
|
|
|
; GFX9: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[FPTRUNC]](s16)
|
|
|
|
; GFX9: [[FADD:%[0-9]+]]:_(s32) = G_FADD [[FPEXT1]], [[FPEXT2]]
|
|
|
|
; GFX9: [[FPTRUNC1:%[0-9]+]]:_(s16) = G_FPTRUNC [[FADD]](s32)
|
|
|
|
; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC1]](s16)
|
|
|
|
; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
|
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s32) = COPY $vgpr1
|
|
|
|
%2:_(s16) = G_TRUNC %0
|
|
|
|
%3:_(s16) = G_TRUNC %1
|
|
|
|
|
|
|
|
%4:_(s16) = G_FSUB %2, %3
|
|
|
|
%5:_(s32) = G_ANYEXT %4
|
|
|
|
$vgpr0 = COPY %5
|
|
|
|
...
|