diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2016-06-15 03:09:39 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2016-06-15 03:09:39 +0000 |
commit | 82785e9fe7bd12d2ca05d6bf626b0784cb4c9a23 (patch) | |
tree | 4f1f6ae94422f9b9e1ab84b30b1ed3d5dd617fb2 /llvm/test/MC/AMDGPU/expressions.s | |
parent | e34ed833e50c279e2f25ce944404d3091ade5190 (diff) | |
download | bcm5719-llvm-82785e9fe7bd12d2ca05d6bf626b0784cb4c9a23.tar.gz bcm5719-llvm-82785e9fe7bd12d2ca05d6bf626b0784cb4c9a23.zip |
AMDGPU/SI: Correctly encode constant expressions
Summary:
We we have an MCConstantExpr, we can encode it directly into the instruction
instead of emitting fixups.
Reviewers: artem.tamazov, vpykhtin, SamWot, nhaustov, arsenm
Subscribers: arsenm, llvm-commits, kzhuravl
Differential Revision: http://reviews.llvm.org/D21236
Change-Id: I88b3edf288d48e65c5d705fc4850d281f8e36948
llvm-svn: 272750
Diffstat (limited to 'llvm/test/MC/AMDGPU/expressions.s')
-rw-r--r-- | llvm/test/MC/AMDGPU/expressions.s | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/MC/AMDGPU/expressions.s b/llvm/test/MC/AMDGPU/expressions.s index 0eba89bf2e1..9fc956628f1 100644 --- a/llvm/test/MC/AMDGPU/expressions.s +++ b/llvm/test/MC/AMDGPU/expressions.s @@ -29,3 +29,13 @@ s_add_u32 s0, s0, global+4 s_addc_u32 s1, s1, 0 // VI: s_add_u32 s0, s0, global+4 // VI: s_addc_u32 s1, s1, 0 + +// Use a computed expression that results in an inline immediate. +.set foo, 4 +s_mov_b32 s0, foo+2 +// VI: s_mov_b32 s0, 6 ; encoding: [0x86,0x00,0x80,0xbe] + +// Use a computed expression that results in a non-inline immediate. +.set foo, 512 +s_mov_b32 s0, foo+2 +// VI: s_mov_b32 s0, 514 ; encoding: [0xff,0x00,0x80,0xbe,0x02,0x02,0x00,0x00] |