]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sparc: Revert membar optimization that is not suitable for LEON5
authorAndreas Larsson <andreas@gaisler.com>
Mon, 16 Jan 2023 14:43:24 +0000 (15:43 +0100)
committerDaniel Hellstrom <daniel@gaisler.com>
Tue, 16 Jan 2024 11:57:00 +0000 (12:57 +0100)
LEON5 has a deeper write-buffer and hence stb is not enough to flush a
write out. For compatibility, use the default V8 approach for both
LEON3 and LEON5.

This reverts commit 49cc765db35a5a21cab2aece27a44983fa70b94b,
"sync.md (*membar_storeload_leon3): New insn."

gcc/ChangeLog:

* config/sparc/sync.md (*membar_storeload_leon3): Remove
(*membar_storeload): Enable for LEON

gcc/config/sparc/sync.md

index c34b943997fa4d803d113370b012549bda860834..dfa128f2488b56e97bc968bfac8eae12c4949b8a 100644 (file)
   "stbar"
   [(set_attr "type" "multi")])
 
-;; For LEON3, STB has the effect of membar #StoreLoad.
-(define_insn "*membar_storeload_leon3"
-  [(set (match_operand:BLK 0 "" "")
-       (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
-  "TARGET_LEON3"
-  "stb\t%%g0, [%%sp-1]"
-  [(set_attr "type" "store")])
-
 ;; For V8, LDSTUB has the effect of membar #StoreLoad.
 (define_insn "*membar_storeload"
   [(set (match_operand:BLK 0 "" "")
        (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
-  "TARGET_V8 && !TARGET_LEON3"
+  "TARGET_V8"
   "ldstub\t[%%sp-1], %%g0"
   [(set_attr "type" "multi")])