2017-09-12 01:13:57 +08:00
|
|
|
# RUN: llc -march=amdgcn %s -run-pass twoaddressinstruction -verify-machineinstrs -o - | FileCheck -check-prefix=GCN %s
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madmk_reg_imm_f32
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: V_MADMK_F32 killed %0.sub0, 1078523331, killed %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
---
|
|
|
|
name: test_madmk_reg_imm_f32
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vreg_64 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
- { id: 3, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
%0 = IMPLICIT_DEF
|
|
|
|
%1 = COPY %0.sub1
|
2018-02-01 06:04:26 +08:00
|
|
|
%2 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%3 = V_MAC_F32_e32 killed %0.sub0, %2, killed %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madmk_imm_reg_f32
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: V_MADMK_F32 killed %0.sub0, 1078523331, killed %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
---
|
|
|
|
name: test_madmk_imm_reg_f32
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vreg_64 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
- { id: 3, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
%0 = IMPLICIT_DEF
|
|
|
|
%1 = COPY %0.sub1
|
2018-02-01 06:04:26 +08:00
|
|
|
%2 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%3 = V_MAC_F32_e32 %2, killed %0.sub0, killed %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madak_f32
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: V_MADAK_F32 killed %0.sub0, %0.sub1, 1078523331, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
---
|
|
|
|
name: test_madak_f32
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vreg_64 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
%0 = IMPLICIT_DEF
|
2018-02-01 06:04:26 +08:00
|
|
|
%1 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%2 = V_MAC_F32_e32 killed %0.sub0, %0.sub1, %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madmk_reg_imm_f16
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: V_MADMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
---
|
|
|
|
name: test_madmk_reg_imm_f16
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vreg_64 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
- { id: 3, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
%0 = IMPLICIT_DEF
|
|
|
|
%1 = COPY %0.sub1
|
2018-02-01 06:04:26 +08:00
|
|
|
%2 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%3 = V_MAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madmk_imm_reg_f16
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: V_MADMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
---
|
|
|
|
name: test_madmk_imm_reg_f16
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vreg_64 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
- { id: 3, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
%0 = IMPLICIT_DEF
|
|
|
|
%1 = COPY %0.sub1
|
2018-02-01 06:04:26 +08:00
|
|
|
%2 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%3 = V_MAC_F16_e32 %2, killed %0.sub0, killed %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madak_f16
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: V_MADAK_F16 killed %0.sub0, %0.sub1, 1078523331, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
---
|
|
|
|
name: test_madak_f16
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vreg_64 }
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
%0 = IMPLICIT_DEF
|
2018-02-01 06:04:26 +08:00
|
|
|
%1 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%2 = V_MAC_F16_e32 killed %0.sub0, %0.sub1, %1, implicit $exec
|
2017-09-12 01:13:57 +08:00
|
|
|
...
|
2017-09-15 04:54:29 +08:00
|
|
|
|
|
|
|
# Make sure constant bus restriction isn't violated if src0 is an SGPR.
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madak_sgpr_src0_f32
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: %1:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
# GCN: %2:vgpr_32 = V_MAD_F32 0, killed %0, 0, %1, 0, %3:vgpr_32, 0, 0, implicit $exec
|
2017-09-15 04:54:29 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: test_madak_sgpr_src0_f32
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: sreg_32_xm0 }
|
|
|
|
- { id: 1, class: vgpr_32}
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
- { id: 3, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
|
|
|
%0 = IMPLICIT_DEF
|
2018-02-01 06:04:26 +08:00
|
|
|
%1 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%2 = V_MAC_F32_e32 killed %0, %1, %3, implicit $exec
|
2017-09-15 04:54:29 +08:00
|
|
|
|
|
|
|
...
|
2017-09-21 08:45:59 +08:00
|
|
|
|
|
|
|
# This can still fold if this is an inline immediate.
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madak_inlineimm_src0_f32
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: %1:vgpr_32 = V_MADMK_F32 1073741824, 1078523331, %2:vgpr_32, implicit $exec
|
2017-09-21 08:45:59 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: test_madak_inlineimm_src0_f32
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vgpr_32}
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
%0 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%1 = V_MAC_F32_e32 1073741824, %0, %2, implicit $exec
|
2017-09-21 08:45:59 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
# Non-inline immediate uses constant bus already.
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madak_otherimm_src0_f32
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: %1:vgpr_32 = V_MAC_F32_e32 1120403456, %0, %1, implicit $exec
|
2017-09-21 08:45:59 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: test_madak_otherimm_src0_f32
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vgpr_32}
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
%0 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%1 = V_MAC_F32_e32 1120403456, %0, %2, implicit $exec
|
2017-09-21 08:45:59 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
# Non-inline immediate uses constant bus already.
|
|
|
|
|
|
|
|
# GCN-LABEL: name: test_madak_other_constantlike_src0_f32
|
2018-02-01 06:04:26 +08:00
|
|
|
# GCN: %1:vgpr_32 = V_MAC_F32_e32 %stack.0, %0, %1, implicit $exec
|
2017-09-21 08:45:59 +08:00
|
|
|
---
|
|
|
|
name: test_madak_other_constantlike_src0_f32
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: vgpr_32}
|
|
|
|
- { id: 1, class: vgpr_32 }
|
|
|
|
- { id: 2, class: vgpr_32 }
|
|
|
|
stack:
|
|
|
|
- { id: 0, name: "", type: default, offset: 0, size: 128, alignment: 8,
|
2018-04-26 02:58:06 +08:00
|
|
|
callee-saved-register: '', local-offset: 0, debug-info-variable: '',
|
|
|
|
debug-info-expression: '', debug-info-location: '' }
|
2017-09-21 08:45:59 +08:00
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
%0 = V_MOV_B32_e32 1078523331, implicit $exec
|
|
|
|
%1 = V_MAC_F32_e32 %stack.0, %0, %2, implicit $exec
|
2017-09-21 08:45:59 +08:00
|
|
|
|
|
|
|
...
|