aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/PNaClLangRef.rst11
-rw-r--r--lib/Analysis/NaCl/PNaClABIVerifyModule.cpp23
2 files changed, 19 insertions, 15 deletions
diff --git a/docs/PNaClLangRef.rst b/docs/PNaClLangRef.rst
index b1d39a7187..dc144f59a2 100644
--- a/docs/PNaClLangRef.rst
+++ b/docs/PNaClLangRef.rst
@@ -323,16 +323,19 @@ TODO(jfb): atomics
* ``llvm.memset``
* ``llvm.bswap``
- The llvm.bswap intrinsic is only supported with the following argument types:
- i16, i32, i64.
+ The overloaded llvm.bswap intrinsic is only supported with the following
+ argument types: i16, i32, i64 (the types supported by C-style GCC builtins).
* ``llvm.ctlz``
* ``llvm.cttz``
* ``llvm.ctpop``
- The llvm.ctlz, llvm.cttz, and llvm.ctpop intrinsics only support
- i32 and i64 argument types (the types supported by C-style GCC builtins).
+ The overloaded llvm.ctlz, llvm.cttz, and llvm.ctpop intrinsics are only
+ supported with the i32 and i64 argument types (the types supported by
+ C-style GCC builtins).
+* ``llvm.stacksave``
+* ``llvm.stackrestore``
* ``llvm.trap``
* ``llvm.nacl.read.tp``
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
index 7836484c2f..7922d84a51 100644
--- a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
+++ b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
@@ -204,6 +204,9 @@ bool PNaClABIVerifyModule::isWhitelistedIntrinsic(const Function *F,
case Intrinsic::nacl_read_tp:
case Intrinsic::nacl_setjmp:
case Intrinsic::nacl_longjmp:
+ // Stack save and restore are used to support C99 VLAs.
+ case Intrinsic::stackrestore:
+ case Intrinsic::stacksave:
case Intrinsic::trap:
return true;
@@ -253,13 +256,14 @@ bool PNaClABIVerifyModule::isWhitelistedIntrinsic(const Function *F,
case Intrinsic::invariant_end:
case Intrinsic::invariant_start:
// Some transcendental functions not needed yet.
- case Intrinsic::cos: // Rounding not defined: support with fast-math?
- case Intrinsic::exp: // Rounding not defined: support with fast-math?
- case Intrinsic::exp2: // Rounding not defined: support with fast-math?
- case Intrinsic::log: // Rounding not defined: support with fast-math?
- case Intrinsic::log2: // Rounding not defined: support with fast-math?
- case Intrinsic::log10: // Rounding not defined: support with fast-math?
- case Intrinsic::sin: // Rounding not defined: support with fast-math?
+ case Intrinsic::cos:
+ case Intrinsic::exp:
+ case Intrinsic::exp2:
+ case Intrinsic::log:
+ case Intrinsic::log2:
+ case Intrinsic::log10:
+ case Intrinsic::pow:
+ case Intrinsic::sin:
// We run -lower-expect to convert Intrinsic::expect into branch weights
// and consume in the middle-end. The backend just ignores llvm.expect.
case Intrinsic::expect:
@@ -274,12 +278,9 @@ bool PNaClABIVerifyModule::isWhitelistedIntrinsic(const Function *F,
case Intrinsic::dbg_value:
return PNaClABIAllowDevIntrinsics || PNaClABIAllowDebugMetadata;
case Intrinsic::nacl_target_arch: // Used by translator self-build.
- case Intrinsic::pow: // Rounding is supposed to be the same as libm.
case Intrinsic::powi: // Rounding not defined: support with fast-math?
- case Intrinsic::prefetch: // Could ignore if target doesn't support?
+ case Intrinsic::prefetch: // TODO(jfb): Use our own data-prefetch intrinsic instead.
case Intrinsic::sqrt: // Rounding is defined, but setting errno up to libm.
- case Intrinsic::stackrestore: // Used to support C99 VLAs.
- case Intrinsic::stacksave: // Used to support C99 VLAs.
return PNaClABIAllowDevIntrinsics;
}
}