public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/102166] New: [i386] AMX intrinsics and macros not defined in C++
@ 2021-09-01 22:27 thiago at kde dot org
  2021-09-01 22:33 ` [Bug target/102166] " thiago at kde dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: thiago at kde dot org @ 2021-09-01 22:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102166

            Bug ID: 102166
           Summary: [i386] AMX intrinsics and macros not defined in C++
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thiago at kde dot org
  Target Milestone: ---

$ cat test.cpp
#include <immintrin.h>

__attribute__((target("avx"))) void avx()
{
    _mm256_zeroall();
}

__attribute__((target("amx-tile"))) void amx()
{
    _tile_loadd(0, 0, 0);
    _tile_release();
}
$ gcc -c test.cpp
test.cpp: In function ‘void amx()’:
test.cpp:10:5: error: ‘_tile_loadd’ was not declared in this scope
   10 |     _tile_loadd(0, 0, 0);
      |     ^~~~~~~~~~~
test.cpp:11:5: error: ‘_tile_release’ was not declared in this scope
   11 |     _tile_release();
      |     ^~~~~~~~~~~~~

That's because the macros and intrinsics in amxtileintrin.h are only defined
behind:

#if defined(__x86_64__) && defined(__AMX_TILE__)

The __AMX_TILE__ macro isn't defined and doesn't need to be. None of the other
itnrinsics require compiling with -m options. In fact, code shouldn't use -m
options for things that are detected at runtime, like AMX inevitably has to be.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-03  5:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 22:27 [Bug target/102166] New: [i386] AMX intrinsics and macros not defined in C++ thiago at kde dot org
2021-09-01 22:33 ` [Bug target/102166] " thiago at kde dot org
2021-09-01 22:45 ` thiago at kde dot org
2021-09-01 23:10 ` thiago at kde dot org
2021-09-02  1:35 ` crazylht at gmail dot com
2021-09-02  3:31 ` thiago at kde dot org
2021-09-02  3:54 ` thiago at kde dot org
2021-09-02  3:55 ` crazylht at gmail dot com
2021-09-02  4:00 ` crazylht at gmail dot com
2021-09-02  4:02 ` thiago at kde dot org
2021-09-02  4:49 ` crazylht at gmail dot com
2021-09-03  5:04 ` cvs-commit at gcc dot gnu.org
2021-09-03  5:06 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).