Split i386.c.
2019-05-06 Martin Liska <mliska@suse.cz> * config/i386/i386-builtins.c: New file. * config/i386/i386-builtins.h: New file. * config/i386/i386-expand.c: New file. * config/i386/i386-expand.h: New file. * config/i386/i386-features.c: New file. * config/i386/i386-features.h: New file. * config/i386/i386-options.c: New file. * config/i386/i386-options.h: New file. * config.gcc: Add new files into extra_objs and target_gtfiles. * config/i386/i386.c: Split content of the file into newly introduced files. * config/i386/i386.h: Declare common variables and macros. * config/i386/t-i386: Define dependencies for new files. From-SVN: r270895
This commit is contained in:
parent
94adc935af
commit
2bf6d93547
13 changed files with 29588 additions and 28958 deletions
|
@ -1,3 +1,21 @@
|
|||
2019-05-06 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* config/i386/i386-builtins.c: New file.
|
||||
* config/i386/i386-builtins.h: New file.
|
||||
* config/i386/i386-expand.c: New file.
|
||||
* config/i386/i386-expand.h: New file.
|
||||
* config/i386/i386-features.c: New file.
|
||||
* config/i386/i386-features.h: New file.
|
||||
* config/i386/i386-options.c: New file.
|
||||
* config/i386/i386-options.h: New file.
|
||||
* config.gcc: Add new files into extra_objs and
|
||||
target_gtfiles.
|
||||
* config/i386/i386.c: Split content of the file
|
||||
into newly introduced files.
|
||||
* config/i386/i386.h: Declare common variables
|
||||
and macros.
|
||||
* config/i386/t-i386: Define dependencies for new files.
|
||||
|
||||
2019-05-06 Li Jia He <helijia@linux.ibm.com>
|
||||
|
||||
* tree-ssa-phiopt.c (two_value_replacement): Fix a typo in parameter
|
||||
|
|
|
@ -382,7 +382,8 @@ i[34567]86-*-*)
|
|||
c_target_objs="i386-c.o"
|
||||
cxx_target_objs="i386-c.o"
|
||||
d_target_objs="i386-d.o"
|
||||
extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o"
|
||||
extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o i386-options.o i386-builtins.o i386-expand.o i386-features.o"
|
||||
target_gtfiles="\$(srcdir)/config/i386/i386-builtins.c \$(srcdir)/config/i386/i386-expand.c \$(srcdir)/config/i386/i386-options.c"
|
||||
extra_options="${extra_options} fused-madd.opt"
|
||||
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
|
||||
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
|
||||
|
@ -414,7 +415,8 @@ x86_64-*-*)
|
|||
cxx_target_objs="i386-c.o"
|
||||
d_target_objs="i386-d.o"
|
||||
extra_options="${extra_options} fused-madd.opt"
|
||||
extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o"
|
||||
extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o i386-options.o i386-builtins.o i386-expand.o i386-features.o"
|
||||
target_gtfiles="\$(srcdir)/config/i386/i386-builtins.c \$(srcdir)/config/i386/i386-expand.c \$(srcdir)/config/i386/i386-options.c"
|
||||
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
|
||||
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
|
||||
nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
|
||||
|
|
2539
gcc/config/i386/i386-builtins.c
Normal file
2539
gcc/config/i386/i386-builtins.c
Normal file
File diff suppressed because it is too large
Load diff
330
gcc/config/i386/i386-builtins.h
Normal file
330
gcc/config/i386/i386-builtins.h
Normal file
|
@ -0,0 +1,330 @@
|
|||
/* Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_I386_BUILTINS_H
|
||||
#define GCC_I386_BUILTINS_H
|
||||
|
||||
/* The following file contains several enumerations and data structures
|
||||
built from the definitions in i386-builtin-types.def. */
|
||||
|
||||
#include "i386-builtin-types.inc"
|
||||
|
||||
/* Codes for all the SSE/MMX builtins. Builtins not mentioned in any
|
||||
bdesc_* arrays below should come first, then builtins for each bdesc_*
|
||||
array in ascending order, so that we can use direct array accesses. */
|
||||
enum ix86_builtins
|
||||
{
|
||||
IX86_BUILTIN_MASKMOVQ,
|
||||
IX86_BUILTIN_LDMXCSR,
|
||||
IX86_BUILTIN_STMXCSR,
|
||||
IX86_BUILTIN_MASKMOVDQU,
|
||||
IX86_BUILTIN_PSLLDQ128,
|
||||
IX86_BUILTIN_CLFLUSH,
|
||||
IX86_BUILTIN_MONITOR,
|
||||
IX86_BUILTIN_MWAIT,
|
||||
IX86_BUILTIN_UMONITOR,
|
||||
IX86_BUILTIN_UMWAIT,
|
||||
IX86_BUILTIN_TPAUSE,
|
||||
IX86_BUILTIN_CLZERO,
|
||||
IX86_BUILTIN_CLDEMOTE,
|
||||
IX86_BUILTIN_VEC_INIT_V2SI,
|
||||
IX86_BUILTIN_VEC_INIT_V4HI,
|
||||
IX86_BUILTIN_VEC_INIT_V8QI,
|
||||
IX86_BUILTIN_VEC_EXT_V2DF,
|
||||
IX86_BUILTIN_VEC_EXT_V2DI,
|
||||
IX86_BUILTIN_VEC_EXT_V4SF,
|
||||
IX86_BUILTIN_VEC_EXT_V4SI,
|
||||
IX86_BUILTIN_VEC_EXT_V8HI,
|
||||
IX86_BUILTIN_VEC_EXT_V2SI,
|
||||
IX86_BUILTIN_VEC_EXT_V4HI,
|
||||
IX86_BUILTIN_VEC_EXT_V16QI,
|
||||
IX86_BUILTIN_VEC_SET_V2DI,
|
||||
IX86_BUILTIN_VEC_SET_V4SF,
|
||||
IX86_BUILTIN_VEC_SET_V4SI,
|
||||
IX86_BUILTIN_VEC_SET_V8HI,
|
||||
IX86_BUILTIN_VEC_SET_V4HI,
|
||||
IX86_BUILTIN_VEC_SET_V16QI,
|
||||
IX86_BUILTIN_GATHERSIV2DF,
|
||||
IX86_BUILTIN_GATHERSIV4DF,
|
||||
IX86_BUILTIN_GATHERDIV2DF,
|
||||
IX86_BUILTIN_GATHERDIV4DF,
|
||||
IX86_BUILTIN_GATHERSIV4SF,
|
||||
IX86_BUILTIN_GATHERSIV8SF,
|
||||
IX86_BUILTIN_GATHERDIV4SF,
|
||||
IX86_BUILTIN_GATHERDIV8SF,
|
||||
IX86_BUILTIN_GATHERSIV2DI,
|
||||
IX86_BUILTIN_GATHERSIV4DI,
|
||||
IX86_BUILTIN_GATHERDIV2DI,
|
||||
IX86_BUILTIN_GATHERDIV4DI,
|
||||
IX86_BUILTIN_GATHERSIV4SI,
|
||||
IX86_BUILTIN_GATHERSIV8SI,
|
||||
IX86_BUILTIN_GATHERDIV4SI,
|
||||
IX86_BUILTIN_GATHERDIV8SI,
|
||||
IX86_BUILTIN_GATHER3SIV8SF,
|
||||
IX86_BUILTIN_GATHER3SIV4SF,
|
||||
IX86_BUILTIN_GATHER3SIV4DF,
|
||||
IX86_BUILTIN_GATHER3SIV2DF,
|
||||
IX86_BUILTIN_GATHER3DIV8SF,
|
||||
IX86_BUILTIN_GATHER3DIV4SF,
|
||||
IX86_BUILTIN_GATHER3DIV4DF,
|
||||
IX86_BUILTIN_GATHER3DIV2DF,
|
||||
IX86_BUILTIN_GATHER3SIV8SI,
|
||||
IX86_BUILTIN_GATHER3SIV4SI,
|
||||
IX86_BUILTIN_GATHER3SIV4DI,
|
||||
IX86_BUILTIN_GATHER3SIV2DI,
|
||||
IX86_BUILTIN_GATHER3DIV8SI,
|
||||
IX86_BUILTIN_GATHER3DIV4SI,
|
||||
IX86_BUILTIN_GATHER3DIV4DI,
|
||||
IX86_BUILTIN_GATHER3DIV2DI,
|
||||
IX86_BUILTIN_SCATTERSIV8SF,
|
||||
IX86_BUILTIN_SCATTERSIV4SF,
|
||||
IX86_BUILTIN_SCATTERSIV4DF,
|
||||
IX86_BUILTIN_SCATTERSIV2DF,
|
||||
IX86_BUILTIN_SCATTERDIV8SF,
|
||||
IX86_BUILTIN_SCATTERDIV4SF,
|
||||
IX86_BUILTIN_SCATTERDIV4DF,
|
||||
IX86_BUILTIN_SCATTERDIV2DF,
|
||||
IX86_BUILTIN_SCATTERSIV8SI,
|
||||
IX86_BUILTIN_SCATTERSIV4SI,
|
||||
IX86_BUILTIN_SCATTERSIV4DI,
|
||||
IX86_BUILTIN_SCATTERSIV2DI,
|
||||
IX86_BUILTIN_SCATTERDIV8SI,
|
||||
IX86_BUILTIN_SCATTERDIV4SI,
|
||||
IX86_BUILTIN_SCATTERDIV4DI,
|
||||
IX86_BUILTIN_SCATTERDIV2DI,
|
||||
/* Alternate 4 and 8 element gather/scatter for the vectorizer
|
||||
where all operands are 32-byte or 64-byte wide respectively. */
|
||||
IX86_BUILTIN_GATHERALTSIV4DF,
|
||||
IX86_BUILTIN_GATHERALTDIV8SF,
|
||||
IX86_BUILTIN_GATHERALTSIV4DI,
|
||||
IX86_BUILTIN_GATHERALTDIV8SI,
|
||||
IX86_BUILTIN_GATHER3ALTDIV16SF,
|
||||
IX86_BUILTIN_GATHER3ALTDIV16SI,
|
||||
IX86_BUILTIN_GATHER3ALTSIV4DF,
|
||||
IX86_BUILTIN_GATHER3ALTDIV8SF,
|
||||
IX86_BUILTIN_GATHER3ALTSIV4DI,
|
||||
IX86_BUILTIN_GATHER3ALTDIV8SI,
|
||||
IX86_BUILTIN_GATHER3ALTSIV8DF,
|
||||
IX86_BUILTIN_GATHER3ALTSIV8DI,
|
||||
IX86_BUILTIN_GATHER3DIV16SF,
|
||||
IX86_BUILTIN_GATHER3DIV16SI,
|
||||
IX86_BUILTIN_GATHER3DIV8DF,
|
||||
IX86_BUILTIN_GATHER3DIV8DI,
|
||||
IX86_BUILTIN_GATHER3SIV16SF,
|
||||
IX86_BUILTIN_GATHER3SIV16SI,
|
||||
IX86_BUILTIN_GATHER3SIV8DF,
|
||||
IX86_BUILTIN_GATHER3SIV8DI,
|
||||
IX86_BUILTIN_SCATTERALTSIV8DF,
|
||||
IX86_BUILTIN_SCATTERALTDIV16SF,
|
||||
IX86_BUILTIN_SCATTERALTSIV8DI,
|
||||
IX86_BUILTIN_SCATTERALTDIV16SI,
|
||||
IX86_BUILTIN_SCATTERALTSIV4DF,
|
||||
IX86_BUILTIN_SCATTERALTDIV8SF,
|
||||
IX86_BUILTIN_SCATTERALTSIV4DI,
|
||||
IX86_BUILTIN_SCATTERALTDIV8SI,
|
||||
IX86_BUILTIN_SCATTERALTSIV2DF,
|
||||
IX86_BUILTIN_SCATTERALTDIV4SF,
|
||||
IX86_BUILTIN_SCATTERALTSIV2DI,
|
||||
IX86_BUILTIN_SCATTERALTDIV4SI,
|
||||
IX86_BUILTIN_SCATTERDIV16SF,
|
||||
IX86_BUILTIN_SCATTERDIV16SI,
|
||||
IX86_BUILTIN_SCATTERDIV8DF,
|
||||
IX86_BUILTIN_SCATTERDIV8DI,
|
||||
IX86_BUILTIN_SCATTERSIV16SF,
|
||||
IX86_BUILTIN_SCATTERSIV16SI,
|
||||
IX86_BUILTIN_SCATTERSIV8DF,
|
||||
IX86_BUILTIN_SCATTERSIV8DI,
|
||||
IX86_BUILTIN_GATHERPFQPD,
|
||||
IX86_BUILTIN_GATHERPFDPS,
|
||||
IX86_BUILTIN_GATHERPFDPD,
|
||||
IX86_BUILTIN_GATHERPFQPS,
|
||||
IX86_BUILTIN_SCATTERPFDPD,
|
||||
IX86_BUILTIN_SCATTERPFDPS,
|
||||
IX86_BUILTIN_SCATTERPFQPD,
|
||||
IX86_BUILTIN_SCATTERPFQPS,
|
||||
IX86_BUILTIN_CLWB,
|
||||
IX86_BUILTIN_CLFLUSHOPT,
|
||||
IX86_BUILTIN_INFQ,
|
||||
IX86_BUILTIN_HUGE_VALQ,
|
||||
IX86_BUILTIN_NANQ,
|
||||
IX86_BUILTIN_NANSQ,
|
||||
IX86_BUILTIN_XABORT,
|
||||
IX86_BUILTIN_ADDCARRYX32,
|
||||
IX86_BUILTIN_ADDCARRYX64,
|
||||
IX86_BUILTIN_SBB32,
|
||||
IX86_BUILTIN_SBB64,
|
||||
IX86_BUILTIN_RDRAND16_STEP,
|
||||
IX86_BUILTIN_RDRAND32_STEP,
|
||||
IX86_BUILTIN_RDRAND64_STEP,
|
||||
IX86_BUILTIN_RDSEED16_STEP,
|
||||
IX86_BUILTIN_RDSEED32_STEP,
|
||||
IX86_BUILTIN_RDSEED64_STEP,
|
||||
IX86_BUILTIN_MONITORX,
|
||||
IX86_BUILTIN_MWAITX,
|
||||
IX86_BUILTIN_CFSTRING,
|
||||
IX86_BUILTIN_CPU_INIT,
|
||||
IX86_BUILTIN_CPU_IS,
|
||||
IX86_BUILTIN_CPU_SUPPORTS,
|
||||
IX86_BUILTIN_READ_FLAGS,
|
||||
IX86_BUILTIN_WRITE_FLAGS,
|
||||
|
||||
/* All the remaining builtins are tracked in bdesc_* arrays in
|
||||
i386-builtin.def. Don't add any IX86_BUILTIN_* enumerators after
|
||||
this point. */
|
||||
#define BDESC(mask, mask2, icode, name, code, comparison, flag) \
|
||||
code,
|
||||
#define BDESC_FIRST(kind, kindu, mask, mask2, icode, name, code, comparison, flag) \
|
||||
code, \
|
||||
IX86_BUILTIN__BDESC_##kindu##_FIRST = code,
|
||||
#define BDESC_END(kind, next_kind)
|
||||
|
||||
#include "i386-builtin.def"
|
||||
|
||||
#undef BDESC
|
||||
#undef BDESC_FIRST
|
||||
#undef BDESC_END
|
||||
|
||||
IX86_BUILTIN_MAX,
|
||||
|
||||
IX86_BUILTIN__BDESC_MAX_FIRST = IX86_BUILTIN_MAX,
|
||||
|
||||
/* Now just the aliases for bdesc_* start/end. */
|
||||
#define BDESC(mask, mask2, icode, name, code, comparison, flag)
|
||||
#define BDESC_FIRST(kind, kindu, mask, mask2, icode, name, code, comparison, flag)
|
||||
#define BDESC_END(kind, next_kind) \
|
||||
IX86_BUILTIN__BDESC_##kind##_LAST \
|
||||
= IX86_BUILTIN__BDESC_##next_kind##_FIRST - 1,
|
||||
|
||||
#include "i386-builtin.def"
|
||||
|
||||
#undef BDESC
|
||||
#undef BDESC_FIRST
|
||||
#undef BDESC_END
|
||||
|
||||
/* Just to make sure there is no comma after the last enumerator. */
|
||||
IX86_BUILTIN__BDESC_MAX_LAST = IX86_BUILTIN__BDESC_MAX_FIRST
|
||||
};
|
||||
|
||||
/* Table of all of the builtin functions that are possible with different ISA's
|
||||
but are waiting to be built until a function is declared to use that
|
||||
ISA. */
|
||||
struct builtin_isa {
|
||||
HOST_WIDE_INT isa; /* isa_flags this builtin is defined for */
|
||||
HOST_WIDE_INT isa2; /* additional isa_flags this builtin is defined for */
|
||||
const char *name; /* function name */
|
||||
enum ix86_builtin_func_type tcode; /* type to use in the declaration */
|
||||
unsigned char const_p:1; /* true if the declaration is constant */
|
||||
unsigned char pure_p:1; /* true if the declaration has pure attribute */
|
||||
bool set_and_not_built_p;
|
||||
};
|
||||
|
||||
/* Bits for builtin_description.flag. */
|
||||
|
||||
/* Set when we don't support the comparison natively, and should
|
||||
swap_comparison in order to support it. */
|
||||
#define BUILTIN_DESC_SWAP_OPERANDS 1
|
||||
|
||||
struct builtin_description
|
||||
{
|
||||
const HOST_WIDE_INT mask;
|
||||
const HOST_WIDE_INT mask2;
|
||||
const enum insn_code icode;
|
||||
const char *const name;
|
||||
const enum ix86_builtins code;
|
||||
const enum rtx_code comparison;
|
||||
const int flag;
|
||||
};
|
||||
|
||||
#define MULTI_ARG_4_DF2_DI_I V2DF_FTYPE_V2DF_V2DF_V2DI_INT
|
||||
#define MULTI_ARG_4_DF2_DI_I1 V4DF_FTYPE_V4DF_V4DF_V4DI_INT
|
||||
#define MULTI_ARG_4_SF2_SI_I V4SF_FTYPE_V4SF_V4SF_V4SI_INT
|
||||
#define MULTI_ARG_4_SF2_SI_I1 V8SF_FTYPE_V8SF_V8SF_V8SI_INT
|
||||
#define MULTI_ARG_3_SF V4SF_FTYPE_V4SF_V4SF_V4SF
|
||||
#define MULTI_ARG_3_DF V2DF_FTYPE_V2DF_V2DF_V2DF
|
||||
#define MULTI_ARG_3_SF2 V8SF_FTYPE_V8SF_V8SF_V8SF
|
||||
#define MULTI_ARG_3_DF2 V4DF_FTYPE_V4DF_V4DF_V4DF
|
||||
#define MULTI_ARG_3_DI V2DI_FTYPE_V2DI_V2DI_V2DI
|
||||
#define MULTI_ARG_3_SI V4SI_FTYPE_V4SI_V4SI_V4SI
|
||||
#define MULTI_ARG_3_SI_DI V4SI_FTYPE_V4SI_V4SI_V2DI
|
||||
#define MULTI_ARG_3_HI V8HI_FTYPE_V8HI_V8HI_V8HI
|
||||
#define MULTI_ARG_3_HI_SI V8HI_FTYPE_V8HI_V8HI_V4SI
|
||||
#define MULTI_ARG_3_QI V16QI_FTYPE_V16QI_V16QI_V16QI
|
||||
#define MULTI_ARG_3_DI2 V4DI_FTYPE_V4DI_V4DI_V4DI
|
||||
#define MULTI_ARG_3_SI2 V8SI_FTYPE_V8SI_V8SI_V8SI
|
||||
#define MULTI_ARG_3_HI2 V16HI_FTYPE_V16HI_V16HI_V16HI
|
||||
#define MULTI_ARG_3_QI2 V32QI_FTYPE_V32QI_V32QI_V32QI
|
||||
#define MULTI_ARG_2_SF V4SF_FTYPE_V4SF_V4SF
|
||||
#define MULTI_ARG_2_DF V2DF_FTYPE_V2DF_V2DF
|
||||
#define MULTI_ARG_2_DI V2DI_FTYPE_V2DI_V2DI
|
||||
#define MULTI_ARG_2_SI V4SI_FTYPE_V4SI_V4SI
|
||||
#define MULTI_ARG_2_HI V8HI_FTYPE_V8HI_V8HI
|
||||
#define MULTI_ARG_2_QI V16QI_FTYPE_V16QI_V16QI
|
||||
#define MULTI_ARG_2_DI_IMM V2DI_FTYPE_V2DI_SI
|
||||
#define MULTI_ARG_2_SI_IMM V4SI_FTYPE_V4SI_SI
|
||||
#define MULTI_ARG_2_HI_IMM V8HI_FTYPE_V8HI_SI
|
||||
#define MULTI_ARG_2_QI_IMM V16QI_FTYPE_V16QI_SI
|
||||
#define MULTI_ARG_2_DI_CMP V2DI_FTYPE_V2DI_V2DI_CMP
|
||||
#define MULTI_ARG_2_SI_CMP V4SI_FTYPE_V4SI_V4SI_CMP
|
||||
#define MULTI_ARG_2_HI_CMP V8HI_FTYPE_V8HI_V8HI_CMP
|
||||
#define MULTI_ARG_2_QI_CMP V16QI_FTYPE_V16QI_V16QI_CMP
|
||||
#define MULTI_ARG_2_SF_TF V4SF_FTYPE_V4SF_V4SF_TF
|
||||
#define MULTI_ARG_2_DF_TF V2DF_FTYPE_V2DF_V2DF_TF
|
||||
#define MULTI_ARG_2_DI_TF V2DI_FTYPE_V2DI_V2DI_TF
|
||||
#define MULTI_ARG_2_SI_TF V4SI_FTYPE_V4SI_V4SI_TF
|
||||
#define MULTI_ARG_2_HI_TF V8HI_FTYPE_V8HI_V8HI_TF
|
||||
#define MULTI_ARG_2_QI_TF V16QI_FTYPE_V16QI_V16QI_TF
|
||||
#define MULTI_ARG_1_SF V4SF_FTYPE_V4SF
|
||||
#define MULTI_ARG_1_DF V2DF_FTYPE_V2DF
|
||||
#define MULTI_ARG_1_SF2 V8SF_FTYPE_V8SF
|
||||
#define MULTI_ARG_1_DF2 V4DF_FTYPE_V4DF
|
||||
#define MULTI_ARG_1_DI V2DI_FTYPE_V2DI
|
||||
#define MULTI_ARG_1_SI V4SI_FTYPE_V4SI
|
||||
#define MULTI_ARG_1_HI V8HI_FTYPE_V8HI
|
||||
#define MULTI_ARG_1_QI V16QI_FTYPE_V16QI
|
||||
#define MULTI_ARG_1_SI_DI V2DI_FTYPE_V4SI
|
||||
#define MULTI_ARG_1_HI_DI V2DI_FTYPE_V8HI
|
||||
#define MULTI_ARG_1_HI_SI V4SI_FTYPE_V8HI
|
||||
#define MULTI_ARG_1_QI_DI V2DI_FTYPE_V16QI
|
||||
#define MULTI_ARG_1_QI_SI V4SI_FTYPE_V16QI
|
||||
#define MULTI_ARG_1_QI_HI V8HI_FTYPE_V16QI
|
||||
|
||||
#define BDESC(mask, mask2, icode, name, code, comparison, flag) \
|
||||
{ mask, mask2, icode, name, code, comparison, flag },
|
||||
#define BDESC_FIRST(kind, kindu, mask, mask2, icode, name, code, comparison, flag) \
|
||||
static const struct builtin_description bdesc_##kind[] = \
|
||||
{ \
|
||||
BDESC (mask, mask2, icode, name, code, comparison, flag)
|
||||
#define BDESC_END(kind, next_kind) \
|
||||
};
|
||||
|
||||
#include "i386-builtin.def"
|
||||
|
||||
extern builtin_isa ix86_builtins_isa[(int) IX86_BUILTIN_MAX];
|
||||
|
||||
tree ix86_builtin_vectorized_function (unsigned int fn, tree type_out,
|
||||
tree type_in);
|
||||
void ix86_init_builtins (void);
|
||||
tree ix86_vectorize_builtin_gather (const_tree mem_vectype,
|
||||
const_tree index_type, int scale);
|
||||
tree ix86_builtin_decl (unsigned code, bool);
|
||||
tree ix86_builtin_reciprocal (tree fndecl);
|
||||
unsigned int get_builtin_code_for_version (tree decl, tree *predicate_list);
|
||||
tree fold_builtin_cpu (tree fndecl, tree *args);
|
||||
tree get_ix86_builtin (enum ix86_builtins c);
|
||||
|
||||
#endif /* GCC_I386_BUILTINS_H */
|
19840
gcc/config/i386/i386-expand.c
Normal file
19840
gcc/config/i386/i386-expand.c
Normal file
File diff suppressed because it is too large
Load diff
58
gcc/config/i386/i386-expand.h
Normal file
58
gcc/config/i386/i386-expand.h
Normal file
|
@ -0,0 +1,58 @@
|
|||
/* Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_I386_EXPAND_H
|
||||
#define GCC_I386_EXPAND_H
|
||||
|
||||
/* AVX512F does support 64-byte integer vector operations,
|
||||
thus the longest vector we are faced with is V64QImode. */
|
||||
#define MAX_VECT_LEN 64
|
||||
|
||||
struct expand_vec_perm_d
|
||||
{
|
||||
rtx target, op0, op1;
|
||||
unsigned char perm[MAX_VECT_LEN];
|
||||
machine_mode vmode;
|
||||
unsigned char nelt;
|
||||
bool one_operand_p;
|
||||
bool testing_p;
|
||||
};
|
||||
|
||||
rtx legitimize_tls_address (rtx x, enum tls_model model, bool for_mov);
|
||||
alias_set_type ix86_GOT_alias_set (void);
|
||||
rtx legitimize_pic_address (rtx orig, rtx reg);
|
||||
rtx legitimize_pe_coff_symbol (rtx addr, bool inreg);
|
||||
|
||||
bool insn_defines_reg (unsigned int regno1, unsigned int regno2,
|
||||
rtx_insn *insn);
|
||||
void ix86_emit_binop (enum rtx_code code, machine_mode mode, rtx dst, rtx src);
|
||||
enum calling_abi ix86_function_abi (const_tree fndecl);
|
||||
bool ix86_function_ms_hook_prologue (const_tree fn);
|
||||
void warn_once_call_ms2sysv_xlogues (const char *feature);
|
||||
rtx gen_push (rtx arg);
|
||||
rtx gen_pop (rtx arg);
|
||||
rtx ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
|
||||
machine_mode mode, int ignore);
|
||||
bool ix86_vectorize_vec_perm_const (machine_mode vmode, rtx target, rtx op0,
|
||||
rtx op1, const vec_perm_indices &sel);
|
||||
bool ix86_notrack_prefixed_insn_p (rtx insn);
|
||||
machine_mode ix86_split_reduction (machine_mode mode);
|
||||
void ix86_expand_divmod_libfunc (rtx libfunc, machine_mode mode, rtx op0,
|
||||
rtx op1, rtx *quot_p, rtx *rem_p);
|
||||
|
||||
#endif /* GCC_I386_EXPAND_H */
|
2742
gcc/config/i386/i386-features.c
Normal file
2742
gcc/config/i386/i386-features.c
Normal file
File diff suppressed because it is too large
Load diff
201
gcc/config/i386/i386-features.h
Normal file
201
gcc/config/i386/i386-features.h
Normal file
|
@ -0,0 +1,201 @@
|
|||
/* Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_I386_FEATURES_H
|
||||
#define GCC_I386_FEATURES_H
|
||||
|
||||
enum xlogue_stub {
|
||||
XLOGUE_STUB_SAVE,
|
||||
XLOGUE_STUB_RESTORE,
|
||||
XLOGUE_STUB_RESTORE_TAIL,
|
||||
XLOGUE_STUB_SAVE_HFP,
|
||||
XLOGUE_STUB_RESTORE_HFP,
|
||||
XLOGUE_STUB_RESTORE_HFP_TAIL,
|
||||
|
||||
XLOGUE_STUB_COUNT
|
||||
};
|
||||
|
||||
enum xlogue_stub_sets {
|
||||
XLOGUE_SET_ALIGNED,
|
||||
XLOGUE_SET_ALIGNED_PLUS_8,
|
||||
XLOGUE_SET_HFP_ALIGNED_OR_REALIGN,
|
||||
XLOGUE_SET_HFP_ALIGNED_PLUS_8,
|
||||
|
||||
XLOGUE_SET_COUNT
|
||||
};
|
||||
|
||||
/* Register save/restore layout used by out-of-line stubs. */
|
||||
class xlogue_layout {
|
||||
public:
|
||||
struct reginfo
|
||||
{
|
||||
unsigned regno;
|
||||
HOST_WIDE_INT offset; /* Offset used by stub base pointer (rax or
|
||||
rsi) to where each register is stored. */
|
||||
};
|
||||
|
||||
unsigned get_nregs () const {return m_nregs;}
|
||||
HOST_WIDE_INT get_stack_align_off_in () const {return m_stack_align_off_in;}
|
||||
|
||||
const reginfo &get_reginfo (unsigned reg) const
|
||||
{
|
||||
gcc_assert (reg < m_nregs);
|
||||
return m_regs[reg];
|
||||
}
|
||||
|
||||
static const char *get_stub_name (enum xlogue_stub stub,
|
||||
unsigned n_extra_args);
|
||||
|
||||
/* Returns an rtx for the stub's symbol based upon
|
||||
1.) the specified stub (save, restore or restore_ret) and
|
||||
2.) the value of cfun->machine->call_ms2sysv_extra_regs and
|
||||
3.) rather or not stack alignment is being performed. */
|
||||
static rtx get_stub_rtx (enum xlogue_stub stub);
|
||||
|
||||
/* Returns the amount of stack space (including padding) that the stub
|
||||
needs to store registers based upon data in the machine_function. */
|
||||
HOST_WIDE_INT get_stack_space_used () const
|
||||
{
|
||||
const struct machine_function *m = cfun->machine;
|
||||
unsigned last_reg = m->call_ms2sysv_extra_regs + MIN_REGS - 1;
|
||||
|
||||
gcc_assert (m->call_ms2sysv_extra_regs <= MAX_EXTRA_REGS);
|
||||
return m_regs[last_reg].offset + STUB_INDEX_OFFSET;
|
||||
}
|
||||
|
||||
/* Returns the offset for the base pointer used by the stub. */
|
||||
HOST_WIDE_INT get_stub_ptr_offset () const
|
||||
{
|
||||
return STUB_INDEX_OFFSET + m_stack_align_off_in;
|
||||
}
|
||||
|
||||
static const struct xlogue_layout &get_instance ();
|
||||
static unsigned count_stub_managed_regs ();
|
||||
static bool is_stub_managed_reg (unsigned regno, unsigned count);
|
||||
|
||||
static const HOST_WIDE_INT STUB_INDEX_OFFSET = 0x70;
|
||||
static const unsigned MIN_REGS = NUM_X86_64_MS_CLOBBERED_REGS;
|
||||
static const unsigned MAX_REGS = 18;
|
||||
static const unsigned MAX_EXTRA_REGS = MAX_REGS - MIN_REGS;
|
||||
static const unsigned VARIANT_COUNT = MAX_EXTRA_REGS + 1;
|
||||
static const unsigned STUB_NAME_MAX_LEN = 20;
|
||||
static const char * const STUB_BASE_NAMES[XLOGUE_STUB_COUNT];
|
||||
static const unsigned REG_ORDER[MAX_REGS];
|
||||
static const unsigned REG_ORDER_REALIGN[MAX_REGS];
|
||||
|
||||
private:
|
||||
xlogue_layout ();
|
||||
xlogue_layout (HOST_WIDE_INT stack_align_off_in, bool hfp);
|
||||
xlogue_layout (const xlogue_layout &);
|
||||
|
||||
/* True if hard frame pointer is used. */
|
||||
bool m_hfp;
|
||||
|
||||
/* Max number of register this layout manages. */
|
||||
unsigned m_nregs;
|
||||
|
||||
/* Incoming offset from 16-byte alignment. */
|
||||
HOST_WIDE_INT m_stack_align_off_in;
|
||||
|
||||
/* Register order and offsets. */
|
||||
struct reginfo m_regs[MAX_REGS];
|
||||
|
||||
/* Lazy-inited cache of symbol names for stubs. */
|
||||
static char s_stub_names[2][XLOGUE_STUB_COUNT][VARIANT_COUNT]
|
||||
[STUB_NAME_MAX_LEN];
|
||||
|
||||
static const xlogue_layout s_instances[XLOGUE_SET_COUNT];
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
||||
class scalar_chain
|
||||
{
|
||||
public:
|
||||
scalar_chain ();
|
||||
virtual ~scalar_chain ();
|
||||
|
||||
static unsigned max_id;
|
||||
|
||||
/* ID of a chain. */
|
||||
unsigned int chain_id;
|
||||
/* A queue of instructions to be included into a chain. */
|
||||
bitmap queue;
|
||||
/* Instructions included into a chain. */
|
||||
bitmap insns;
|
||||
/* All registers defined by a chain. */
|
||||
bitmap defs;
|
||||
/* Registers used in both vector and sclar modes. */
|
||||
bitmap defs_conv;
|
||||
|
||||
void build (bitmap candidates, unsigned insn_uid);
|
||||
virtual int compute_convert_gain () = 0;
|
||||
int convert ();
|
||||
|
||||
protected:
|
||||
void add_to_queue (unsigned insn_uid);
|
||||
void emit_conversion_insns (rtx insns, rtx_insn *pos);
|
||||
|
||||
private:
|
||||
void add_insn (bitmap candidates, unsigned insn_uid);
|
||||
void analyze_register_chain (bitmap candidates, df_ref ref);
|
||||
virtual void mark_dual_mode_def (df_ref def) = 0;
|
||||
virtual void convert_insn (rtx_insn *insn) = 0;
|
||||
virtual void convert_registers () = 0;
|
||||
};
|
||||
|
||||
class dimode_scalar_chain : public scalar_chain
|
||||
{
|
||||
public:
|
||||
int compute_convert_gain ();
|
||||
private:
|
||||
void mark_dual_mode_def (df_ref def);
|
||||
rtx replace_with_subreg (rtx x, rtx reg, rtx subreg);
|
||||
void replace_with_subreg_in_insn (rtx_insn *insn, rtx reg, rtx subreg);
|
||||
void convert_insn (rtx_insn *insn);
|
||||
void convert_op (rtx *op, rtx_insn *insn);
|
||||
void convert_reg (unsigned regno);
|
||||
void make_vector_copies (unsigned regno);
|
||||
void convert_registers ();
|
||||
int vector_const_cost (rtx exp);
|
||||
};
|
||||
|
||||
class timode_scalar_chain : public scalar_chain
|
||||
{
|
||||
public:
|
||||
/* Convert from TImode to V1TImode is always faster. */
|
||||
int compute_convert_gain () { return 1; }
|
||||
|
||||
private:
|
||||
void mark_dual_mode_def (df_ref def);
|
||||
void fix_debug_reg_uses (rtx reg);
|
||||
void convert_insn (rtx_insn *insn);
|
||||
/* We don't convert registers to difference size. */
|
||||
void convert_registers () {}
|
||||
};
|
||||
|
||||
} // anon namespace
|
||||
|
||||
bool ix86_save_reg (unsigned int regno, bool maybe_eh_return, bool ignore_outlined);
|
||||
int ix86_compare_version_priority (tree decl1, tree decl2);
|
||||
tree ix86_generate_version_dispatcher_body (void *node_p);
|
||||
tree ix86_get_function_versions_dispatcher (void *decl);
|
||||
tree ix86_mangle_decl_assembler_name (tree decl, tree id);
|
||||
|
||||
|
||||
#endif /* GCC_I386_FEATURES_H */
|
3688
gcc/config/i386/i386-options.c
Normal file
3688
gcc/config/i386/i386-options.c
Normal file
File diff suppressed because it is too large
Load diff
95
gcc/config/i386/i386-options.h
Normal file
95
gcc/config/i386/i386-options.h
Normal file
|
@ -0,0 +1,95 @@
|
|||
/* Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_I386_OPTIONS_H
|
||||
#define GCC_I386_OPTIONS_H
|
||||
|
||||
char *ix86_target_string (HOST_WIDE_INT isa, HOST_WIDE_INT isa2,
|
||||
int flags, int flags2,
|
||||
const char *arch, const char *tune,
|
||||
enum fpmath_unit fpmath, bool add_nl_p,
|
||||
bool add_abi_p);
|
||||
|
||||
extern enum attr_cpu ix86_schedule;
|
||||
|
||||
extern enum processor_type ix86_tune;
|
||||
extern enum processor_type ix86_arch;
|
||||
extern unsigned char x86_prefetch_sse;
|
||||
extern const struct processor_costs *ix86_tune_cost;
|
||||
|
||||
extern int ix86_tune_defaulted;
|
||||
extern int ix86_arch_specified;
|
||||
|
||||
extern unsigned int ix86_default_incoming_stack_boundary;
|
||||
extern HOST_WIDE_INT deferred_isa_values;
|
||||
extern HOST_WIDE_INT deferred_isa_values2;
|
||||
|
||||
extern unsigned int ix86_preferred_stack_boundary;
|
||||
extern unsigned int ix86_user_incoming_stack_boundary;
|
||||
extern unsigned int ix86_default_incoming_stack_boundary;
|
||||
extern unsigned int ix86_incoming_stack_boundary;
|
||||
|
||||
extern char *ix86_offload_options (void);
|
||||
extern void ix86_option_override (void);
|
||||
extern void ix86_override_options_after_change (void);
|
||||
void ix86_set_current_function (tree fndecl);
|
||||
bool ix86_function_naked (const_tree fn);
|
||||
void ix86_simd_clone_adjust (struct cgraph_node *node);
|
||||
|
||||
extern tree (*ix86_veclib_handler) (combined_fn, tree, tree);
|
||||
extern tree ix86_veclibabi_svml (combined_fn, tree, tree);
|
||||
extern tree ix86_veclibabi_acml (combined_fn, tree, tree);
|
||||
|
||||
extern rtx (*ix86_gen_leave) (void);
|
||||
extern rtx (*ix86_gen_add3) (rtx, rtx, rtx);
|
||||
extern rtx (*ix86_gen_sub3) (rtx, rtx, rtx);
|
||||
extern rtx (*ix86_gen_sub3_carry) (rtx, rtx, rtx, rtx, rtx);
|
||||
extern rtx (*ix86_gen_one_cmpl2) (rtx, rtx);
|
||||
extern rtx (*ix86_gen_monitor) (rtx, rtx, rtx);
|
||||
extern rtx (*ix86_gen_monitorx) (rtx, rtx, rtx);
|
||||
extern rtx (*ix86_gen_clzero) (rtx);
|
||||
extern rtx (*ix86_gen_andsp) (rtx, rtx, rtx);
|
||||
extern rtx (*ix86_gen_allocate_stack_worker) (rtx, rtx);
|
||||
extern rtx (*ix86_gen_adjust_stack_and_probe) (rtx, rtx, rtx);
|
||||
extern rtx (*ix86_gen_probe_stack_range) (rtx, rtx, rtx);
|
||||
extern rtx (*ix86_gen_tls_global_dynamic_64) (rtx, rtx, rtx);
|
||||
extern rtx (*ix86_gen_tls_local_dynamic_base_64) (rtx, rtx);
|
||||
|
||||
enum ix86_function_specific_strings
|
||||
{
|
||||
IX86_FUNCTION_SPECIFIC_ARCH,
|
||||
IX86_FUNCTION_SPECIFIC_TUNE,
|
||||
IX86_FUNCTION_SPECIFIC_MAX
|
||||
};
|
||||
|
||||
extern const char *stringop_alg_names[];
|
||||
|
||||
void ix86_add_new_builtins (HOST_WIDE_INT isa, HOST_WIDE_INT isa2);
|
||||
void ix86_function_specific_save (struct cl_target_option *,
|
||||
struct gcc_options *opts);
|
||||
void ix86_function_specific_restore (struct gcc_options *opts,
|
||||
struct cl_target_option *);
|
||||
void ix86_function_specific_post_stream_in (struct cl_target_option *);
|
||||
void ix86_function_specific_print (FILE *, int,
|
||||
struct cl_target_option *);
|
||||
bool ix86_valid_target_attribute_p (tree, tree, tree, int);
|
||||
|
||||
extern const struct attribute_spec ix86_attribute_table[];
|
||||
|
||||
|
||||
#endif /* GCC_I386_OPTIONS_H */
|
29004
gcc/config/i386/i386.c
29004
gcc/config/i386/i386.c
File diff suppressed because it is too large
Load diff
|
@ -2759,6 +2759,9 @@ struct GTY(()) machine_function {
|
|||
/* During SEH output, this is non-null. */
|
||||
struct seh_frame_state * GTY((skip(""))) seh;
|
||||
};
|
||||
|
||||
extern GTY(()) tree sysv_va_list_type_node;
|
||||
extern GTY(()) tree ms_va_list_type_node;
|
||||
#endif
|
||||
|
||||
#define ix86_stack_locals (cfun->machine->stack_locals)
|
||||
|
@ -2856,6 +2859,12 @@ extern void debug_dispatch_window (int);
|
|||
|
||||
#define TARGET_SUPPORTS_WIDE_INT 1
|
||||
|
||||
#if !defined(GENERATOR_FILE) && !defined(IN_LIBGCC2)
|
||||
extern enum attr_cpu ix86_schedule;
|
||||
|
||||
#define NUM_X86_64_MS_CLOBBERED_REGS 12
|
||||
#endif
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
version-control: t
|
||||
|
|
|
@ -44,6 +44,22 @@ i386-d.o: $(srcdir)/config/i386/i386-d.c
|
|||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
i386-options.o: $(srcdir)/config/i386/i386-options.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
i386-builtins.o: $(srcdir)/config/i386/i386-builtins.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
i386-expand.o: $(srcdir)/config/i386/i386-expand.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
i386-features.o: $(srcdir)/config/i386/i386-features.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
i386.o: i386-builtin-types.inc
|
||||
|
||||
i386-builtin-types.inc: s-i386-bt ; @true
|
||||
|
|
Loading…
Add table
Reference in a new issue