]> gcc.gnu.org Git - gcc.git/commitdiff
hppa: Fix bug in atomic_storedi_1 pattern
authorJohn David Anglin <danglin@gcc.gnu.org>
Thu, 1 Feb 2024 18:46:47 +0000 (18:46 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 1 Feb 2024 19:23:54 +0000 (19:23 +0000)
The first alternative stores the floating-point status register
in the destination.  It should store zero.  We need to copy %fr0
to another floating-point register to initialize it to zero.

2024-02-01  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

* config/pa/pa.md (atomic_storedi_1): Fix bug in
alternative 1.

gcc/config/pa/pa.md

index 7b7d7f776c7abc208b013d0af44fdec5ed462054..36d20576102beaf1fb3bf75dadf68e9d8e60bb9e 100644 (file)
@@ -10578,13 +10578,13 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 (define_insn "atomic_storedi_1"
   [(set (mem:DI (match_operand:SI 0 "register_operand" "r,r"))
         (match_operand:DI 1 "reg_or_0_operand" "M,r"))
-   (clobber (match_scratch:DI 2 "=X,f"))]
+   (clobber (match_scratch:DI 2 "=f,f"))]
   "!TARGET_64BIT && !TARGET_SOFT_FLOAT"
   "@
-   {fstds|fstd} %%fr0,0(%0)
+   fcpy,dbl %%fr0,%2\n\t{fstds|fstd} %2,0(%0)
    {stws|stw} %1,-16(%%sp)\n\t{stws|stw} %R1,-12(%%sp)\n\t{fldds|fldd} -16(%%sp),%2\n\t{fstds|fstd} %2,0(%0)"
   [(set_attr "type" "move,move")
-   (set_attr "length" "4,16")])
+   (set_attr "length" "8,16")])
 
 ;; PA 2.0 hardware supports out-of-order execution of loads and stores, so
 ;; we need memory barriers to enforce program order for memory references
This page took 0.07144 seconds and 5 git commands to generate.