diff options
Diffstat (limited to 'libgcc/config/i386')
27 files changed, 105 insertions, 50 deletions
diff --git a/libgcc/config/i386/32/sfp-machine.h b/libgcc/config/i386/32/sfp-machine.h index b9eb16633eb..1fa282d7afe 100644 --- a/libgcc/config/i386/32/sfp-machine.h +++ b/libgcc/config/i386/32/sfp-machine.h @@ -63,6 +63,16 @@ "g" ((USItype) (y1)), \ "2" ((USItype) (x0)), \ "g" ((USItype) (y0))) +#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i) \ + __asm__ ("add{l} {%4,%3|%3,%4}\n\t" \ + "adc{l} {$0,%2|%2,0}\n\t" \ + "adc{l} {$0,%1|%1,0}\n\t" \ + "adc{l} {$0,%0|%0,0}" \ + : "+r" ((USItype) (x3)), \ + "+&r" ((USItype) (x2)), \ + "+&r" ((USItype) (x1)), \ + "+&r" ((USItype) (x0)) \ + : "g" ((USItype) (i))) #define _FP_MUL_MEAT_S(R,X,Y) \ diff --git a/libgcc/config/i386/32/tf-signs.c b/libgcc/config/i386/32/tf-signs.c index 2a9d4c3a931..719bf877b80 100644 --- a/libgcc/config/i386/32/tf-signs.c +++ b/libgcc/config/i386/32/tf-signs.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2013 Free Software Foundation, Inc. +/* Copyright (C) 2008-2014 Free Software Foundation, Inc. This file is part of GCC. diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index 1a891e0c52f..6ff7502bb9a 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -1,5 +1,5 @@ /* Get CPU type and Features for x86 processors. - Copyright (C) 2012-2013 Free Software Foundation, Inc. + Copyright (C) 2012-2014 Free Software Foundation, Inc. Contributed by Sriraman Tallam (tmsriram@google.com) This file is part of GCC. @@ -36,12 +36,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see int __cpu_indicator_init (void) __attribute__ ((constructor CONSTRUCTOR_PRIORITY)); -enum vendor_signatures -{ - SIG_INTEL = 0x756e6547 /* Genu */, - SIG_AMD = 0x68747541 /* Auth */ -}; - /* Processor Vendor and Models. */ enum processor_vendor @@ -56,12 +50,14 @@ enum processor_vendor enum processor_types { - INTEL_ATOM = 1, + INTEL_BONNELL = 1, INTEL_CORE2, INTEL_COREI7, AMDFAM10H, AMDFAM15H, - INTEL_SLM, + INTEL_SILVERMONT, + AMD_BTVER1, + AMD_BTVER2, CPU_TYPE_MAX }; @@ -75,6 +71,10 @@ enum processor_subtypes AMDFAM10H_ISTANBUL, AMDFAM15H_BDVER1, AMDFAM15H_BDVER2, + AMDFAM15H_BDVER3, + AMDFAM15H_BDVER4, + INTEL_COREI7_IVYBRIDGE, + INTEL_COREI7_HASWELL, CPU_SUBTYPE_MAX }; @@ -92,7 +92,11 @@ enum processor_features FEATURE_SSE4_1, FEATURE_SSE4_2, FEATURE_AVX, - FEATURE_AVX2 + FEATURE_AVX2, + FEATURE_SSE4_A, + FEATURE_FMA4, + FEATURE_XOP, + FEATURE_FMA }; struct __processor_model @@ -113,36 +117,45 @@ get_amd_cpu (unsigned int family, unsigned int model) { /* AMD Family 10h. */ case 0x10: + __cpu_model.__cpu_type = AMDFAM10H; switch (model) { case 0x2: /* Barcelona. */ - __cpu_model.__cpu_type = AMDFAM10H; __cpu_model.__cpu_subtype = AMDFAM10H_BARCELONA; break; case 0x4: /* Shanghai. */ - __cpu_model.__cpu_type = AMDFAM10H; __cpu_model.__cpu_subtype = AMDFAM10H_SHANGHAI; break; case 0x8: /* Istanbul. */ - __cpu_model.__cpu_type = AMDFAM10H; __cpu_model.__cpu_subtype = AMDFAM10H_ISTANBUL; break; default: break; } break; - /* AMD Family 15h. */ + /* AMD Family 14h "btver1". */ + case 0x14: + __cpu_model.__cpu_type = AMD_BTVER1; + break; + /* AMD Family 15h "Bulldozer". */ case 0x15: __cpu_model.__cpu_type = AMDFAM15H; /* Bulldozer version 1. */ if ( model <= 0xf) __cpu_model.__cpu_subtype = AMDFAM15H_BDVER1; - /* Bulldozer version 2. */ - if (model >= 0x10 && model <= 0x1f) - __cpu_model.__cpu_subtype = AMDFAM15H_BDVER2; + /* Bulldozer version 2 "Piledriver" */ + if (model >= 0x10 && model <= 0x2f) + __cpu_model.__cpu_subtype = AMDFAM15H_BDVER2; + /* Bulldozer version 3 "Steamroller" */ + if (model >= 0x30 && model <= 0x4f) + __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3; + break; + /* AMD Family 16h "btver2" */ + case 0x16: + __cpu_model.__cpu_type = AMD_BTVER2; break; default: break; @@ -167,13 +180,13 @@ get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id) { case 0x1c: case 0x26: - /* Atom. */ - __cpu_model.__cpu_type = INTEL_ATOM; + /* Bonnell. */ + __cpu_model.__cpu_type = INTEL_BONNELL; break; case 0x37: case 0x4d: /* Silvermont. */ - __cpu_model.__cpu_type = INTEL_SLM; + __cpu_model.__cpu_type = INTEL_SILVERMONT; break; case 0x1a: case 0x1e: @@ -196,6 +209,19 @@ get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id) __cpu_model.__cpu_type = INTEL_COREI7; __cpu_model.__cpu_subtype = INTEL_COREI7_SANDYBRIDGE; break; + case 0x3a: + case 0x3e: + /* Ivy Bridge. */ + __cpu_model.__cpu_type = INTEL_COREI7; + __cpu_model.__cpu_subtype = INTEL_COREI7_IVYBRIDGE; + break; + case 0x3c: + case 0x45: + case 0x46: + /* Haswell. */ + __cpu_model.__cpu_type = INTEL_COREI7; + __cpu_model.__cpu_subtype = INTEL_COREI7_HASWELL; + break; case 0x17: case 0x1d: /* Penryn. */ @@ -242,6 +268,8 @@ get_available_features (unsigned int ecx, unsigned int edx, features |= (1 << FEATURE_SSE4_2); if (ecx & bit_AVX) features |= (1 << FEATURE_AVX); + if (ecx & bit_FMA) + features |= (1 << FEATURE_FMA); /* Get Advanced Features at level 7 (eax = 7, ecx = 0). */ if (max_cpuid_level >= 7) @@ -252,6 +280,23 @@ get_available_features (unsigned int ecx, unsigned int edx, features |= (1 << FEATURE_AVX2); } + unsigned int ext_level; + unsigned int eax, ebx; + /* Check cpuid level of extended features. */ + __cpuid (0x80000000, ext_level, ebx, ecx, edx); + + if (ext_level > 0x80000000) + { + __cpuid (0x80000001, eax, ebx, ecx, edx); + + if (ecx & bit_SSE4a) + features |= (1 << FEATURE_SSE4_A); + if (ecx & bit_FMA4) + features |= (1 << FEATURE_FMA4); + if (ecx & bit_XOP) + features |= (1 << FEATURE_XOP); + } + __cpu_model.__cpu_features[0] = features; } @@ -317,7 +362,7 @@ __cpu_indicator_init (void) extended_model = (eax >> 12) & 0xf0; extended_family = (eax >> 20) & 0xff; - if (vendor == SIG_INTEL) + if (vendor == signature_INTEL_ebx) { /* Adjust model and family for Intel CPUS. */ if (family == 0x0f) @@ -334,7 +379,7 @@ __cpu_indicator_init (void) get_available_features (ecx, edx, max_level); __cpu_model.__cpu_vendor = VENDOR_INTEL; } - else if (vendor == SIG_AMD) + else if (vendor == signature_AMD_ebx) { /* Adjust model and family for AMD CPUS. */ if (family == 0x0f) diff --git a/libgcc/config/i386/crtfastmath.c b/libgcc/config/i386/crtfastmath.c index 5a267c3b1a5..ad359d418fd 100644 --- a/libgcc/config/i386/crtfastmath.c +++ b/libgcc/config/i386/crtfastmath.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2013 Free Software Foundation, Inc. + * Copyright (C) 2005-2014 Free Software Foundation, Inc. * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/libgcc/config/i386/crti.S b/libgcc/config/i386/crti.S index 0cdb3c3889f..c7413358f56 100644 --- a/libgcc/config/i386/crti.S +++ b/libgcc/config/i386/crti.S @@ -1,6 +1,6 @@ /* crti.S for x86. - Copyright (C) 1993-2013 Free Software Foundation, Inc. + Copyright (C) 1993-2014 Free Software Foundation, Inc. Written By Fred Fish, Nov 1992 This file is free software; you can redistribute it and/or modify it diff --git a/libgcc/config/i386/crtn.S b/libgcc/config/i386/crtn.S index 2dac4ba9826..215b014ab8c 100644 --- a/libgcc/config/i386/crtn.S +++ b/libgcc/config/i386/crtn.S @@ -1,6 +1,6 @@ /* crtn.S for x86. - Copyright (C) 1993-2013 Free Software Foundation, Inc. + Copyright (C) 1993-2014 Free Software Foundation, Inc. Written By Fred Fish, Nov 1992 This file is free software; you can redistribute it and/or modify it diff --git a/libgcc/config/i386/crtprec.c b/libgcc/config/i386/crtprec.c index f8f9962b13b..73e944e619c 100644 --- a/libgcc/config/i386/crtprec.c +++ b/libgcc/config/i386/crtprec.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2013 Free Software Foundation, Inc. + * Copyright (C) 2007-2014 Free Software Foundation, Inc. * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/libgcc/config/i386/cygming-crtbegin.c b/libgcc/config/i386/cygming-crtbegin.c index 53909d2dc14..eeb51d4c573 100644 --- a/libgcc/config/i386/cygming-crtbegin.c +++ b/libgcc/config/i386/cygming-crtbegin.c @@ -1,5 +1,5 @@ /* crtbegin object for windows32 targets. - Copyright (C) 2007-2013 Free Software Foundation, Inc. + Copyright (C) 2007-2014 Free Software Foundation, Inc. Contributed by Danny Smith <dannysmith@users.sourceforge.net> diff --git a/libgcc/config/i386/cygming-crtend.c b/libgcc/config/i386/cygming-crtend.c index 4d4b05d628e..de0d61face2 100644 --- a/libgcc/config/i386/cygming-crtend.c +++ b/libgcc/config/i386/cygming-crtend.c @@ -1,5 +1,5 @@ /* crtend object for windows32 targets. - Copyright (C) 2007-2013 Free Software Foundation, Inc. + Copyright (C) 2007-2014 Free Software Foundation, Inc. Contributed by Danny Smith <dannysmith@users.sourceforge.net> diff --git a/libgcc/config/i386/cygwin.S b/libgcc/config/i386/cygwin.S index 45341a83cd9..277b5926348 100644 --- a/libgcc/config/i386/cygwin.S +++ b/libgcc/config/i386/cygwin.S @@ -1,6 +1,6 @@ /* stuff needed for libgcc on win32. * - * Copyright (C) 1996-2013 Free Software Foundation, Inc. + * Copyright (C) 1996-2014 Free Software Foundation, Inc. * Written By Steve Chamberlain * * This file is free software; you can redistribute it and/or modify it diff --git a/libgcc/config/i386/darwin-lib.h b/libgcc/config/i386/darwin-lib.h index 4dacaedf332..c75b56c28a4 100644 --- a/libgcc/config/i386/darwin-lib.h +++ b/libgcc/config/i386/darwin-lib.h @@ -1,5 +1,5 @@ /* Target definitions for x86 running Darwin, library renames. - Copyright (C) 2011-2013 Free Software Foundation, Inc. + Copyright (C) 2011-2014 Free Software Foundation, Inc. This file is part of GCC. diff --git a/libgcc/config/i386/enable-execute-stack-mingw32.c b/libgcc/config/i386/enable-execute-stack-mingw32.c index ae16e72522b..24f06e1f3a4 100644 --- a/libgcc/config/i386/enable-execute-stack-mingw32.c +++ b/libgcc/config/i386/enable-execute-stack-mingw32.c @@ -1,5 +1,5 @@ /* Implement __enable_execute_stack for Windows32. - Copyright (C) 2011-2013 Free Software Foundation, Inc. + Copyright (C) 2011-2014 Free Software Foundation, Inc. This file is part of GCC. diff --git a/libgcc/config/i386/gthr-win32.c b/libgcc/config/i386/gthr-win32.c index f3230317929..eec16b32628 100644 --- a/libgcc/config/i386/gthr-win32.c +++ b/libgcc/config/i386/gthr-win32.c @@ -1,7 +1,7 @@ /* Implementation of W32-specific threads compatibility routines for libgcc2. */ -/* Copyright (C) 1999-2013 Free Software Foundation, Inc. +/* Copyright (C) 1999-2014 Free Software Foundation, Inc. Contributed by Mumit Khan <khan@xraylith.wisc.edu>. Modified and moved to separate file by Danny Smith <dannysmith@users.sourceforge.net>. diff --git a/libgcc/config/i386/gthr-win32.h b/libgcc/config/i386/gthr-win32.h index 1e437fc6498..c295fd5f178 100644 --- a/libgcc/config/i386/gthr-win32.h +++ b/libgcc/config/i386/gthr-win32.h @@ -1,7 +1,7 @@ /* Threads compatibility routines for libgcc2 and libobjc. */ /* Compile this one with gcc. */ -/* Copyright (C) 1999-2013 Free Software Foundation, Inc. +/* Copyright (C) 1999-2014 Free Software Foundation, Inc. Contributed by Mumit Khan <khan@xraylith.wisc.edu>. This file is part of GCC. diff --git a/libgcc/config/i386/libgcc-bsd.ver b/libgcc/config/i386/libgcc-bsd.ver index 333a9d37848..a439786f1e7 100644 --- a/libgcc/config/i386/libgcc-bsd.ver +++ b/libgcc/config/i386/libgcc-bsd.ver @@ -1,4 +1,4 @@ -# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # # This file is part of GCC. # diff --git a/libgcc/config/i386/libgcc-cygming.ver b/libgcc/config/i386/libgcc-cygming.ver index 6232b9ea904..b7cd022fe8e 100644 --- a/libgcc/config/i386/libgcc-cygming.ver +++ b/libgcc/config/i386/libgcc-cygming.ver @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2013 Free Software Foundation, Inc. +# Copyright (C) 2012-2014 Free Software Foundation, Inc. # # This file is part of GCC. # diff --git a/libgcc/config/i386/libgcc-darwin.10.4.ver b/libgcc/config/i386/libgcc-darwin.10.4.ver index ac7defa0e51..e1887d99a3d 100644 --- a/libgcc/config/i386/libgcc-darwin.10.4.ver +++ b/libgcc/config/i386/libgcc-darwin.10.4.ver @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2013 Free Software Foundation, Inc. +# Copyright (C) 2005-2014 Free Software Foundation, Inc. # # This file is part of GCC. # diff --git a/libgcc/config/i386/libgcc-darwin.10.5.ver b/libgcc/config/i386/libgcc-darwin.10.5.ver index bb5a8891488..5c55c4a51a4 100644 --- a/libgcc/config/i386/libgcc-darwin.10.5.ver +++ b/libgcc/config/i386/libgcc-darwin.10.5.ver @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2013 Free Software Foundation, Inc. +# Copyright (C) 2005-2014 Free Software Foundation, Inc. # # This file is part of GCC. # diff --git a/libgcc/config/i386/libgcc-glibc.ver b/libgcc/config/i386/libgcc-glibc.ver index 39504c6d7ab..fd0025cde25 100644 --- a/libgcc/config/i386/libgcc-glibc.ver +++ b/libgcc/config/i386/libgcc-glibc.ver @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2013 Free Software Foundation, Inc. +# Copyright (C) 2008-2014 Free Software Foundation, Inc. # # This file is part of GCC. # diff --git a/libgcc/config/i386/libgcc-sol2.ver b/libgcc/config/i386/libgcc-sol2.ver index c56c5040143..fd94ff0c764 100644 --- a/libgcc/config/i386/libgcc-sol2.ver +++ b/libgcc/config/i386/libgcc-sol2.ver @@ -1,4 +1,4 @@ -# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # # This file is part of GCC. # diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h index bb40a659073..7986928cf48 100644 --- a/libgcc/config/i386/linux-unwind.h +++ b/libgcc/config/i386/linux-unwind.h @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for AMD x86-64 and x86. - Copyright (C) 2004-2013 Free Software Foundation, Inc. + Copyright (C) 2004-2014 Free Software Foundation, Inc. This file is part of GCC. diff --git a/libgcc/config/i386/morestack.S b/libgcc/config/i386/morestack.S index de492e08c58..7bef99f1334 100644 --- a/libgcc/config/i386/morestack.S +++ b/libgcc/config/i386/morestack.S @@ -1,5 +1,5 @@ # x86/x86_64 support for -fsplit-stack. -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # Contributed by Ian Lance Taylor <iant@google.com>. # This file is part of GCC. diff --git a/libgcc/config/i386/sfp-exceptions.c b/libgcc/config/i386/sfp-exceptions.c index 3504c4aedd1..9364a9700ab 100644 --- a/libgcc/config/i386/sfp-exceptions.c +++ b/libgcc/config/i386/sfp-exceptions.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 Free Software Foundation, Inc. + * Copyright (C) 2012-2014 Free Software Foundation, Inc. * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -47,7 +47,7 @@ __sfp_handle_exceptions (int _fex) if (_fex & FP_EX_INVALID) { float f = 0.0f; -#ifdef __x86_64__ +#ifdef __SSE_MATH__ volatile float r __attribute__ ((unused)); asm volatile ("%vdivss\t{%0, %d0|%d0, %0}" : "+x" (f)); r = f; /* Needed to trigger exception. */ @@ -67,7 +67,7 @@ __sfp_handle_exceptions (int _fex) if (_fex & FP_EX_DIVZERO) { float f = 1.0f, g = 0.0f; -#ifdef __x86_64__ +#ifdef __SSE_MATH__ volatile float r __attribute__ ((unused)); asm volatile ("%vdivss\t{%1, %d0|%d0, %1}" : "+x" (f) : "xm" (g)); r = f; /* Needed to trigger exception. */ @@ -95,7 +95,7 @@ __sfp_handle_exceptions (int _fex) if (_fex & FP_EX_INEXACT) { float f = 1.0f, g = 3.0f; -#ifdef __x86_64__ +#ifdef __SSE_MATH__ volatile float r __attribute__ ((unused)); asm volatile ("%vdivss\t{%1, %d0|%d0, %1}" : "+x" (f) : "xm" (g)); r = f; /* Needed to trigger exception. */ diff --git a/libgcc/config/i386/sol2-c1.S b/libgcc/config/i386/sol2-c1.S index e0de64a37c8..bea5f78d480 100644 --- a/libgcc/config/i386/sol2-c1.S +++ b/libgcc/config/i386/sol2-c1.S @@ -1,6 +1,6 @@ /* crt1.s for Solaris 2, x86 - Copyright (C) 1993-2013 Free Software Foundation, Inc. + Copyright (C) 1993-2014 Free Software Foundation, Inc. Written By Fred Fish, Nov 1992 This file is free software; you can redistribute it and/or modify it diff --git a/libgcc/config/i386/sol2-unwind.h b/libgcc/config/i386/sol2-unwind.h index e67710907b1..e5de56370d8 100644 --- a/libgcc/config/i386/sol2-unwind.h +++ b/libgcc/config/i386/sol2-unwind.h @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for AMD x86-64 and x86. - Copyright (C) 2009-2013 Free Software Foundation, Inc. + Copyright (C) 2009-2014 Free Software Foundation, Inc. This file is part of GCC. diff --git a/libgcc/config/i386/value-unwind.h b/libgcc/config/i386/value-unwind.h index 754090c4a9f..a7fb04baba7 100644 --- a/libgcc/config/i386/value-unwind.h +++ b/libgcc/config/i386/value-unwind.h @@ -1,5 +1,5 @@ /* Store register values as _Unwind_Word type in DWARF2 EH unwind context. - Copyright (C) 2011-2013 Free Software Foundation, Inc. + Copyright (C) 2011-2014 Free Software Foundation, Inc. This file is part of GCC. diff --git a/libgcc/config/i386/w32-unwind.h b/libgcc/config/i386/w32-unwind.h index 33f740bcda0..17ad2379b2d 100644 --- a/libgcc/config/i386/w32-unwind.h +++ b/libgcc/config/i386/w32-unwind.h @@ -1,5 +1,5 @@ /* Definitions for Dwarf2 EH unwind support for Windows32 targets - Copyright (C) 2007-2013 Free Software Foundation, Inc. + Copyright (C) 2007-2014 Free Software Foundation, Inc. Contributed by Pascal Obry <obry@adacore.com> This file is part of GCC. |