public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386: Fix wrong result for AMX-TILE intrinsic when parsing expression.
@ 2021-11-04  1:18 Hongyu Wang
  2021-11-04  2:24 ` Hongtao Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Hongyu Wang @ 2021-11-04  1:18 UTC (permalink / raw)
  To: hongtao.liu; +Cc: gcc-patches

Hi,

_tile_loadd, _tile_stored, _tile_streamloadd intrinsics are defined by
macro, so the parameters should be wrapped by parentheses to accept
expressions.

Bootstraped/regtested on x86_64-pc-linux-gnu{-m32,} and sde.

OK for master and backport to GCC11 branch?

gcc/ChangeLog:

	* config/i386/amxtileintrin.h (_tile_loadd_internal): Add
	parentheses to base and stride.
	(_tile_stream_loadd_internal): Likewise.
	(_tile_stored_internal): Likewise.
---
 gcc/config/i386/amxtileintrin.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/i386/amxtileintrin.h b/gcc/config/i386/amxtileintrin.h
index 75d784ad160..3a0a6b44c17 100644
--- a/gcc/config/i386/amxtileintrin.h
+++ b/gcc/config/i386/amxtileintrin.h
@@ -62,7 +62,7 @@ _tile_release (void)
 #define _tile_loadd_internal(dst,base,stride)				\
   __asm__ volatile							\
   ("{tileloadd\t(%0,%1,1), %%tmm"#dst"|tileloadd\t%%tmm"#dst", [%0+%1*1]}" \
-   :: "r" ((const void*) base), "r" ((long) stride))
+   :: "r" ((const void*) (base)), "r" ((long) (stride)))
 
 #define _tile_stream_loadd(dst,base,stride)		\
   _tile_stream_loadd_internal (dst, base, stride)
@@ -70,7 +70,7 @@ _tile_release (void)
 #define _tile_stream_loadd_internal(dst,base,stride)			\
   __asm__ volatile							\
   ("{tileloaddt1\t(%0,%1,1), %%tmm"#dst"|tileloaddt1\t%%tmm"#dst", [%0+%1*1]}" \
-   :: "r" ((const void*) base), "r" ((long) stride))
+   :: "r" ((const void*) (base)), "r" ((long) (stride)))
 
 #define _tile_stored(dst,base,stride)		\
   _tile_stored_internal (dst, base, stride)
@@ -78,7 +78,7 @@ _tile_release (void)
 #define _tile_stored_internal(src,base,stride)				\
   __asm__ volatile							\
   ("{tilestored\t%%tmm"#src", (%0,%1,1)|tilestored\t[%0+%1*1], %%tmm"#src"}" \
-   :: "r" ((void*) base), "r" ((long) stride) \
+   :: "r" ((void*) (base)), "r" ((long) (stride)) \
    : "memory")
 
 #define _tile_zero(dst)				\
-- 
2.18.1


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

end of thread, other threads:[~2021-11-04  4:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04  1:18 [PATCH] i386: Fix wrong result for AMX-TILE intrinsic when parsing expression Hongyu Wang
2021-11-04  2:24 ` Hongtao Liu
2021-11-04  3:25   ` Hongyu Wang
2021-11-04  4:46     ` Hongtao Liu

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).