llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[mc] image_atomic -- issues with unorm (and other modifiers) and dmask.

Open atamazov opened this issue 10 years ago • 1 comments

Bugzilla Link 28239
Resolution FIXED
Resolved on Oct 12, 2018 09:03
Version trunk
OS Windows NT
Attachments 06156.tests_tg_gfx7_asm_lit1_bug.06.08.min.image_atomic_add_etc-modifiers-dmask.zip - TESTS NEED TO BE VERIFIED., More tests - 00539.tests_tg_gfx7_asm_lit1_bug.06.08.min.image_atomic_cmpswap-modifiers-dmask.zip - TESTS SHALL BE VERIFIED.
CC @atamazov,@dpreobra

Extended Description

It seems that unorm (and other modifiers) cannot be used without dmask:

image_atomic_add v0, v0, s[0:7] dmask:0xF unorm // ok image_atomic_add v0, v0, s[0:7] unorm // failed it is even more strange taking into account the fact that dmask may be omitted: image_atomic_add v0, v0, s[0:7] // ok

Another catch is that assembler produces the same encoding for V1 and V4 varieties of instructions, which is definitely wrong. Example:

image_atomic_umin v0, v0 , s[0:7] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x54,0xf0,0x00,0x00,0x00,0x00] image_atomic_umin v0, v[0:3], s[0:7] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x54,0xf0,0x00,0x00,0x00,0x00]

The issue needs to be carefully verified/investigated.

Some GFX7 lit tests attached. These tests are not guaranteed to be valid, though. Tested with r273139 (git # 4a94acfea8bfd6eb6b5809dd40f03e1fa42e673a)

atamazov avatar Jun 21 '16 17:06 atamazov

fixed

dpreobra avatar Oct 12 '18 16:10 dpreobra