summaryrefslogtreecommitdiff
path: root/src/jit/valuenum.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/jit/valuenum.h')
-rw-r--r--src/jit/valuenum.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/jit/valuenum.h b/src/jit/valuenum.h
index e6e0e43a33..2be48491df 100644
--- a/src/jit/valuenum.h
+++ b/src/jit/valuenum.h
@@ -205,6 +205,7 @@ private:
int GetConstantInt32(ValueNum argVN);
INT64 GetConstantInt64(ValueNum argVN);
double GetConstantDouble(ValueNum argVN);
+ float GetConstantSingle(ValueNum argVN);
// Assumes that all the ValueNum arguments of each of these functions have been shown to represent constants.
// Assumes that "vnf" is a operator of the appropriate arity (unary for the first, binary for the second).
@@ -536,6 +537,17 @@ public:
// Returns true iff the VN represents an integeral constant.
bool IsVNInt32Constant(ValueNum vn);
+ struct ArrLenUnsignedBoundInfo
+ {
+ unsigned cmpOper;
+ ValueNum vnIdx;
+ ValueNum vnLen;
+
+ ArrLenUnsignedBoundInfo() : cmpOper(GT_NONE), vnIdx(NoVN), vnLen(NoVN)
+ {
+ }
+ };
+
struct ArrLenArithBoundInfo
{
// (vnArr.len - 1) > vnOp
@@ -606,6 +618,9 @@ public:
// If "vn" is constant bound, then populate the "info" fields for constVal, cmpOp, cmpOper.
void GetConstantBoundInfo(ValueNum vn, ConstantBoundInfo* info);
+ // If "vn" is of the form "(uint)var < (uint)a.len" (or equivalent) return true.
+ bool IsVNArrLenUnsignedBound(ValueNum vn, ArrLenUnsignedBoundInfo* info);
+
// If "vn" is of the form "var < a.len" or "a.len <= var" return true.
bool IsVNArrLenBound(ValueNum vn);
@@ -663,9 +678,13 @@ private:
__fallthrough;
case TYP_BYREF:
-#ifndef PLATFORM_UNIX
+
+#ifdef _MSC_VER
+
assert(&typeid(T) == &typeid(size_t)); // We represent ref/byref constants as size_t's.
-#endif // PLATFORM_UNIX
+
+#endif // _MSC_VER
+
__fallthrough;
case TYP_INT: