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

AVX512: vgatherqps/vpgatherqd has incorrect memory operand.

Open igor-breger opened this issue 9 years ago • 6 comments

Bugzilla Link 31618
Resolution FIXED
Resolved on Jan 16, 2017 00:53
Version trunk
OS Windows NT
CC @topperc,@igor-breger,@RKSimon,@ZviRackover

Extended Description

vgatherqps/vpgatherqd has incorrect memory operand.

tests // CHECK: vgatherqps ymm8 {k2}, ymmword ptr [rdx+zmm3+256] // CHECK: # encoding: [0x62,0x72,0x7d,0x4a,0x93,0x44,0x1a,0x40] vgatherqps ymm8 {k2}, ymmword ptr [rdx+zmm3+256]

// CHECK: vgatherqps ymm8 {k2}, ymmword ptr [rdx+zmm34+256] // CHECK: # encoding: [0x62,0x72,0x7d,0x4a,0x93,0x44,0x9a,0x40] vgatherqps ymm8 {k2}, ymmword ptr [rdx+zmm34+256]

// CHECK: vgatherqps ymm8 {k2}, ymmword ptr [rdx+zmm34-256] // CHECK: # encoding: [0x62,0x72,0x7d,0x4a,0x93,0x44,0x9a,0xc0] vgatherqps ymm8 {k2}, ymmword ptr [rdx+zmm34-256]

// CHECK: vpgatherqd ymm8 {k2}, ymmword ptr [rdx+zmm3+256] // CHECK: # encoding: [0x62,0x72,0x7d,0x4a,0x91,0x44,0x1a,0x40] vpgatherqd ymm8 {k2}, ymmword ptr [rdx+zmm3+256]

// CHECK: vpgatherqd ymm8 {k2}, ymmword ptr [rdx+zmm34+256] // CHECK: # encoding: [0x62,0x72,0x7d,0x4a,0x91,0x44,0x9a,0x40] vpgatherqd ymm8 {k2}, ymmword ptr [rdx+zmm34+256]

// CHECK: vpgatherqd ymm8 {k2}, ymmword ptr [rdx+zmm34-256] // CHECK: # encoding: [0x62,0x72,0x7d,0x4a,0x91,0x44,0x9a,0xc0] vpgatherqd ymm8 {k2}, ymmword ptr [rdx+zmm34-256]

igor-breger avatar Jan 12 '17 14:01 igor-breger

Thanks for working on this issue!

igor-breger avatar Jan 16 '17 08:01 igor-breger

Fixed in r292088. Including scatter and the prefetch gather/scatter instructions.

The disassembler needs some help in this area too. I'm going to work on it now.

topperc avatar Jan 16 '17 02:01 topperc

I'll go ahead and work on fixing this unless you plan to.

topperc avatar Jan 15 '17 23:01 topperc

Memory operand of vgatherqps describe by vz512mem. For Intel syntax for example it is zmmword ptr[r14+zmm48+0x7b] , but for this instructions it should require ymmword ptr[r14+zmm48+0x7b]. vz256mem should be defined and used to describe vgatherqps/vpgatherqd.

igor-breger avatar Jan 15 '17 10:01 igor-breger

Can you be more specific about what's wrong? Just looking at the code its not obvious as gather is somewhat confusing to begin with.

topperc avatar Jan 12 '17 19:01 topperc

assigned to @topperc

igor-breger avatar Jan 12 '17 14:01 igor-breger