From patchwork Mon Jun 9 23:25:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 357643 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 2A1C514007C for ; Tue, 10 Jun 2014 09:25:38 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=dIHJ5Op99rhdM0PqF GEn2sNiN+u8+GeyiQSoCkaEYKyuM5zBpkBovAsCIwz/lZfrKaOF2ltu069vPIRsm LLq9NJcAewg7HQ6r6wNxIWaa3rLfNepTJTfZ8EV6MWGgAETIUct0XiAgulRUItAB We6l9OFeii+d3gjoyO4VxMfdg0= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=T8fHhvDySsTrfr6Ub2EHQCX Hkw4=; b=JERQTKG+UNqj7W855P6g4T/97Fwhd0qW3kOCcYqYjXahYAOieraeSlO BR3W/AuVOM3Jg/XdZ6ZtdKHwU9FBLTYMvxlRNiWvfNNS2nHxRD1PpQJ1Kx6XNCAi T+tFhe3AzOH5hppFj0QwqkAO+dCPO5tSzf5vBSi9hHnP14ZPBrTg= Received: (qmail 16044 invoked by alias); 9 Jun 2014 23:25:31 -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 16030 invoked by uid 89); 9 Jun 2014 23:25:30 -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: mail-pb0-f42.google.com Received: from mail-pb0-f42.google.com (HELO mail-pb0-f42.google.com) (209.85.160.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 09 Jun 2014 23:25:28 +0000 Received: by mail-pb0-f42.google.com with SMTP id md12so5538260pbc.15 for ; Mon, 09 Jun 2014 16:25:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=IwEWIWok/DWTCL2PZJ5OlhiQucrA1hofJN/WaGt2xIg=; b=lWG/03inuT1c41OhLtPVX5FWn2UHRv9M+PNDeZJmUo+uTvr0mJwZ7KBnZbt0nbiYS3 wyALM3VgedfPpZM6bMdNLwf0Ow4o31dhSM4/FlU03era5XqVBcWPp8sNH6dShtng5uU1 0rdU3bYtnH4w4oyFeXuZCNAfMvgklI0tfl/LsJSqauZi35hk1m+OrA/b2uE3tkV4Xmo2 lx3TFvjTid/hT1UWLg78Rzu6S5v22vg/tzMEJBYFoF6nmMOkkTmc0ep1huDVWZy/iLGw 5Km+zoyzSvKeZ2jW7x+/IL6gno9/Ufcd2bvnzfHi3UhhB9E+LmOOVN4TEnlHf/WMKHkM wfRg== X-Gm-Message-State: ALoCoQmXv7/DKYuUbaLewIj4/tGPKMEtBf5A8aepqGpXPxG233wUi6uX7iD68nrOmZZ96qXRIYIx X-Received: by 10.68.235.6 with SMTP id ui6mr7729003pbc.45.1402356327049; Mon, 09 Jun 2014 16:25:27 -0700 (PDT) Received: from [10.1.1.3] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id jb5sm24077534pbd.73.2014.06.09.16.25.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Jun 2014 16:25:26 -0700 (PDT) Message-ID: <53964262.5070404@linaro.org> Date: Tue, 10 Jun 2014 09:25:22 +1000 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: ramrad01@arm.com CC: "gcc-patches@gcc.gnu.org" , Richard Earnshaw Subject: Re: [RFC][ARM] TARGET_ATOMIC_ASSIGN_EXPAND_FENV hook References: <535B89D6.2070309@linaro.org> <53635FBA.7060505@linaro.org> <53700C12.4000102@linaro.org> <5382F4C4.9000508@linaro.org> In-Reply-To: X-IsSubscribed: yes On 30/05/14 18:35, Ramana Radhakrishnan wrote: >> + if (!TARGET_VFP) >> + return; >> + >> + /* Generate the equivalence of : > > s/equivalence/equivalent. > > Ok with that change and if no regressions. Hi Ramana, Sorry, I missed the thumb1 part. There are no mrc/mcr versions of these instructions in thumb1. So these should be conditional on not being ARM_THUMB1. Is this OK. Regression tested with no new refression on qemu for arm-none-linux-gnueabi -march=armv7-a and on arm-none-linux-gnueabi --with-mode=thumb and -march=armv5t. Is this OK? Thanks, Kugan gcc/ 2014-06-10 Kugan Vivekanandarajah * config/arm/arm.c (arm_atomic_assign_expand_fenv): call default_atomic_assign_expand_fenv for TARGET_THUMB1. (arm_init_builtins) : Initialize builtins __builtins_arm_set_fpscr and __builtins_arm_get_fpscr only when !TARGET_THUMB1. * config/arm/vfp.md (set_fpscr): Make pattern conditional on !TARGERT_THUMB1. (get_fpscr) : Likewise. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f8575b9..c9f02df 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -24760,7 +24760,7 @@ arm_init_builtins (void) if (TARGET_CRC32) arm_init_crc32_builtins (); - if (TARGET_VFP) + if (TARGET_VFP && !TARGET_THUMB1) { tree ftype_set_fpscr = build_function_type_list (void_type_node, unsigned_type_node, NULL); @@ -31452,8 +31452,8 @@ arm_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update) tree new_fenv_var, reload_fenv, restore_fnenv; tree update_call, atomic_feraiseexcept, hold_fnclex; - if (!TARGET_VFP) - return; + if (!TARGET_VFP || TARGET_THUMB1) + return default_atomic_assign_expand_fenv (hold, clear, update); /* Generate the equivalent of : unsigned int fenv_var; diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md index a8b27bc..44d2f38 100644 --- a/gcc/config/arm/vfp.md +++ b/gcc/config/arm/vfp.md @@ -1325,7 +1325,7 @@ ;; Write Floating-point Status and Control Register. (define_insn "set_fpscr" [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] VUNSPEC_SET_FPSCR)] - "TARGET_VFP" + "TARGET_VFP && !TARGET_THUMB1" "mcr\\tp10, 7, %0, cr1, cr0, 0\\t @SET_FPSCR" [(set_attr "type" "mrs")]) @@ -1333,7 +1333,7 @@ (define_insn "get_fpscr" [(set (match_operand:SI 0 "register_operand" "=r") (unspec_volatile:SI [(const_int 0)] VUNSPEC_GET_FPSCR))] - "TARGET_VFP" + "TARGET_VFP && !TARGET_THUMB1" "mrc\\tp10, 7, %0, cr1, cr0, 0\\t @GET_FPSCR" [(set_attr "type" "mrs")])