diff options
author | Dmitry Preobrazhensky <dmitry.preobrazhensky@amd.com> | 2019-09-23 15:41:51 +0000 |
---|---|---|
committer | Dmitry Preobrazhensky <dmitry.preobrazhensky@amd.com> | 2019-09-23 15:41:51 +0000 |
commit | 6784a3cd793ad0de08896caa358a2d481b9e0c44 (patch) | |
tree | 280422d768950c9b77f81171d21c2fa0b4ff02d2 /llvm/test/MC/AMDGPU | |
parent | 511dbd83d63ce0cf95e3ac7d07eb9444d92a02e8 (diff) | |
download | bcm5719-llvm-6784a3cd793ad0de08896caa358a2d481b9e0c44.tar.gz bcm5719-llvm-6784a3cd793ad0de08896caa358a2d481b9e0c44.zip |
[AMDGPU][MC] Corrected handling of relocatable expressions
See bug 43359: https://bugs.llvm.org//show_bug.cgi?id=43359
Reviewers: rampitec
Differential Revision: https://reviews.llvm.org/D67829
llvm-svn: 372622
Diffstat (limited to 'llvm/test/MC/AMDGPU')
-rw-r--r-- | llvm/test/MC/AMDGPU/expressions-gfx10.s | 26 | ||||
-rw-r--r-- | llvm/test/MC/AMDGPU/expressions-gfx9.s | 17 |
2 files changed, 42 insertions, 1 deletions
diff --git a/llvm/test/MC/AMDGPU/expressions-gfx10.s b/llvm/test/MC/AMDGPU/expressions-gfx10.s index bca8444f80b..b3f051b819b 100644 --- a/llvm/test/MC/AMDGPU/expressions-gfx10.s +++ b/llvm/test/MC/AMDGPU/expressions-gfx10.s @@ -1,4 +1,5 @@ -// RUN: llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s | FileCheck %s --check-prefix=GFX10 +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s | FileCheck %s --check-prefix=GFX10 +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 %s 2>&1 | FileCheck -check-prefix=NOGFX10 %s i1=1 @@ -47,3 +48,26 @@ v_cmp_f_i32 s[10:11], u+1, v2 v_lshlrev_b64 v[5:6], u-1, v[2:3] // GFX10: v_lshlrev_b64 v[5:6], u-1, v[2:3] ; encoding: [0x05,0x00,0xff,0xd6,0xff,0x04,0x02,0x00,A,A,A,A] // GFX10-NEXT: ; fixup A - offset: 8, value: u-1, kind: FK_Data_4 + +//===----------------------------------------------------------------------===// +// Instructions can use only one literal. +// Relocatable expressions are counted as literals. +//===----------------------------------------------------------------------===// + +s_sub_u32 s0, 123, u +// NOGFX10: error: only one literal operand is allowed + +s_sub_u32 s0, u, u +// NOGFX10: error: only one literal operand is allowed + +s_sub_u32 s0, u, u1 +// NOGFX10: error: only one literal operand is allowed + +v_bfe_u32 v0, v2, 123, u +// NOGFX10: error: invalid literal operand + +v_bfe_u32 v0, v2, u, u +// NOGFX10: error: invalid literal operand + +v_bfe_u32 v0, v2, u, u1 +// NOGFX10: error: invalid literal operand diff --git a/llvm/test/MC/AMDGPU/expressions-gfx9.s b/llvm/test/MC/AMDGPU/expressions-gfx9.s index b1be72b019a..a52887596af 100644 --- a/llvm/test/MC/AMDGPU/expressions-gfx9.s +++ b/llvm/test/MC/AMDGPU/expressions-gfx9.s @@ -9,6 +9,23 @@ v_mov_b32_sdwa v1, sext(u) // NOGFX9: error: expected an absolute expression //===----------------------------------------------------------------------===// +// Instructions can use only one literal. +// Relocatable expressions are counted as literals. +//===----------------------------------------------------------------------===// + +s_sub_u32 s0, 123, u +// NOGFX9: error: only one literal operand is allowed + +s_sub_u32 s0, u, u +// NOGFX9: error: only one literal operand is allowed + +s_sub_u32 s0, u, u1 +// NOGFX9: error: only one literal operand is allowed + +v_bfe_u32 v0, v2, v3, u +// NOGFX9: error: invalid literal operand + +//===----------------------------------------------------------------------===// // Constant expressions may be used with 'sext' modifier //===----------------------------------------------------------------------===// |