public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: GCC 11 backports
Date: Thu, 16 Dec 2021 12:46:03 +0100	[thread overview]
Message-ID: <fec26bb0-cf24-d50a-0862-453714356073@suse.cz> (raw)
In-Reply-To: <cb682183-3dee-7fe4-2944-7ae8eda35a91@suse.cz>

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

On 11/8/21 13:26, Martin Liška wrote:
> On 11/5/21 17:08, Martin Liška wrote:
>> On 8/23/21 10:54, Martin Liška wrote:
>>> On 8/16/21 13:13, Martin Liška wrote:
>>>> I'm going to apply the following 3 tested patches.
>>>>
>>>> Martin
>>>
>>> One more patch I've just tested.
>>>
>>> Martin
>>
>> And one more backport.
>>
>> Martin
> 
> One more tested patch.
> 
> Martin

And one more tested patch.

Martin

[-- Attachment #2: 0001-i386-Fix-emissing-of-__builtin_cpu_supports.patch --]
[-- Type: text/x-patch, Size: 1429 bytes --]

From d4e305e4498039b921070418069a68648188b196 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Mon, 13 Dec 2021 15:34:30 +0100
Subject: [PATCH] i386: Fix emissing of __builtin_cpu_supports.

	PR target/103661

gcc/ChangeLog:

	* config/i386/i386-builtins.c (fold_builtin_cpu): Compare to 0
	as API expects that non-zero values are returned (do that
	it mask == 31).
	For "avx512vbmi2" argument, we return now 1 << 31, which is a
	negative integer value.

(cherry picked from commit 127c7178d5ec502d95862fd823537cbca1a0cb99)
---
 gcc/config/i386/i386-builtins.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386-builtins.c b/gcc/config/i386/i386-builtins.c
index 128bd39816c..59575aea795 100644
--- a/gcc/config/i386/i386-builtins.c
+++ b/gcc/config/i386/i386-builtins.c
@@ -2236,7 +2236,11 @@ fold_builtin_cpu (tree fndecl, tree *args)
       /* Return __cpu_model.__cpu_features[0] & field_val  */
       final = build2 (BIT_AND_EXPR, unsigned_type_node, array_elt,
 		      build_int_cstu (unsigned_type_node, field_val));
-      return build1 (CONVERT_EXPR, integer_type_node, final);
+      if (isa_names_table[i].feature == (INT_TYPE_SIZE - 1))
+	return build2 (NE_EXPR, integer_type_node, final,
+		       build_int_cst (unsigned_type_node, 0));
+      else
+	return build1 (CONVERT_EXPR, integer_type_node, final);
     }
   gcc_unreachable ();
 }
-- 
2.34.1


  reply	other threads:[~2021-12-16 11:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 11:13 Martin Liška
2021-08-23  8:54 ` Martin Liška
2021-11-05 16:08   ` Martin Liška
2021-11-08 12:26     ` Martin Liška
2021-12-16 11:46       ` Martin Liška [this message]
2022-01-18 13:26         ` Martin Liška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fec26bb0-cf24-d50a-0862-453714356073@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).