From patchwork Wed Feb 18 09:05:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 440842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7DD9C14016A for ; Wed, 18 Feb 2015 20:05:44 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=P14RP63uoFZMq1VL nimPRkKMTUhTgX/M3mOgFP+bP4awskqrq3y+tHtSf/b339GGQcVGP5/tmzdpLhTo uT3JP93Pgi66i6/KvjWaN4flO+SC2svVRx6bjutNJ8v6IefzhX8dxZJfcSMHywsV 88sow7FAhm7tyUxj19Oo7jBxh44= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=bQUtS7kk1J5xXROxETQQP5 knhHE=; b=Y6fh3d3aNqfsdr7FHToZXjBKUtbKKfd/l1+G6mi5eFWznraFXgu5fC wjsAiAdh028P0TpiYk5PoMuBwCkhFb2flTOHVpvy0iB5i21DoawFxfY+geyCyOJh OoIrbAC9u8Ym695My4cCDquOehxUJQJmyuwIfWJA+l8QhcQRkS++g= Received: (qmail 24575 invoked by alias); 18 Feb 2015 09:05:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 24563 invoked by uid 89); 18 Feb 2015 09:05:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Feb 2015 09:05:35 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YO0ZX-0005Xx-Ig from Thomas_Schwinge@mentor.com ; Wed, 18 Feb 2015 01:05:31 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Wed, 18 Feb 2015 09:05:29 +0000 From: Thomas Schwinge To: Jakub Jelinek , Richard Biener CC: Jan Hubicka , Ilya Verbin , Bernd Schmidt , Subject: Re: nvptx offloading patches [3/n], RFD In-Reply-To: <20150216214349.GR1746@tucnak.redhat.com> References: <5454CAB9.3040907@codesourcery.com> <20150204113817.GO1746@tucnak.redhat.com> <20150216210812.GO1746@tucnak.redhat.com> <5388429A-DE44-4C08-8A19-D42B6E00C0A6@gmail.com> <20150216214349.GR1746@tucnak.redhat.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Wed, 18 Feb 2015 10:05:19 +0100 Message-ID: <87sie3egj4.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Mon, 16 Feb 2015 22:08:12 +0100, Jakub Jelinek wrote: > On Mon, Feb 09, 2015 at 11:20:00AM +0100, Richard Biener wrote: > > I think (also communicated that on IRC) we should instead try not streaming > > machine-modes at all but generating them at stream-in time via layout_type > > or layout_decl. > > Here is a WIP prototype for being able to stream a machine mode description > table and streaming it back in. [...] Many thanks for that! (I had modified Bernd's patch to be less intrusive, see attached, but of course that didn't resolve its design problem.) On Mon, 16 Feb 2015 22:43:49 +0100, Jakub Jelinek wrote: > [updated patch] No regressions with --enable-offload-targets=nvptx-none=[...],x86_64-intelmicemul-linux-gnu=[...]. Grüße, Thomas 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