diff options
author | Dmitry Preobrazhensky <dmitry.preobrazhensky@amd.com> | 2019-06-28 14:14:02 +0000 |
---|---|---|
committer | Dmitry Preobrazhensky <dmitry.preobrazhensky@amd.com> | 2019-06-28 14:14:02 +0000 |
commit | 1d572ce3955920be05d63c18ef1e0839930c515f (patch) | |
tree | 1874f0034d17faf43111517f9784dabed0fcfd47 /llvm/test/MC/AMDGPU | |
parent | a54e1a0f01233290624939927c82fdcac91667ec (diff) | |
download | bcm5719-llvm-1d572ce3955920be05d63c18ef1e0839930c515f.tar.gz bcm5719-llvm-1d572ce3955920be05d63c18ef1e0839930c515f.zip |
[AMDGPU][MC] Enabled constant expressions as operands of sendmsg
See bug 40820: https://bugs.llvm.org/show_bug.cgi?id=40820
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D62735
llvm-svn: 364645
Diffstat (limited to 'llvm/test/MC/AMDGPU')
-rw-r--r-- | llvm/test/MC/AMDGPU/sopp-err.s | 103 | ||||
-rw-r--r-- | llvm/test/MC/AMDGPU/sopp.s | 126 |
2 files changed, 178 insertions, 51 deletions
diff --git a/llvm/test/MC/AMDGPU/sopp-err.s b/llvm/test/MC/AMDGPU/sopp-err.s index c6df9df0090..69c0c86a63d 100644 --- a/llvm/test/MC/AMDGPU/sopp-err.s +++ b/llvm/test/MC/AMDGPU/sopp-err.s @@ -3,83 +3,112 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI --check-prefix=SICIVI %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN %s -s_sendmsg sendmsg(11) -// GCN: error: invalid/unsupported code of message +//===----------------------------------------------------------------------===// +// sendmsg +//===----------------------------------------------------------------------===// s_sendmsg sendmsg(MSG_INTERRUPTX) -// GCN: error: invalid/unsupported symbolic name of message +// GCN: error: expected absolute expression + +s_sendmsg sendmsg(1 -) +// GCN: error: unknown token in expression s_sendmsg sendmsg(MSG_INTERRUPT, 0) -// GCN: error: failed parsing operand +// GCN: error: message does not support operations + +s_sendmsg sendmsg(MSG_INTERRUPT, 0, 0) +// GCN: error: message does not support operations s_sendmsg sendmsg(MSG_GS) -// GCN: error: failed parsing operand +// GCN: error: missing message operation s_sendmsg sendmsg(MSG_GS, GS_OP_NOP) -// GCN: error: invalid GS_OP: NOP is for GS_DONE only +// GCN: error: invalid operation id + +s_sendmsg sendmsg(MSG_GS, SYSMSG_OP_ECC_ERR_INTERRUPT) +// GCN: error: expected absolute expression + +s_sendmsg sendmsg(MSG_GS, 0) +// GCN: error: invalid operation id + +s_sendmsg sendmsg(MSG_GS, -1) +// GCN: error: invalid operation id + +s_sendmsg sendmsg(MSG_GS, 4) +// GCN: error: invalid operation id + +s_sendmsg sendmsg(MSG_GS, 8) +// GCN: error: invalid operation id + +s_sendmsg sendmsg(15, -1) +// GCN: error: invalid operation id + +s_sendmsg sendmsg(15, 8) +// GCN: error: invalid operation id s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0, 0) -// GCN: error: failed parsing operand +// GCN: error: expected a closing parenthesis s_sendmsg sendmsg(MSG_GSX, GS_OP_CUT, 0) -// GCN: error: invalid/unsupported symbolic name of message +// GCN: error: expected absolute expression s_sendmsg sendmsg(MSG_GS, GS_OP_CUTX, 0) -// GCN: error: invalid symbolic name of GS_OP +// GCN: error: expected absolute expression -s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 4) -// GCN: error: invalid stream id: only 2-bit values are legal +s_sendmsg sendmsg(MSG_GS, 1 -) +// GCN: error: unknown token in expression -s_sendmsg sendmsg(2) -// GCN: error: failed parsing operand +s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 4) +// GCN: error: invalid message stream id -s_sendmsg sendmsg(2, 0) -// GCN: error: invalid GS_OP: NOP is for GS_DONE only +s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 1 -) +// GCN: error: unknown token in expression s_sendmsg sendmsg(2, 3, 0, 0) -// GCN: error: failed parsing operand +// GCN: error: expected a closing parenthesis -s_sendmsg sendmsg(2, 4, 1) -// GCN: error: invalid code of GS_OP: only 2-bit values are legal +s_sendmsg sendmsg(2, 2, -1) +// GCN: error: invalid message stream id s_sendmsg sendmsg(2, 2, 4) -// GCN: error: invalid stream id: only 2-bit values are legal +// GCN: error: invalid message stream id s_sendmsg sendmsg(2, 2, 0, 0) -// GCN: error: failed parsing operand +// GCN: error: expected a closing parenthesis s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP, 0) -// GCN: error: failed parsing operand +// GCN: error: message operation does not support streams + +s_sendmsg sendmsg(MSG_GS_DONE, 0, 0) +// GCN: error: message operation does not support streams s_sendmsg sendmsg(MSG_GS_ALLOC_REQ) -// SICIVI: error: invalid/unsupported symbolic name of message +// SICIVI: error: invalid message id s_sendmsg sendmsg(MSG_GS_ALLOC_REQ, 0) -// SICIVI: error: invalid/unsupported symbolic name of message - -s_sendmsg sendmsg(15) -// GCN: error: failed parsing operand +// SICIVI: error: invalid message id -s_sendmsg sendmsg(15, 1, 0) -// GCN: error: failed parsing operand +s_sendmsg sendmsg(-1) +// SICIVI: error: invalid message id -s_sendmsg sendmsg(15, 0) -// GCN: error: invalid/unsupported code of SYSMSG_OP - -s_sendmsg sendmsg(15, 5) -// GCN: error: invalid/unsupported code of SYSMSG_OP +s_sendmsg sendmsg(16) +// SICIVI: error: invalid message id s_sendmsg sendmsg(MSG_SYSMSG) -// GCN: error: failed parsing operand +// GCN: error: missing message operation s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT, 0) -// GCN: error: failed parsing operand +// GCN: error: message operation does not support streams s_sendmsg sendmsg(MSG_SYSMSG, 0) -// GCN: error: invalid/unsupported code of SYSMSG_OP +// GCN: error: invalid operation id s_sendmsg sendmsg(MSG_SYSMSG, 5) -// GCN: error: invalid/unsupported code of SYSMSG_OP +// GCN: error: invalid operation id + +//===----------------------------------------------------------------------===// +// waitcnt +//===----------------------------------------------------------------------===// s_waitcnt lgkmcnt(16) // SICIVI: error: too large value for lgkmcnt diff --git a/llvm/test/MC/AMDGPU/sopp.s b/llvm/test/MC/AMDGPU/sopp.s index 807a6d469a5..af683be06e5 100644 --- a/llvm/test/MC/AMDGPU/sopp.s +++ b/llvm/test/MC/AMDGPU/sopp.s @@ -167,8 +167,9 @@ s_sleep 10 s_setprio 1 // GCN: s_setprio 1 ; encoding: [0x01,0x00,0x8f,0xbf] -s_sendmsg 2 -// GCN: s_sendmsg 2 ; encoding: [0x02,0x00,0x90,0xbf] +//===----------------------------------------------------------------------===// +// s_sendmsg +//===----------------------------------------------------------------------===// s_sendmsg 0x1 // GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf] @@ -185,9 +186,21 @@ s_sendmsg 0x12 s_sendmsg sendmsg(2, 1) // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf] +s_sendmsg sendmsg(2, GS_OP_CUT) +// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf] + +s_sendmsg sendmsg(MSG_GS, GS_OP_CUT) +// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf] + s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf] +s_sendmsg sendmsg(MSG_GS, 1) +// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf] + +s_sendmsg sendmsg(MSG_GS, 1, 1) +// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 1) ; encoding: [0x12,0x01,0x90,0xbf] + s_sendmsg 0x122 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x90,0xbf] @@ -215,15 +228,6 @@ s_sendmsg sendmsg(3, 0) s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP) // GCN: s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x90,0xbf] -s_sendmsg 0x4 -// GCN: s_sendmsg 4 ; encoding: [0x04,0x00,0x90,0xbf] - -s_sendmsg 9 -// GCN: s_sendmsg 9 ; encoding: [0x09,0x00,0x90,0xbf] - -s_sendmsg 11 -// GCN: s_sendmsg 11 ; encoding: [0x0b,0x00,0x90,0xbf] - s_sendmsg 0x1f // GCN: s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT) ; encoding: [0x1f,0x00,0x90,0xbf] @@ -233,15 +237,109 @@ s_sendmsg sendmsg(15, 1) s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT) // GCN: s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT) ; encoding: [0x1f,0x00,0x90,0xbf] -s_sendmsg 0x6f -// GCN: s_sendmsg 111 ; encoding: [0x6f,0x00,0x90,0xbf] - s_sendmsghalt 3 // GCN: s_sendmsghalt sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x91,0xbf] s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT, 1) // GCN: s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x91,0xbf] +//===----------------------------------------------------------------------===// +// s_sendmsg with a numeric message id (no validation) +//===----------------------------------------------------------------------===// + +s_sendmsg 2 +// GCN: s_sendmsg sendmsg(2, 0, 0) ; encoding: [0x02,0x00,0x90,0xbf] + +s_sendmsg 0x4 +// GCN: s_sendmsg sendmsg(4, 0, 0) ; encoding: [0x04,0x00,0x90,0xbf] + +s_sendmsg 9 +// GCN: s_sendmsg sendmsg(9, 0, 0) ; encoding: [0x09,0x00,0x90,0xbf] + +s_sendmsg 11 +// GCN: s_sendmsg sendmsg(11, 0, 0) ; encoding: [0x0b,0x00,0x90,0xbf] + +s_sendmsg 0x6f +// GCN: s_sendmsg sendmsg(15, 6, 0) ; encoding: [0x6f,0x00,0x90,0xbf] + +s_sendmsg sendmsg(1, 3) +// GCN: s_sendmsg sendmsg(1, 3, 0) ; encoding: [0x31,0x00,0x90,0xbf] + +s_sendmsg sendmsg(1, 3, 2) +// GCN: s_sendmsg sendmsg(1, 3, 2) ; encoding: [0x31,0x02,0x90,0xbf] + +s_sendmsg sendmsg(2, 0, 1) +// GCN: s_sendmsg sendmsg(2, 0, 1) ; encoding: [0x02,0x01,0x90,0xbf] + +s_sendmsg sendmsg(15, 7, 3) +// GCN: s_sendmsg sendmsg(15, 7, 3) ; encoding: [0x7f,0x03,0x90,0xbf] + +s_sendmsg 4567 +// GCN: s_sendmsg 4567 ; encoding: [0xd7,0x11,0x90,0xbf] + +//===----------------------------------------------------------------------===// +// s_sendmsg with expressions +//===----------------------------------------------------------------------===// + +sendmsg=2 +s_sendmsg sendmsg +// GCN: s_sendmsg sendmsg(2, 0, 0) ; encoding: [0x02,0x00,0x90,0xbf] + +sendmsg=1 +s_sendmsg sendmsg+1 +// GCN: s_sendmsg sendmsg(2, 0, 0) ; encoding: [0x02,0x00,0x90,0xbf] + +s_sendmsg 1+sendmsg +// GCN: s_sendmsg sendmsg(2, 0, 0) ; encoding: [0x02,0x00,0x90,0xbf] + +msg=1 +s_sendmsg sendmsg(msg) +// GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf] + +msg=0 +s_sendmsg sendmsg(msg+1) +// GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf] + +msg=0 +s_sendmsg sendmsg(1+msg) +// GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf] + +msg=2 +op=1 +s_sendmsg sendmsg(msg, op) +// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf] + +msg=1 +op=0 +s_sendmsg sendmsg(msg+1, op+1) +// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf] + +msg=1 +op=0 +s_sendmsg sendmsg(1+msg, 1+op) +// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf] + +msg=1 +op=2 +stream=1 +s_sendmsg sendmsg(msg+1, op+1, stream+1) +// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2) ; encoding: [0x32,0x02,0x90,0xbf] + +msg=1 +op=2 +stream=1 +s_sendmsg sendmsg(1+msg, 1+op, 1+stream) +// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2) ; encoding: [0x32,0x02,0x90,0xbf] + +MSG_GS=-1 +GS_OP_EMIT=-1 +s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT, 1) +// GCN: s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x91,0xbf] + +//===----------------------------------------------------------------------===// +// misc sopp instructions +//===----------------------------------------------------------------------===// + s_trap 4 // GCN: s_trap 4 ; encoding: [0x04,0x00,0x92,0xbf] |