Message ID | 20211104011843.97354-1-hongyu.wang@intel.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 776933858018 for <patchwork@sourceware.org>; Thu, 4 Nov 2021 01:19:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 776933858018 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635988755; bh=GByc7xmJalh5322jOeaSSn2KzCQzGmHhGLnnHjzsIcs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=TR4ebkSu0uA6SZJ3UR+eZgt82OWPSeFRYX5O+ttpD92T1u2tpguik0eu9a5QEqu/+ tgjBSv/Ut1Z+b90rZ84U7zUrODx1vRqHn2LkobX2eJZa/u20hhowQFoHiZwhPgQVp4 odGXrhYRtXOCvElcyIupiC7G5AS/nVxhScpPS158= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by sourceware.org (Postfix) with ESMTPS id D68573858C3A for <gcc-patches@gcc.gnu.org>; Thu, 4 Nov 2021 01:18:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D68573858C3A X-IronPort-AV: E=McAfee;i="6200,9189,10157"; a="317834322" X-IronPort-AV: E=Sophos;i="5.87,207,1631602800"; d="scan'208";a="317834322" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 18:18:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,207,1631602800"; d="scan'208";a="667729504" Received: from scymds01.sc.intel.com ([10.148.94.138]) by orsmga005.jf.intel.com with ESMTP; 03 Nov 2021 18:18:45 -0700 Received: from shliclel320.sh.intel.com (shliclel320.sh.intel.com [10.239.236.50]) by scymds01.sc.intel.com with ESMTP id 1A41Ih4S008597; Wed, 3 Nov 2021 18:18:44 -0700 To: hongtao.liu@intel.com Subject: [PATCH] i386: Fix wrong result for AMX-TILE intrinsic when parsing expression. Date: Thu, 4 Nov 2021 09:18:43 +0800 Message-Id: <20211104011843.97354-1-hongyu.wang@intel.com> X-Mailer: git-send-email 2.18.1 X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_SOFTFAIL, SPOOFED_FREEMAIL, TXREP, UNWANTED_LANGUAGE_BODY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Hongyu Wang via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Hongyu Wang <hongyu.wang@intel.com> Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
i386: Fix wrong result for AMX-TILE intrinsic when parsing expression.
|
|
Commit Message
Hongyu Wang
Nov. 4, 2021, 1:18 a.m. UTC
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(-)
Comments
On Thu, Nov 4, 2021 at 9:19 AM Hongyu Wang via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > 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? Could you add a testcase for that? > > 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 >
> Could you add a testcase for that? Yes, updated patch. Hongtao Liu via Gcc-patches <gcc-patches@gcc.gnu.org> 于2021年11月4日周四 上午10:25写道: > > On Thu, Nov 4, 2021 at 9:19 AM Hongyu Wang via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > 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? > Could you add a testcase for that? > > > > 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 > > > > > -- > BR, > Hongtao
On Thu, Nov 4, 2021 at 11:25 AM Hongyu Wang <wwwhhhyyy333@gmail.com> wrote: > > > Could you add a testcase for that? > > Yes, updated patch. > > Hongtao Liu via Gcc-patches <gcc-patches@gcc.gnu.org> 于2021年11月4日周四 上午10:25写道: > > > > On Thu, Nov 4, 2021 at 9:19 AM Hongyu Wang via Gcc-patches > > <gcc-patches@gcc.gnu.org> wrote: > > > > > > 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? LGTM. > > Could you add a testcase for that? > > > > > > 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 > > > > > > > > > -- > > BR, > > Hongtao
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) \