Optimized ARM RWSEM algorithm - Thanks to mrg666