diff options
author | Michael Meissner <meissner@linux.vnet.ibm.com> | 2011-01-13 15:59:19 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2011-01-13 15:59:19 +0000 |
commit | b41f0b3440bc8fe4982404c16a63b41521929450 (patch) | |
tree | 0a3d6fbb49456492285091a11d5c1c4b4cb11d1d | |
parent | 2975762754545f8c1fb35e027897e05e87336412 (diff) | |
download | gcc-b41f0b3440bc8fe4982404c16a63b41521929450.zip gcc-b41f0b3440bc8fe4982404c16a63b41521929450.tar.gz gcc-b41f0b3440bc8fe4982404c16a63b41521929450.tar.bz2 |
Fix 47251, failure in powerpc -mcpu=power7 -m32 -msoft-float
From-SVN: r168752
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr47251.c | 15 |
4 files changed, 30 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1a3d122..b96f812 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-01-13 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/47251 + * config/rs6000/rs6000.md (floatunsdidf2): Add check for hardware + floating point. + (floatunsdidf2_fcfidu): Ditto. + 2011-01-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * config/s390/s390.c (print_operand_address): Replace 'error' with diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 2d73bd8..6d2f515 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -7167,13 +7167,13 @@ [(set (match_operand:DF 0 "gpc_reg_operand" "") (unsigned_float:DF (match_operand:DI 1 "gpc_reg_operand" "")))] - "TARGET_FCFIDU || VECTOR_UNIT_VSX_P (DFmode)" + "TARGET_HARD_FLOAT && (TARGET_FCFIDU || VECTOR_UNIT_VSX_P (DFmode))" "") (define_insn "*floatunsdidf2_fcfidu" [(set (match_operand:DF 0 "gpc_reg_operand" "=d") (unsigned_float:DF (match_operand:DI 1 "gpc_reg_operand" "d")))] - "TARGET_FCFIDU && !VECTOR_UNIT_VSX_P (DFmode)" + "TARGET_HARD_FLOAT && TARGET_FCFIDU && !VECTOR_UNIT_VSX_P (DFmode)" "fcfidu %0,%1" [(set_attr "type" "fp") (set_attr "length" "4")]) @@ -7182,7 +7182,7 @@ [(set (match_operand:DF 0 "gpc_reg_operand" "=d") (unsigned_float:DF (match_operand:DI 1 "memory_operand" "m"))) (clobber (match_scratch:DI 2 "=d"))] - "TARGET_FCFIDU || VECTOR_UNIT_VSX_P (DFmode)" + "TARGET_HARD_FLOAT && (TARGET_FCFIDU || VECTOR_UNIT_VSX_P (DFmode))" "#" "&& reload_completed" [(set (match_dup 2) (match_dup 1)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3245e06..c171c3d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-01-13 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/47251 + * gcc.target/powerpc/pr47251.c: New file, test PR 47251 fix. + 2011-01-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * gcc.dg/guality/pr36728-1.c: Disable arg1/2 checks for s390 and diff --git a/gcc/testsuite/gcc.target/powerpc/pr47251.c b/gcc/testsuite/gcc.target/powerpc/pr47251.c new file mode 100644 index 0000000..3089c49 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr47251.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* && ip32 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-O2 -msoft-float -mcpu=power7" } */ + +/* PR 47151: libgcc fails to build when using --with-cpu=power7 due to a missed + TARGET_HARD_FLOAT test. */ +unsigned int +__fixunssfdi (float a) +{ + const float dfa = a; + const unsigned int hi = dfa / 0x1p32f; + const unsigned int lo = dfa - (float) hi * 0x1p32f; + return ((unsigned int) hi << (4 * 8)) | lo; +} |