From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31710 invoked by alias); 13 May 2016 20:13:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 31691 invoked by uid 89); 13 May 2016 20:13:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=richard.guenther@gmail.com, richardguenthergmailcom X-HELO: mail-lf0-f45.google.com Received: from mail-lf0-f45.google.com (HELO mail-lf0-f45.google.com) (209.85.215.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 13 May 2016 20:13:22 +0000 Received: by mail-lf0-f45.google.com with SMTP id j8so93273757lfd.2 for ; Fri, 13 May 2016 13:13:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=2XHphoz1FsxLzoItDdZ6d/7JtoEtq1UHYhKPMfbl+u4=; b=UzsqZ1S6kScRt/PUeWiIHmKAXHVfQa5oseCBiiIiJtOesTSb7wWIbmPxMVuRrs2sZJ S/uqRu46kXbMm4vT9WFOqNnjtEJxQBH0TZst73QZmKGcAp7fZdKHTSarzk+LQL4tUwcX 5q/cZazrVJ7Cj+tRu9/0ppmQYbjdpZdFWaQDWAZNmiCiZv2tTxbkBV19hD9x1vOssbN6 wPKzH9ykhi0fqDpeeklLTQOxvu9lSC8wTLfk7eXwHzZwz4QpNXDJYjcD8j5Lw3dD8lT+ rSWrzECmIAe9hCXDH3oRTGlmGAkXP3r82FU3Grv/cvqxyD3LPpMkh4E4uU1AdF/J351E raYg== X-Gm-Message-State: AOPr4FUbdHYvywpHleN4QZYkACBOG41WGMqyZDugCLriUmJ+Wv/DVx2Z6cBxV4xEXG/dxtIMlQJ1t/RoPTvb+A== MIME-Version: 1.0 X-Received: by 10.25.43.203 with SMTP id r194mr7481738lfr.80.1463170399328; Fri, 13 May 2016 13:13:19 -0700 (PDT) Received: by 10.25.133.84 with HTTP; Fri, 13 May 2016 13:13:19 -0700 (PDT) In-Reply-To: <862033F1-A268-4236-B908-558C102199B5@gmail.com> References: <573628A1.1030501@codesourcery.com> <862033F1-A268-4236-B908-558C102199B5@gmail.com> Date: Fri, 13 May 2016 20:13:00 -0000 Message-ID: Subject: Re: inhibit the sincos optimization when the target has sin and cos instructions From: Andrew Pinski To: Richard Biener Cc: Cesar Philippidis , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg01047.txt.bz2 On Fri, May 13, 2016 at 12:58 PM, Richard Biener wrote: > On May 13, 2016 9:18:57 PM GMT+02:00, Cesar Philippidis wrote: >>The cse_sincos pass tries to optimize sequences such as >> >> sin (x); >> cos (x); >> >>into a single call to sincos, or cexpi, when available. However, the >>nvptx target has sin and cos instructions, albeit with some loss of >>precision (so it's only enabled with -ffast-math). This patch teaches >>cse_sincos pass to ignore sin, cos and cexpi instructions when the >>target can expand those calls. This yields a 6x speedup in 314.omriq >>from spec accel when running on Nvidia accelerators. >> >>Is this OK for trunk? > > Isn't there an optab for sincos? This is exactly what I was going to suggest. This transformation should be done in the back-end back to sin/cos instructions. Thanks, Andrew > ISTR x87 handles this pass just fine and also can do sin and cos. > > Richard. > >>Cesar > >