public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Edelsohn <dje.gcc@gmail.com>
To: Richard Biener <richard.guenther@gmail.com>,
		Segher Boessenkool <segher@kernel.crashing.org>
Cc: "William J. Schmidt" <wschmidt@linux.vnet.ibm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] lround for PowerPC
Date: Sun, 22 Nov 2015 20:58:00 -0000	[thread overview]
Message-ID: <CAGWvnyneQsmykM7hsp8M8WVHgaMh_P1cYEdywyMUewunmExgrA@mail.gmail.com> (raw)
In-Reply-To: <F75D0D75-95E8-4A66-8A17-1976282B462E@gmail.com>

v2 of the patch.  Seems to pass the GCC testsuite, although the
testsuite doesn't stress FP.

There is something wrong with current VSX SFmode constraints.

Index: rs6000.md
===================================================================
--- rs6000.md (revision 230723)
+++ rs6000.md (working copy)
@@ -77,6 +77,7 @@
    UNSPEC_FRIN
    UNSPEC_FRIP
    UNSPEC_FRIZ
+   UNSPEC_XSRDPI
    UNSPEC_LD_MPIC ; load_macho_picbase
    UNSPEC_RELD_MPIC ; re-load_macho_picbase
    UNSPEC_MPIC_CORRECT ; macho_correct_pic
@@ -5500,6 +5501,27 @@
   [(set_attr "type" "fp")
    (set_attr "fp_type" "fp_addsub_<Fs>")])

+(define_insn "*xsrdpi<mode>2"
+  [(set (match_operand:SFDF 0 "gpc_reg_operand" "=wa")
+       (unspec:SFDF [(match_operand:SFDF 1 "gpc_reg_operand" "wa")]
+                    UNSPEC_XSRDPI))]
+  "TARGET_<MODE>_FPR && TARGET_POPCNTD"
+  "xsrdpi %x0,%x1"
+  [(set_attr "type" "fp")
+   (set_attr "fp_type" "fp_addsub_<Fs>")])
+
+(define_expand "lround<mode>di2"
+  [(set (match_dup 2)
+       (unspec:SFDF [(match_operand:SFDF 1 "gpc_reg_operand" "wa")]
+                    UNSPEC_XSRDPI))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=d")
+       (unspec:DI [(match_dup 2)]
+                  UNSPEC_FCTID))]
+  "TARGET_<MODE>_FPR && TARGET_POPCNTD"
+{
+  operands[2] = gen_reg_rtx (<MODE>mode);
+})
+
 ; An UNSPEC is used so we don't have to support SImode in FP registers.
 (define_insn "stfiwx"
   [(set (match_operand:SI 0 "memory_operand" "=Z")

  parent reply	other threads:[~2015-11-22 20:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-22  3:21 David Edelsohn
2015-11-22  8:51 ` Richard Biener
2015-11-22 14:39   ` David Edelsohn
2015-11-22 20:58   ` David Edelsohn [this message]
2015-11-23 22:15     ` Michael Meissner
2015-11-24  0:06       ` David Edelsohn
2015-11-24 18:51         ` Michael Meissner
2015-11-24 19:00           ` Michael Meissner
2015-11-24 19:29             ` David Edelsohn
2015-11-24 23:01         ` Michael Meissner
2015-11-24  0:16       ` Michael Meissner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGWvnyneQsmykM7hsp8M8WVHgaMh_P1cYEdywyMUewunmExgrA@mail.gmail.com \
    --to=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).