On Fri, May 24, 2019 at 9:43 AM Uros Bizjak <ubiz...@gmail.com> wrote: > > On Fri, May 24, 2019 at 7:16 AM Hongtao Liu <crazy...@gmail.com> wrote: > > > > Hi Uros and all: > > This patch is about to enable support for ENQCMD(Enqueue Command) > > which will be in Willow Cove. > > There are two instructions for ENQCMD: ENQCMD and ENQCMDS. More > > details please refer to > > https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf > > > > Bootstrap is ok, and no regressions for i386/x86-64 testsuite. > > > > gcc/ChangeLog > > 2019-01-23 Xuepeng Guo <xuepeng....@intel.com> > > > > * common/config/i386/i386-common.c > > (OPTION_MASK_ISA_ENQCMD_SET, > > OPTION_MASK_ISA_ENQCMD_UNSET): New macros. > > (ix86_handle_option): Handle -menqcmd. > > * config.gcc (enqcmdintrin.h): New header file. > > * config/i386/cpuid.h (bit_ENQCMD): New bit. > > * config/i386/driver-i386.c (host_detect_local_cpu): Handle > > -menqcmd. > > * config/i386/i386-builtin-types.def ((INT, PVOID, PCVOID)): New > > function type. > > * config/i386/i386-builtin.def (__builtin_ia32_enqcmd, > > __builtin_ia32_enqcmds): New builtins. > > * config/i386/i386-c.c (__ENQCMD__): New macro. > > * config/i386/i386-option.c (ix86_target_string): Add > > -menqcmd. > > (ix86_valid_target_attribute_inner_p): Likewise. > > * config/i386/i386-expand.c > > (ix86_expand_builtin): Expand IX86_BUILTIN_ENQCMD and > > IX86_BUILTIN_ENQCMDS. > > * config/i386/i386.h (TARGET_ENQCMD): New. > > * config/i386/i386.md (UNSPECV_ENQCMD, UNSPECV_ENQCMDS): New. > > (@enqcmd<enqcmd_sfx>_<mode>): New insn pattern. > > (movdir64b_<mode>): Parameterize to enable share expansion code > > with ENQCMD in function ix86_expand_builtin. > > * config/i386/i386.opt: Add -menqcmd. > > * config/i386/immintrin.h: Include enqcmdintrin.h. > > * config/i386/enqcmdintrin.h: New intrinsic file. > > * doc/invoke.texi: Add -menqcmd. > > > > gcc/testsuite/ChangeLog > > > > 2019-01-23 Xuepeng Guo <xuepeng....@intel.com> > > > > * gcc.target/i386/enqcmd.c: New test. > > * gcc.target/i386/enqcmds.c: Likewise. > > * g++.dg/other/i386-2.C: Add -menqcmd. > > * g++.dg/other/i386-3.C: Likewise. > > * gcc.target/i386/sse-12.c: Likewise. > > * gcc.target/i386/sse-13.c: Likewise. > > * gcc.target/i386/sse-14.c: Likewise. > > * gcc.target/i386/sse-23.c: Likewise. > > OK for mainline with a small fix below. > > Thanks, > Uros. > > @@ -20321,7 +20325,7 @@ > "movdiri\t{%1, %0|%0, %1}" > [(set_attr "type" "other")]) > > -(define_insn "movdir64b_<mode>" > +(define_insn "@movdir64b<mode>" > [(unspec_volatile:XI [(match_operand:P 0 "register_operand" "r") > (match_operand:XI 1 "memory_operand")] > UNSPECV_MOVDIR64B)] > > No need to remove the underscore in the above name.
+ emit_insn (gen_movdir64b (GET_MODE (op0), op0, op1)); You can just use Pmode instead of GET_MODE here ... + if (fcode == IX86_BUILTIN_ENQCMD) + pat = gen_enqcmd (UNSPECV_ENQCMD, GET_MODE (op0), op0, op1); ... here ... + else + pat = gen_enqcmd (UNSPECV_ENQCMDS, GET_MODE (op0), op0, op1); ... and here.