[llvm] [llubi] Initial support for floating-point numbers (PR #188453)
Zhige Chen via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 28 23:16:54 PDT 2026
================
@@ -503,6 +503,39 @@ uint64_t Context::getEffectiveTypeStoreSize(Type *Ty) {
return getEffectiveTypeSize(DL.getTypeStoreSize(Ty));
}
+RoundingMode Context::getCurrentRoundingMode() const {
+ return CurrentRoundingMode;
+}
+
+fp::ExceptionBehavior Context::getCurrentExceptionBehavior() const {
+ return CurrentExceptionBehavior;
+}
+
+void Context::setCurrentRoundingMode(RoundingMode RM) {
+ CurrentRoundingMode = RM;
+}
+
+void Context::setCurrentExceptionBehavior(fp::ExceptionBehavior EB) {
+ CurrentExceptionBehavior = EB;
+}
+
+bool Context::isDefaultFPEnv() const {
+ return isDefaultFPEnvironment(CurrentExceptionBehavior, CurrentRoundingMode);
+}
+
+bool Context::getRandomBool() {
+ // We use the lowest bit of the raw bits from RNG as the result:
+ if (UndefBehavior == UndefValueBehavior::NonDeterministic)
----------------
nofe1248 wrote:
I believe a global non-determinism switch plus individual policies for undefined/NaN propagation is sufficient for this PR. We can add additional fine-grained policies later if we identify concrete use cases.
https://github.com/llvm/llvm-project/pull/188453
More information about the llvm-commits
mailing list