https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122119
Bug ID: 122119
Summary: [x86] invalid assembly for TILELOADDRS on MinGW
Product: gcc
Version: 14.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: thiago at kde dot org
Target Milestone: ---
The intrinsic for the tileloaddrs instruction is implemented in
amxmovrsintrin.h with inline assembly and it casts the stride to "long". On
Windows targets, long is 32-bit, so instead of generating "tileloaddrs
(%rax,%rbx,1), %tmm0", it generates "tileloaddrs (%rax,%ebx,1), %tmm0"
This results in assembler error:
test.s:383: Error: `(%rax,%ebx,1)' is not a valid base/index expression
I believe the problem is this.
#define _tile_loaddrs_internal(tdst, base, stride) \
__asm__ volatile \
("{tileloaddrs\t(%0,%1,1), %%tmm"#tdst \
"|tileloaddrs\t%%tmm"#tdst", [%0+%1*1]}" \
:: "r" ((const void*) (base)), "r" ((long) (stride)))
#define _tile_loaddrs(tdst, base, stride) \
_tile_loaddrs_internal(tdst, base, stride)
The casting of stride should be changed here.
The Clang equivalent casts to __SIZE_TYPE__. __PTRDIFF_TYPE__ is another
possibility.