Fix 42747, make -mvsx enable sqrt

From-SVN: r155923
This commit is contained in:
Michael Meissner 2010-01-14 22:52:02 +00:00 committed by Michael Meissner
parent ef5d11818d
commit c919858d6a
4 changed files with 28 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2010-01-14 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/42747
* config/rs6000/rs6000.md (sqrtdf2): Split into expander and insn
to allow generation of the xssqrtdp instruction on power7.
(sqrtdf2_fpr): Ditto.
2010-01-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/42674

View File

@ -1,6 +1,6 @@
;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler
;; Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Free Software Foundation, Inc.
;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
@ -6310,7 +6310,14 @@
[(set_attr "type" "dmul")
(set_attr "fp_type" "fp_maddsub_d")])
(define_insn "sqrtdf2"
(define_expand "sqrtdf2"
[(set (match_operand:DF 0 "gpc_reg_operand" "")
(sqrt:DF (match_operand:DF 1 "gpc_reg_operand" "")))]
"(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT && TARGET_FPRS
&& TARGET_DOUBLE_FLOAT"
"")
(define_insn "*sqrtdf2_fpr"
[(set (match_operand:DF 0 "gpc_reg_operand" "=d")
(sqrt:DF (match_operand:DF 1 "gpc_reg_operand" "d")))]
"(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT && TARGET_FPRS

View File

@ -1,3 +1,7 @@
2010-01-14 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/pr42747.c: New file.
2010-01-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/42674

View File

@ -0,0 +1,8 @@
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -mcpu=power7 -ffast-math" } */
double foo (double x) { return __builtin_sqrt (x); }
/* { dg-final { scan-assembler "xssqrtdp" } } */