commit 97a1ad0d3a96321ded8fad5e3a3cc75b46970bfa Author: Thomas Schwinge Date: Fri Feb 13 19:51:09 2015 +0100 Use the offload host CPU's modes.def when building an offloading compiler: make it less intrusive. diff --git gcc/config.gcc gcc/config.gcc index ebf0ee6..265ac0e 100644 --- gcc/config.gcc +++ gcc/config.gcc @@ -482,15 +482,15 @@ tilepro*-*-*) ;; esac -offload_host_cpu_type=${cpu_type} -if test "x${enable_as_accelerator}" != "xno" -then - offload_host_cpu_type=`echo ${enable_as_accelerator_for} | sed 's/-.*$//'` -fi -case ${offload_host_cpu_type} in -x86_64) - offload_host_cpu_type=i386 - ;; +modes_cpu_type=${cpu_type} +case ${enable_as_accelerator}:${target} in +yes:nvptx-*-*) + modes_cpu_type=`echo ${enable_as_accelerator_for} | sed 's/-.*$//'` + case ${modes_cpu_type} in + x86_64) + modes_cpu_type=i386 + ;; + esac esac tm_file=${cpu_type}/${cpu_type}.h @@ -499,9 +499,9 @@ then tm_p_file=${cpu_type}/${cpu_type}-protos.h fi extra_modes= -if test -f ${srcdir}/config/${offload_host_cpu_type}/${offload_host_cpu_type}-modes.def +if test -f ${srcdir}/config/${modes_cpu_type}/${modes_cpu_type}-modes.def then - extra_modes=${offload_host_cpu_type}/${offload_host_cpu_type}-modes.def + extra_modes=${modes_cpu_type}/${modes_cpu_type}-modes.def fi if test -f ${srcdir}/config/${cpu_type}/${cpu_type}.opt then diff --git gcc/config/i386/i386-modes.def gcc/config/i386/i386-modes.def index 766681b..0b6a1f1 100644 --- gcc/config/i386/i386-modes.def +++ gcc/config/i386/i386-modes.def @@ -24,9 +24,6 @@ along with GCC; see the file COPYING3. If not see FRACTIONAL_FLOAT_MODE (XF, 80, 12, ieee_extended_intel_96_format); FLOAT_MODE (TF, 16, ieee_quad_format); -/* This file may be used when building a compiler for an offload target. - Assume that no special floating point options are used. */ -#ifndef ACCEL_COMPILER /* In ILP32 mode, XFmode has size 12 and alignment 4. In LP64 mode, XFmode has size and alignment 16. */ ADJUST_FLOAT_FORMAT (XF, (TARGET_128BIT_LONG_DOUBLE @@ -36,7 +33,6 @@ ADJUST_FLOAT_FORMAT (XF, (TARGET_128BIT_LONG_DOUBLE : &ieee_extended_intel_96_format)); ADJUST_BYTESIZE (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 12); ADJUST_ALIGNMENT (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 4); -#endif /* Add any extra modes needed to represent the condition code. diff --git gcc/config/nvptx/nvptx.h gcc/config/nvptx/nvptx.h index 9a9954b..c0d97ee 100644 --- gcc/config/nvptx/nvptx.h +++ gcc/config/nvptx/nvptx.h @@ -64,6 +64,14 @@ #define DOUBLE_TYPE_SIZE 64 #define LONG_DOUBLE_TYPE_SIZE 64 +#ifdef ACCEL_COMPILER +/* For ../i386/i386-modes.def. */ +/* See ../i386/unix.h:TARGET_SUBTARGET64_DEFAULT. */ +# define TARGET_128BIT_LONG_DOUBLE (TARGET_ABI64) +/* See ../i386/i386.h:TARGET_96_ROUND_53_LONG_DOUBLE. */ +# define TARGET_96_ROUND_53_LONG_DOUBLE 0 +#endif + #undef SIZE_TYPE #define SIZE_TYPE (TARGET_ABI64 ? "long unsigned int" : "unsigned int") #undef PTRDIFF_TYPE