diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-09-03 13:22:28 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-09-03 13:22:28 +0200 |
commit | c74211d87eb53cb310703dec2c504b26d7f24bdf (patch) | |
tree | 02ba6656583426df8fc43bd1d005f57326c7ea32 /powerpc/Asmexpand.ml | |
parent | 38959ad2b2d35a7d1b3479ef4298a5d754350cd8 (diff) | |
download | compcert-kvx-c74211d87eb53cb310703dec2c504b26d7f24bdf.tar.gz compcert-kvx-c74211d87eb53cb310703dec2c504b26d7f24bdf.zip |
Added builtin for mbar instruction.
This commit adds a builtin function for the mbar instruction.
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 *) |