This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] hppa: Revise atomic support to use sync barrier


It recently came to my attention that PA 2.0 supports out-of-order execution for loads and stores.  Loads and stores are strongly ordered on PA 1.x.  This has caused no end of confusion.

This out-of-order execution is discussed in the following article:
http://web.archive.org/web/20040214092531/http://www.cpus.hp.com/technical_references/advperf.shtml

This patch defines a new barrier pattern to enforce ordering of memory accesses.

The existing atomic patterns have been removed from pa.md except for atomic_loaddi and atomic_storedi which use floating point double instructions.  The defaults are okay when combined with the new barrier.

Since we want PA 1.x code to be PA 2.0 compatible, it gets the barrier as well.

The linux atomic support is modified to use the new barrier in the lock release code.  This should improve
performance.

Tested on hppa-unknown-linux-gnu.  Committed to trunk.  Probably, I will backport the change once the
change receives more testing.

Dave

--
John David Anglin  dave.anglin@bell.net

Attachment: atomic-v2.d
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]