* [PATCH, i386]: Use kortest instead of ktest in *cmp<mode>_ccz_1
@ 2018-12-19 20:48 Uros Bizjak
0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2018-12-19 20:48 UTC (permalink / raw)
To: gcc-patches
[-- 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>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-12-19 20:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19 20:48 [PATCH, i386]: Use kortest instead of ktest in *cmp<mode>_ccz_1 Uros Bizjak
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).