diff options
author | pfg <pfg@FreeBSD.org> | 2012-06-13 20:21:08 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2012-06-13 20:21:08 +0000 |
commit | 15cbdc9790a226adc9ef5684e3a09a9ddef8597b (patch) | |
tree | 654bf94d13f16fd7984cb98a5c7cebcda5c97479 /contrib/gcc/config/i386/i386.h | |
parent | 58789340208c1a299e7230e33a8b438c23b37e40 (diff) | |
download | FreeBSD-src-15cbdc9790a226adc9ef5684e3a09a9ddef8597b.zip FreeBSD-src-15cbdc9790a226adc9ef5684e3a09a9ddef8597b.tar.gz |
Revert r236962 - Experimental amdfam10/barcelona support.
The patches are unexpectedly causing gcc to fail while
building ports/graphics/ImageMagick even when the cpu
flags are not used.
Reported by: Andreas Tobler
Diffstat (limited to 'contrib/gcc/config/i386/i386.h')
-rw-r--r-- | contrib/gcc/config/i386/i386.h | 132 |
1 files changed, 64 insertions, 68 deletions
diff --git a/contrib/gcc/config/i386/i386.h b/contrib/gcc/config/i386/i386.h index 896bf1d..b977014 100644 --- a/contrib/gcc/config/i386/i386.h +++ b/contrib/gcc/config/i386/i386.h @@ -141,7 +141,6 @@ extern const struct processor_costs *ix86_cost; #define TARGET_GENERIC32 (ix86_tune == PROCESSOR_GENERIC32) #define TARGET_GENERIC64 (ix86_tune == PROCESSOR_GENERIC64) #define TARGET_GENERIC (TARGET_GENERIC32 || TARGET_GENERIC64) -#define TARGET_AMDFAM10 (ix86_tune == PROCESSOR_AMDFAM10) #define TUNEMASK (1 << ix86_tune) extern const int x86_use_leave, x86_push_memory, x86_zero_extend_with_and; @@ -160,16 +159,15 @@ extern const int x86_accumulate_outgoing_args, x86_prologue_using_move; extern const int x86_epilogue_using_move, x86_decompose_lea; extern const int x86_arch_always_fancy_math_387, x86_shift1; extern const int x86_sse_partial_reg_dependency, x86_sse_split_regs; -extern const int x86_sse_unaligned_move_optimal; extern const int x86_sse_typeless_stores, x86_sse_load0_by_pxor; extern const int x86_use_ffreep; extern const int x86_inter_unit_moves, x86_schedule; extern const int x86_use_bt; -extern const int x86_cmpxchg, x86_cmpxchg8b, x86_xadd; +extern const int x86_cmpxchg, x86_cmpxchg8b, x86_cmpxchg16b, x86_xadd; extern const int x86_use_incdec; extern const int x86_pad_returns; extern const int x86_partial_flag_reg_stall; -extern int x86_prefetch_sse, x86_cmpxchg16b; +extern int x86_prefetch_sse; #define TARGET_USE_LEAVE (x86_use_leave & TUNEMASK) #define TARGET_PUSH_MEMORY (x86_push_memory & TUNEMASK) @@ -209,8 +207,6 @@ extern int x86_prefetch_sse, x86_cmpxchg16b; #define TARGET_PARTIAL_REG_DEPENDENCY (x86_partial_reg_dependency & TUNEMASK) #define TARGET_SSE_PARTIAL_REG_DEPENDENCY \ (x86_sse_partial_reg_dependency & TUNEMASK) -#define TARGET_SSE_UNALIGNED_MOVE_OPTIMAL \ - (x86_sse_unaligned_move_optimal & TUNEMASK) #define TARGET_SSE_SPLIT_REGS (x86_sse_split_regs & TUNEMASK) #define TARGET_SSE_TYPELESS_STORES (x86_sse_typeless_stores & TUNEMASK) #define TARGET_SSE_LOAD0_BY_PXOR (x86_sse_load0_by_pxor & TUNEMASK) @@ -241,7 +237,7 @@ extern int x86_prefetch_sse, x86_cmpxchg16b; #define TARGET_CMPXCHG (x86_cmpxchg & (1 << ix86_arch)) #define TARGET_CMPXCHG8B (x86_cmpxchg8b & (1 << ix86_arch)) -#define TARGET_CMPXCHG16B (x86_cmpxchg16b) +#define TARGET_CMPXCHG16B (x86_cmpxchg16b & (1 << ix86_arch)) #define TARGET_XADD (x86_xadd & (1 << ix86_arch)) #ifndef TARGET_64BIT_DEFAULT @@ -403,8 +399,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); } \ else if (TARGET_K8) \ builtin_define ("__tune_k8__"); \ - else if (TARGET_AMDFAM10) \ - builtin_define ("__tune_amdfam10__"); \ else if (TARGET_PENTIUM4) \ builtin_define ("__tune_pentium4__"); \ else if (TARGET_NOCONA) \ @@ -426,8 +420,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); builtin_define ("__SSE3__"); \ if (TARGET_SSSE3) \ builtin_define ("__SSSE3__"); \ - if (TARGET_SSE4A) \ - builtin_define ("__SSE4A__"); \ if (TARGET_SSE_MATH && TARGET_SSE) \ builtin_define ("__SSE_MATH__"); \ if (TARGET_SSE_MATH && TARGET_SSE2) \ @@ -483,11 +475,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); builtin_define ("__k8"); \ builtin_define ("__k8__"); \ } \ - else if (ix86_arch == PROCESSOR_AMDFAM10) \ - { \ - builtin_define ("__amdfam10"); \ - builtin_define ("__amdfam10__"); \ - } \ else if (ix86_arch == PROCESSOR_PENTIUM4) \ { \ builtin_define ("__pentium4"); \ @@ -526,14 +513,13 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define TARGET_CPU_DEFAULT_nocona 17 #define TARGET_CPU_DEFAULT_core2 18 #define TARGET_CPU_DEFAULT_generic 19 -#define TARGET_CPU_DEFAULT_amdfam10 20 #define TARGET_CPU_DEFAULT_NAMES {"i386", "i486", "pentium", "pentium-mmx",\ "pentiumpro", "pentium2", "pentium3", \ "pentium4", "geode", "k6", "k6-2", "k6-3", \ "athlon", "athlon-4", "k8", \ "pentium-m", "prescott", "nocona", \ - "core2", "generic", "amdfam10"} + "core2", "generic"} #ifndef CC1_SPEC #define CC1_SPEC "%(cc1_cpu) " @@ -748,7 +734,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); eliminated during reloading in favor of either the stack or frame pointer. */ -#define FIRST_PSEUDO_REGISTER 54 +#define FIRST_PSEUDO_REGISTER 53 /* Number of hardware registers that go into the DWARF-2 unwind info. If not defined, equals FIRST_PSEUDO_REGISTER. */ @@ -768,8 +754,8 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define FIXED_REGISTERS \ /*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7*/ \ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, \ -/*arg,flags,fpsr,fpcr,dir,frame*/ \ - 1, 1, 1, 1, 1, 1, \ +/*arg,flags,fpsr,dir,frame*/ \ + 1, 1, 1, 1, 1, \ /*xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7*/ \ 0, 0, 0, 0, 0, 0, 0, 0, \ /*mmx0,mmx1,mmx2,mmx3,mmx4,mmx5,mmx6,mmx7*/ \ @@ -796,10 +782,10 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define CALL_USED_REGISTERS \ /*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7*/ \ { 1, 1, 1, 0, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ -/*arg,flags,fpsr,fpcr,dir,frame*/ \ - 1, 1, 1, 1, 1, 1, \ +/*arg,flags,fpsr,dir,frame*/ \ + 1, 1, 1, 1, 1, \ /*xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7*/ \ - 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 1, 1, 1, 1, \ /*mmx0,mmx1,mmx2,mmx3,mmx4,mmx5,mmx6,mmx7*/ \ 1, 1, 1, 1, 1, 1, 1, 1, \ /* r8, r9, r10, r11, r12, r13, r14, r15*/ \ @@ -820,11 +806,11 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, \ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \ - 48, 49, 50, 51, 52, 53 } + 48, 49, 50, 51, 52 } /* ORDER_REGS_FOR_LOCAL_ALLOC is a macro which permits reg_alloc_order to be rearranged based on a particular function. When using sse math, - we want to allocate SSE before x87 registers and vice versa. */ + we want to allocate SSE before x87 registers and vice vera. */ #define ORDER_REGS_FOR_LOCAL_ALLOC x86_order_regs_for_local_alloc () @@ -986,7 +972,7 @@ do { \ #define HARD_FRAME_POINTER_REGNUM 6 /* Base register for access to local variables of the function. */ -#define FRAME_POINTER_REGNUM 21 +#define FRAME_POINTER_REGNUM 20 /* First floating point reg */ #define FIRST_FLOAT_REG 8 @@ -1099,7 +1085,7 @@ do { \ opcode needs reg %ebx. But some systems pass args to the OS in ebx, and the "b" register constraint is useful in asms for syscalls. - The flags, fpsr and fpcr registers are in no class. */ + The flags and fpsr registers are in no class. */ enum reg_class { @@ -1180,21 +1166,21 @@ enum reg_class { 0x10, 0x0 }, { 0x20, 0x0 }, /* SIREG, DIREG */ \ { 0x03, 0x0 }, /* AD_REGS */ \ { 0x0f, 0x0 }, /* Q_REGS */ \ - { 0x2100f0, 0x3fc0 }, /* NON_Q_REGS */ \ - { 0x7f, 0x3fc0 }, /* INDEX_REGS */ \ - { 0x2100ff, 0x0 }, /* LEGACY_REGS */ \ - { 0x2100ff, 0x3fc0 }, /* GENERAL_REGS */ \ + { 0x1100f0, 0x1fe0 }, /* NON_Q_REGS */ \ + { 0x7f, 0x1fe0 }, /* INDEX_REGS */ \ + { 0x1100ff, 0x0 }, /* LEGACY_REGS */ \ + { 0x1100ff, 0x1fe0 }, /* GENERAL_REGS */ \ { 0x100, 0x0 }, { 0x0200, 0x0 },/* FP_TOP_REG, FP_SECOND_REG */\ { 0xff00, 0x0 }, /* FLOAT_REGS */ \ -{ 0x3fc00000,0x3fc000 }, /* SSE_REGS */ \ -{ 0xc0000000, 0x3f }, /* MMX_REGS */ \ -{ 0x3fc00100,0x3fc000 }, /* FP_TOP_SSE_REG */ \ -{ 0x3fc00200,0x3fc000 }, /* FP_SECOND_SSE_REG */ \ -{ 0x3fc0ff00,0x3fc000 }, /* FLOAT_SSE_REGS */ \ - { 0x1ffff, 0x3fc0 }, /* FLOAT_INT_REGS */ \ -{ 0x3fc100ff,0x3fffc0 }, /* INT_SSE_REGS */ \ -{ 0x3fc1ffff,0x3fffc0 }, /* FLOAT_INT_SSE_REGS */ \ -{ 0xffffffff,0x3fffff } \ +{ 0x1fe00000,0x1fe000 }, /* SSE_REGS */ \ +{ 0xe0000000, 0x1f }, /* MMX_REGS */ \ +{ 0x1fe00100,0x1fe000 }, /* FP_TOP_SSE_REG */ \ +{ 0x1fe00200,0x1fe000 }, /* FP_SECOND_SSE_REG */ \ +{ 0x1fe0ff00,0x1fe000 }, /* FLOAT_SSE_REGS */ \ + { 0x1ffff, 0x1fe0 }, /* FLOAT_INT_REGS */ \ +{ 0x1fe100ff,0x1fffe0 }, /* INT_SSE_REGS */ \ +{ 0x1fe1ffff,0x1fffe0 }, /* FLOAT_INT_SSE_REGS */ \ +{ 0xffffffff,0x1fffff } \ } /* The same information, inverted: @@ -1210,10 +1196,11 @@ enum reg_class #define SMALL_REGISTER_CLASSES 1 -#define QI_REG_P(X) (REG_P (X) && REGNO (X) < 4) +#define QI_REG_P(X) \ + (REG_P (X) && REGNO (X) < 4) #define GENERAL_REGNO_P(N) \ - ((N) <= STACK_POINTER_REGNUM || REX_INT_REGNO_P (N)) + ((N) < 8 || REX_INT_REGNO_P (N)) #define GENERAL_REG_P(X) \ (REG_P (X) && GENERAL_REGNO_P (REGNO (X))) @@ -1221,38 +1208,39 @@ enum reg_class #define ANY_QI_REG_P(X) (TARGET_64BIT ? GENERAL_REG_P(X) : QI_REG_P (X)) #define NON_QI_REG_P(X) \ - (REG_P (X) && IN_RANGE (REGNO (X), 4, FIRST_PSEUDO_REGISTER - 1)) + (REG_P (X) && REGNO (X) >= 4 && REGNO (X) < FIRST_PSEUDO_REGISTER) -#define REX_INT_REGNO_P(N) \ - IN_RANGE ((N), FIRST_REX_INT_REG, LAST_REX_INT_REG) +#define REX_INT_REGNO_P(N) ((N) >= FIRST_REX_INT_REG && (N) <= LAST_REX_INT_REG) #define REX_INT_REG_P(X) (REG_P (X) && REX_INT_REGNO_P (REGNO (X))) #define FP_REG_P(X) (REG_P (X) && FP_REGNO_P (REGNO (X))) -#define FP_REGNO_P(N) IN_RANGE ((N), FIRST_STACK_REG, LAST_STACK_REG) +#define FP_REGNO_P(N) ((N) >= FIRST_STACK_REG && (N) <= LAST_STACK_REG) #define ANY_FP_REG_P(X) (REG_P (X) && ANY_FP_REGNO_P (REGNO (X))) #define ANY_FP_REGNO_P(N) (FP_REGNO_P (N) || SSE_REGNO_P (N)) -#define SSE_REG_P(N) (REG_P (N) && SSE_REGNO_P (REGNO (N))) -#define SSE_REGNO_P(N) \ - (IN_RANGE ((N), FIRST_SSE_REG, LAST_SSE_REG) \ - || REX_SSE_REGNO_P (N)) +#define SSE_REGNO_P(N) \ + (((N) >= FIRST_SSE_REG && (N) <= LAST_SSE_REG) \ + || ((N) >= FIRST_REX_SSE_REG && (N) <= LAST_REX_SSE_REG)) #define REX_SSE_REGNO_P(N) \ - IN_RANGE ((N), FIRST_REX_SSE_REG, LAST_REX_SSE_REG) + ((N) >= FIRST_REX_SSE_REG && (N) <= LAST_REX_SSE_REG) #define SSE_REGNO(N) \ ((N) < 8 ? FIRST_SSE_REG + (N) : FIRST_REX_SSE_REG + (N) - 8) +#define SSE_REG_P(N) (REG_P (N) && SSE_REGNO_P (REGNO (N))) #define SSE_FLOAT_MODE_P(MODE) \ ((TARGET_SSE && (MODE) == SFmode) || (TARGET_SSE2 && (MODE) == DFmode)) +#define MMX_REGNO_P(N) ((N) >= FIRST_MMX_REG && (N) <= LAST_MMX_REG) #define MMX_REG_P(XOP) (REG_P (XOP) && MMX_REGNO_P (REGNO (XOP))) -#define MMX_REGNO_P(N) IN_RANGE ((N), FIRST_MMX_REG, LAST_MMX_REG) -#define STACK_REG_P(XOP) (REG_P (XOP) && STACK_REGNO_P (REGNO (XOP))) -#define NON_STACK_REG_P(XOP) \ - (REG_P (XOP) && ! STACK_REGNO_P (REGNO (XOP))) -#define STACK_REGNO_P(N) IN_RANGE ((N), FIRST_STACK_REG, LAST_STACK_REG) +#define STACK_REG_P(XOP) \ + (REG_P (XOP) && \ + REGNO (XOP) >= FIRST_STACK_REG && \ + REGNO (XOP) <= LAST_STACK_REG) + +#define NON_STACK_REG_P(XOP) (REG_P (XOP) && ! STACK_REG_P (XOP)) #define STACK_TOP_P(XOP) (REG_P (XOP) && REGNO (XOP) == FIRST_STACK_REG) @@ -1600,15 +1588,21 @@ typedef struct ix86_args { #define REGNO_OK_FOR_INDEX_P(REGNO) \ ((REGNO) < STACK_POINTER_REGNUM \ - || REX_INT_REGNO_P (REGNO) \ - || (unsigned) reg_renumber[(REGNO)] < STACK_POINTER_REGNUM \ - || REX_INT_REGNO_P ((unsigned) reg_renumber[(REGNO)])) + || (REGNO >= FIRST_REX_INT_REG \ + && (REGNO) <= LAST_REX_INT_REG) \ + || ((unsigned) reg_renumber[(REGNO)] >= FIRST_REX_INT_REG \ + && (unsigned) reg_renumber[(REGNO)] <= LAST_REX_INT_REG) \ + || (unsigned) reg_renumber[(REGNO)] < STACK_POINTER_REGNUM) #define REGNO_OK_FOR_BASE_P(REGNO) \ - (GENERAL_REGNO_P (REGNO) \ + ((REGNO) <= STACK_POINTER_REGNUM \ || (REGNO) == ARG_POINTER_REGNUM \ || (REGNO) == FRAME_POINTER_REGNUM \ - || GENERAL_REGNO_P ((unsigned) reg_renumber[(REGNO)])) + || (REGNO >= FIRST_REX_INT_REG \ + && (REGNO) <= LAST_REX_INT_REG) \ + || ((unsigned) reg_renumber[(REGNO)] >= FIRST_REX_INT_REG \ + && (unsigned) reg_renumber[(REGNO)] <= LAST_REX_INT_REG) \ + || (unsigned) reg_renumber[(REGNO)] <= STACK_POINTER_REGNUM) #define REGNO_OK_FOR_SIREG_P(REGNO) \ ((REGNO) == 4 || reg_renumber[(REGNO)] == 4) @@ -1632,13 +1626,16 @@ typedef struct ix86_args { /* Non strict versions, pseudos are ok. */ #define REG_OK_FOR_INDEX_NONSTRICT_P(X) \ (REGNO (X) < STACK_POINTER_REGNUM \ - || REX_INT_REGNO_P (REGNO (X)) \ + || (REGNO (X) >= FIRST_REX_INT_REG \ + && REGNO (X) <= LAST_REX_INT_REG) \ || REGNO (X) >= FIRST_PSEUDO_REGISTER) #define REG_OK_FOR_BASE_NONSTRICT_P(X) \ - (GENERAL_REGNO_P (REGNO (X)) \ + (REGNO (X) <= STACK_POINTER_REGNUM \ || REGNO (X) == ARG_POINTER_REGNUM \ || REGNO (X) == FRAME_POINTER_REGNUM \ + || (REGNO (X) >= FIRST_REX_INT_REG \ + && REGNO (X) <= LAST_REX_INT_REG) \ || REGNO (X) >= FIRST_PSEUDO_REGISTER) /* Strict versions, hard registers only */ @@ -1943,9 +1940,9 @@ do { \ #define HI_REGISTER_NAMES \ {"ax","dx","cx","bx","si","di","bp","sp", \ "st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)", \ - "argp", "flags", "fpsr", "fpcr", "dirflag", "frame", \ + "argp", "flags", "fpsr", "dirflag", "frame", \ "xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7", \ - "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", \ + "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7" , \ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"} @@ -2111,7 +2108,6 @@ enum processor_type PROCESSOR_CORE2, PROCESSOR_GENERIC32, PROCESSOR_GENERIC64, - PROCESSOR_AMDFAM10, PROCESSOR_max }; @@ -2251,7 +2247,7 @@ enum ix86_stack_slot ??? Maybe Pentium chips benefits from renaming, someone can try.... */ #define HARD_REGNO_RENAME_OK(SRC, TARGET) \ - (! IN_RANGE ((SRC), FIRST_STACK_REG, LAST_STACK_REG)) + ((SRC) < FIRST_STACK_REG || (SRC) > LAST_STACK_REG) #define DLL_IMPORT_EXPORT_PREFIX '#' |