Attempt better support for memory barriers

Haven't had a chance to test some of these (they come from
documentation) so might still have a few issues.