diff options
Diffstat (limited to 'powerpc/Asmexpand.ml')
-rw-r--r-- | powerpc/Asmexpand.ml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml index f266f3ec..3e57cdbf 100644 --- a/powerpc/Asmexpand.ml +++ b/powerpc/Asmexpand.ml @@ -466,6 +466,12 @@ let expand_builtin_inline name args res = emit (Pisync) | "__builtin_lwsync", [], _ -> emit (Plwsync) + | "__builtin_mbar", [BA_int mo], _ -> + if not (mo = _0 || mo = _1) then + raise (Error "the argument of __builtin_mbar must be either 0 or 1"); + emit (Pmbar mo) + | "__builin_mbar",_, _ -> + raise (Error "the argument of __builtin_mbar must be a constant"); | "__builtin_trap", [], _ -> emit (Ptrap) (* Vararg stuff *) |