From: Uros Bizjak <ubizjak@gmail.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [PATCH, i386]: Use kortest instead of ktest in *cmp<mode>_ccz_1
Date: Wed, 19 Dec 2018 20:48:00 -0000 [thread overview]
Message-ID: <CAFULd4Ytu5n+2L1Ld0RaOKsSZJqyyC3ccm2vmh3JciK5PGVR_A@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 667 bytes --]
Hello!
Attached patch uses equivalent instruction, where HImode variant is
also enabled for plain AVX512F isa.
2018-12-19 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (SWI1248_AVX512BWDQ_64): Rename from
SWI1248_AVX512BWDQ2_64. Unconditionally enable HImode.
(*cmp<mode>_ccz_1): Emit kortest instead of ktest insn.
Use SWI1248_AVX512BWDQ_64 mode iterator and enable only for
TARGET_AVX512F.
testsuite/ChangeLog:
2018-12-19 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/avx512dq-pr82855.c: Update scan-assembler pattern.
Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
Committed to mailine SVN.
Uros.
[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 1750 bytes --]
Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md (revision 267276)
+++ config/i386/i386.md (working copy)
@@ -1244,20 +1244,20 @@
(compare:CC (match_operand:SWI48 0 "nonimmediate_operand")
(match_operand:SWI48 1 "<general_operand>")))])
-(define_mode_iterator SWI1248_AVX512BWDQ2_64
- [(QI "TARGET_AVX512DQ") (HI "TARGET_AVX512DQ")
+(define_mode_iterator SWI1248_AVX512BWDQ_64
+ [(QI "TARGET_AVX512DQ") HI
(SI "TARGET_AVX512BW") (DI "TARGET_AVX512BW && TARGET_64BIT")])
(define_insn "*cmp<mode>_ccz_1"
[(set (reg FLAGS_REG)
- (compare (match_operand:SWI1248_AVX512BWDQ2_64 0
+ (compare (match_operand:SWI1248_AVX512BWDQ_64 0
"nonimmediate_operand" "<r>,?m<r>,$k")
- (match_operand:SWI1248_AVX512BWDQ2_64 1 "const0_operand")))]
- "ix86_match_ccmode (insn, CCZmode)"
+ (match_operand:SWI1248_AVX512BWDQ_64 1 "const0_operand")))]
+ "TARGET_AVX512F && ix86_match_ccmode (insn, CCZmode)"
"@
test{<imodesuffix>}\t%0, %0
cmp{<imodesuffix>}\t{%1, %0|%0, %1}
- ktest<mskmodesuffix>\t%0, %0"
+ kortest<mskmodesuffix>\t%0, %0"
[(set_attr "type" "test,icmp,msklog")
(set_attr "length_immediate" "0,1,*")
(set_attr "prefix" "*,*,vex")
Index: testsuite/gcc.target/i386/avx512dq-pr82855.c
===================================================================
--- testsuite/gcc.target/i386/avx512dq-pr82855.c (revision 267276)
+++ testsuite/gcc.target/i386/avx512dq-pr82855.c (working copy)
@@ -1,7 +1,7 @@
/* PR target/82855 */
/* { dg-do compile } */
/* { dg-options "-O2 -mavx512vl -mavx512dq" } */
-/* { dg-final { scan-assembler {\mktestb\M} } } */
+/* { dg-final { scan-assembler {\mkortestb\M} } } */
#include <immintrin.h>
reply other threads:[~2018-12-19 20:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=CAFULd4Ytu5n+2L1Ld0RaOKsSZJqyyC3ccm2vmh3JciK5PGVR_A@mail.gmail.com \
--to=ubizjak@gmail.com \
--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).