public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* nvptx offloading patches [3/n], RFD
@ 2014-11-01 11:58 Bernd Schmidt
  2014-11-03 22:28 ` Jeff Law
  2015-02-04 11:38 ` nvptx offloading patches [3/n], RFD Jakub Jelinek
  0 siblings, 2 replies; 42+ messages in thread
From: Bernd Schmidt @ 2014-11-01 11:58 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ilya Verbin

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

This is not against current trunk; it applies to gomp-4_0-branch where 
it is one of the necessary parts to make offloading x86->nvptx work. The 
issue is that the LTO file format depends on the machine_modes enum, it 
needs to match between host and offload target. The easiest way to do 
this is to just use the host-modes.def when compiling an offload compiler.

Ports that want to be hosts for offloading may need to modify their 
modes.def. The patch below contains changes to i386-modes.def which 
modifies XFmode depending on a target switch. I'm not actually entirely 
sure what to do about this. Do we want to make this flag an error when 
offloading is enabled? Or maybe add float format support to the 
-foffload-abi option?

Thoughts? Ok for the first part of the patch once the other offloading 
patches have gone in (bootstrapped and tested on x86_64-linux)?


Bernd

[-- Attachment #2: modes.diff --]
[-- Type: text/x-patch, Size: 2263 bytes --]

	* config.gcc (offload_host_cpu_type): Compute.
	(extra_modes): Use it to pick the offload host CPU's modes.def when
	building an offload target.
	* config/i386/i386-modes.def (XF): Skip adjustments when building an
	offload compiler.

Index: gomp-4_0-branch/gcc/config.gcc
===================================================================
--- gomp-4_0-branch.orig/gcc/config.gcc
+++ gomp-4_0-branch/gcc/config.gcc
@@ -483,15 +483,26 @@ 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
+	  ;;
+esac
+
 tm_file=${cpu_type}/${cpu_type}.h
 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-protos.h
 then
 	tm_p_file=${cpu_type}/${cpu_type}-protos.h
 fi
 extra_modes=
-if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def
+if test -f ${srcdir}/config/${offload_host_cpu_type}/${offload_host_cpu_type}-modes.def
 then
-	extra_modes=${cpu_type}/${cpu_type}-modes.def
+	extra_modes=${offload_host_cpu_type}/${offload_host_cpu_type}-modes.def
 fi
 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}.opt
 then
Index: gomp-4_0-branch/gcc/config/i386/i386-modes.def
===================================================================
--- gomp-4_0-branch.orig/gcc/config/i386/i386-modes.def
+++ gomp-4_0-branch/gcc/config/i386/i386-modes.def
@@ -24,6 +24,9 @@ along with GCC; see the file COPYING3.
 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
@@ -33,6 +36,7 @@ ADJUST_FLOAT_FORMAT (XF, (TARGET_128BIT_
 			  : &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.
 

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2015-04-27 16:16 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-01 11:58 nvptx offloading patches [3/n], RFD Bernd Schmidt
2014-11-03 22:28 ` Jeff Law
2014-11-04 12:38   ` nvptx offloading patches [3/n], i386 bits RFD Bernd Schmidt
2014-11-04 18:58     ` Uros Bizjak
2014-11-04 21:50     ` Jeff Law
2014-11-05  0:23       ` Bernd Schmidt
2014-11-14 18:42         ` Bernd Schmidt
2015-02-04 11:38 ` nvptx offloading patches [3/n], RFD Jakub Jelinek
2015-02-09 10:20   ` Richard Biener
2015-02-16 21:08     ` Jakub Jelinek
2015-02-16 21:35       ` Richard Biener
2015-02-16 21:44         ` Jakub Jelinek
2015-02-17 10:00           ` Richard Biener
2015-02-18 10:00             ` Jakub Jelinek
2015-02-25  8:51               ` Patch ping Jakub Jelinek
2015-02-25  9:30                 ` Richard Biener
2015-02-25 16:51                   ` Jakub Jelinek
2015-02-18  9:05           ` nvptx offloading patches [3/n], RFD Thomas Schwinge
2015-02-17 13:32       ` Ilya Verbin
2015-02-17 15:39         ` Jakub Jelinek
2015-02-17 16:21           ` Joseph Myers
2015-02-17 16:40             ` Jakub Jelinek
2015-02-18  9:12               ` Thomas Schwinge
2015-02-18 10:27                 ` Jakub Jelinek
2015-02-18 11:34                 ` Jakub Jelinek
2015-02-18 12:10                   ` Thomas Schwinge
2015-02-18 12:35                     ` Jakub Jelinek
2015-02-19 10:50                       ` If we're building an offloading compiler, always enable the LTO front end (was: nvptx offloading patches [3/n], RFD) Thomas Schwinge
2015-02-19 10:53                         ` Jakub Jelinek
2015-02-20  9:42                           ` Thomas Schwinge
2015-02-19 10:20               ` nvptx offloading patches [3/n], RFD Bernd Schmidt
2015-02-19 12:02                 ` Offloading compilers' support libraries (was: nvptx offloading patches [3/n], RFD) Thomas Schwinge
2015-02-19 12:11                   ` Offloading compilers' support libraries Bernd Schmidt
2015-02-19 12:19                     ` Thomas Schwinge
2015-02-20 15:35                       ` Ilya Verbin
2015-02-20 19:59                         ` Ilya Verbin
2015-02-26 19:35                           ` Ilya Verbin
2015-02-20  9:33                 ` Offloading compilers' libgcc installation (was: nvptx offloading patches [3/n], RFD) Thomas Schwinge
2015-02-20 19:32                   ` Ilya Verbin
2015-03-10 12:35                     ` Offloading compilers' libgcc installation Thomas Schwinge
2015-04-27 16:15                       ` Thomas Schwinge
2015-04-27 16:16                         ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).