[Bug target/114098] New: _tile_loadconfig doesn't work
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Feb 25 15:03:08 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114098
Bug ID: 114098
Summary: _tile_loadconfig doesn't work
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: crazylht at gmail dot com
Target Milestone: ---
Target: x86-64
[hjl@gnu-cfl-3 amx-1]$ cat foo.c
#include <stdint.h>
#include <x86intrin.h>
#define MAX_ROWS 16
#define MAX_COLS 64
#define MAX 1024
#define STRIDE 64
typedef struct __tile_config
{
uint8_t palette_id;
uint8_t start_row;
uint8_t reserved_0[14];
uint16_t colsb[16];
uint8_t rows[16];
} __tilecfg;
extern void bar (__tilecfg *tileinfo);
/* Initialize tile config */
static void
init_tile_config (__tilecfg *tileinfo)
{
int i;
tileinfo->palette_id = 1;
tileinfo->start_row = 0;
for (i = 0; i < 1; ++i)
{
tileinfo->colsb[i] = MAX_ROWS;
tileinfo->rows[i] = MAX_ROWS;
}
for (i = 1; i < 4; ++i)
{
tileinfo->colsb[i] = MAX_COLS;
tileinfo->rows[i] = MAX_ROWS;
}
_tile_loadconfig (tileinfo);
}
void
enable_amx (void)
{
__tilecfg tile_data = {0};
init_tile_config (&tile_data);
}
[hjl@gnu-cfl-3 amx-1]$ gcc -S -O2 -mamx-tile foo.c
[hjl@gnu-cfl-3 amx-1]$ cat foo.s
.file "foo.c"
.text
.p2align 4
.globl enable_amx
.type enable_amx, @function
enable_amx:
.LFB6615:
.cfi_startproc
movl $1, %eax <<<<<<<<<<<<< tile_data isn't properly initialized.
movw %ax, -72(%rsp)
#APP
# 42 "/usr/lib/gcc/x86_64-redhat-linux/13/include/amxtileintrin.h" 1
ldtilecfg -72(%rsp)
# 0 "" 2
#NO_APP
ret
.cfi_endproc
.LFE6615:
.size enable_amx, .-enable_amx
.ident "GCC: (GNU) 13.2.1 20231205 (Red Hat 13.2.1-6)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-3 amx-1]$
More information about the Gcc-bugs
mailing list