xbmc/xbmc — pull request #1123 by davilla (2012-07-06 04:21:26+00:00)
Title: Use intrinsic atomics

This pull/req changes how we handle atomics, this changes to prefer gcc intrinsics if available, otherwise revert back to our hand coded asm. Note that special cases such as darwin gcc-4.2/llvm-gcc-4.2/clang which have gcc intrinsics but fail the 'safe' test are included. Other special cases can be included in the future.

This also adds x86_64 hand coded asm which fixes fixes atomic add and atomic subtract for non-gcc intrinsics (see reverted commit ee92ffde4afe3aa5f0e8d086fafdbd25057a364a) which was failing unit tests.

thx to amejia for discovering the x86_64 atomics failure and asm code and suggesting the move to gcc intrinsics.

Two part commit, 1st changes over to prefer gcc intrinsics if available, 2nd is a big cleanup.