From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5517 invoked by alias); 22 Aug 2019 03:33:23 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 5507 invoked by uid 89); 22 Aug 2019 03:33:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=HX-Received:a50, fwa, dwa X-HELO: mail-ed1-f53.google.com Received: from mail-ed1-f53.google.com (HELO mail-ed1-f53.google.com) (209.85.208.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Aug 2019 03:33:21 +0000 Received: by mail-ed1-f53.google.com with SMTP id r12so5758318edo.5 for ; Wed, 21 Aug 2019 20:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SnfATIITGOHtr4qJfAeJ9ZiTmaChyRipBch3sBwQY0s=; b=GgIiCEO7nuyh6UGT16Cs1rupUoCyDq59r4oU3NU4P1mTy+XtOE8kTBqCf1tiJxbvYM 0JjDwM97rKYLq2H61Bk/o210EoIItlFqSwfCUrLqAtrU6L6VADA3w/NTTOVJNZtRA9Gu LfXyVsoymh6frAh1HTI6f5kEpZuZX19w2I8Gg/KsauKvQjyW7ewOWp3Q8RCPdAuoXxJ+ iA5mDoRUPrJTY1L8k2gnro1YvUdxsmoG23CA87fwBWxmmmx6vldz57IJ4HvMcMS991WH i2/WQ/e/W7ITK/rgEJOnDehv5yfroOEhwcPkwonZpT4JltQHKOQjlaXE8f8r93fqy3+z sKWw== MIME-Version: 1.0 References: <20190819130720.GG31406@gate.crashing.org> <20190820121137.GP31406@gate.crashing.org> <20190820134613.GR31406@gate.crashing.org> <20190820194154.GY31406@gate.crashing.org> <20190821182852.GG31406@gate.crashing.org> <20190821191722.GH31406@gate.crashing.org> In-Reply-To: <20190821191722.GH31406@gate.crashing.org> From: Tejas Joshi Date: Thu, 22 Aug 2019 03:33:00 -0000 Message-ID: Subject: Re: Expansion of narrowing math built-ins into power instructions To: gcc@gcc.gnu.org Cc: Martin Jambor , hubicka@ucw.cz, segher@kernel.crashing.org, joseph@codesourcery.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00179.txt.bz2 > This does almost exactly the same as what the proposed float_narrow > would do. Instead, write it as > > (define_insn "add_truncdfsf3" > [(set (match_operand:SF 0 "gpc_reg_operand" "=,wa") > (unspec:SF [(match_operand:DF 1 "gpc_reg_operand" "%,wa") > (match_operand:DF 2 "gpc_reg_operand" ",wa")] > UNSPEC_ADD_TRUNCATE)] > "TARGET_HARD_FLOAT" > "@ > fadds %0,%1,%2 > xsaddsp %x0,%x1,%x2" > [(set_attr "type" "fp") > (set_attr "isa" "*,p8v")]) Yes, I tried basically every combination I could think of, just not with the "isa attr". Now, I have the following code and it is still seems not to be working. Am I missing any options to pass? (define_insn "add_truncdfsf3" [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wa") (unspec:SF [(match_operand:DF 1 "gpc_reg_operand" "%d,wa") (match_operand:DF 2 "gpc_reg_operand" "d,wa")] UNSPEC_ADD_NARROWING))] "TARGET_HARD_FLOAT" "@ fadds %0,%1,%2 xsaddsp %x0,%x1,%x2" [(set_attr "type" "fp") (set_attr "isa" "*,p8v")]) with the code, I pass -O2 foo.c : float foo (double x, double y) { return __builtin_fadd (x, y); } Thanks, Tejas On Thu, 22 Aug 2019 at 00:47, Segher Boessenkool wrote: > > On Wed, Aug 21, 2019 at 01:28:52PM -0500, Segher Boessenkool wrote: > > (define_insn "add_truncdfsf3" > > [(set (match_operand:SF 0 "gpc_reg_operand" "=,wa") > > (unspec:SF [(match_operand:DF 1 "gpc_reg_operand" "%,wa") > > (match_operand:DF 2 "gpc_reg_operand" ",wa")] > > UNSPEC_ADD_TRUNCATE)] > > "TARGET_HARD_FLOAT" > > "@ > > fadds %0,%1,%2 > > xsaddsp %x0,%x1,%x2" > > [(set_attr "type" "fp") > > (set_attr "isa" "*,p8v")]) > > And not ... f, d, d respectively (f for SF, d for DF). > > > Segher