[PATCH 20/25] GCN libgcc.

ams@codesourcery.com ams@codesourcery.com
Wed Sep 5 11:52:00 GMT 2018


This patch contains the GCN port of libgcc.  I've broken it out just to keep
both parts more manageable.

We have the usual stuff, plus a "gomp_print" implementation intended to provide
a means to output text to console without using the full printf.  Originally
this was because we did not have a working Newlib port, but now it provides the
underlying mechanism for printf.  It's also much lighter than printf, and
therefore more suitable for debugging offload kernels (for which there is no
debugger, yet).

In order to work in offload kernels the same function must be present in both
host and GCN toolchains.  Therefore it needs to live in libgomp (hence the
name).  However, having found it also useful in stand alone testing I have
moved the GCN implementation to libgcc.

It was also necessary to provide a means to disable EMUTLS.

2018-09-05  Andrew Stubbs  <ams@codesourcery.com>
	    Kwok Cheung Yeung  <kcy@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>
	    Tom de Vries  <tom@codesourcery.com>

	libgcc/
	* Makefile.in: Don't add emutls.c when --enable-emutls is "no".
	* config.host: Recognize amdgcn*-*-amdhsa.
	* config/gcn/crt0.c: New file.
	* config/gcn/gomp_print.c: New file.
	* config/gcn/lib2-divmod-hi.c: New file.
	* config/gcn/lib2-divmod.c: New file.
	* config/gcn/lib2-gcn.h: New file.
	* config/gcn/reduction.c: New file.
	* config/gcn/sfp-machine.h: New file.
	* config/gcn/t-amdgcn: New file.
---
 libgcc/Makefile.in                 |   2 +
 libgcc/config.host                 |   8 +++
 libgcc/config/gcn/crt0.c           |  23 ++++++++
 libgcc/config/gcn/gomp_print.c     |  99 +++++++++++++++++++++++++++++++
 libgcc/config/gcn/lib2-divmod-hi.c | 117 +++++++++++++++++++++++++++++++++++++
 libgcc/config/gcn/lib2-divmod.c    | 117 +++++++++++++++++++++++++++++++++++++
 libgcc/config/gcn/lib2-gcn.h       |  49 ++++++++++++++++
 libgcc/config/gcn/reduction.c      |  30 ++++++++++
 libgcc/config/gcn/sfp-machine.h    |  51 ++++++++++++++++
 libgcc/config/gcn/t-amdgcn         |  25 ++++++++
 10 files changed, 521 insertions(+)
 create mode 100644 libgcc/config/gcn/crt0.c
 create mode 100644 libgcc/config/gcn/gomp_print.c
 create mode 100644 libgcc/config/gcn/lib2-divmod-hi.c
 create mode 100644 libgcc/config/gcn/lib2-divmod.c
 create mode 100644 libgcc/config/gcn/lib2-gcn.h
 create mode 100644 libgcc/config/gcn/reduction.c
 create mode 100644 libgcc/config/gcn/sfp-machine.h
 create mode 100644 libgcc/config/gcn/t-amdgcn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0020-GCN-libgcc.patch
Type: text/x-patch
Size: 16560 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180905/ecb249d5/attachment.bin>


More information about the Gcc-patches mailing list