xo-reader2: + op>= support

This commit is contained in:
Roland Conybeare 2026-03-12 23:41:21 -05:00
commit 1b4d5744d2
11 changed files with 93 additions and 17 deletions

View file

@ -36,6 +36,8 @@ namespace xo {
DFloat * x, DInteger * y);
static obj<AGCObject> cmp_lessequal(obj<ARuntimeContext> rcx,
DFloat * x, DInteger * y);
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
DFloat * x, DInteger * y);
};
class IntegerFloatOps {
@ -60,6 +62,8 @@ namespace xo {
DInteger * x, DFloat * y);
static obj<AGCObject> cmp_lessequal(obj<ARuntimeContext> rcx,
DInteger * x, DFloat * y);
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
DInteger * x, DFloat * y);
};
}

View file

@ -35,6 +35,8 @@ namespace xo {
DFloat * x, DFloat * y);
static obj<AGCObject> cmp_lessequal(obj<ARuntimeContext> rcx,
DFloat * x, DFloat * y);
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
DFloat * x, DFloat * y);
};
}

View file

@ -37,6 +37,8 @@ namespace xo {
DInteger * x, DInteger * y);
static obj<AGCObject> cmp_lessequal(obj<ARuntimeContext> rcx,
DInteger * x, DInteger * y);
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
DInteger * x, DInteger * y);
};

View file

@ -113,6 +113,11 @@ namespace xo {
obj<AGCObject> x,
obj<AGCObject> y);
/** compare two numeric values for greater-or-equal **/
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
obj<AGCObject> x,
obj<AGCObject> y);
/** report memory use for owned arenas to @p visitor **/
void visit_pools(const MemorySizeVisitor & visitor);
@ -129,7 +134,8 @@ namespace xo {
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmpeq_fn,
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmpne_fn,
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmplt_fn,
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmple_fn) {
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmple_fn,
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmpge_fn) {
KeyType key(typeseq::id<DRepr1>().seqno(),
typeseq::id<DRepr2>().seqno());
@ -143,7 +149,8 @@ namespace xo {
cmpeq_fn,
cmpne_fn,
cmplt_fn,
cmple_fn);
cmple_fn,
cmpge_fn);
}
private:

View file

@ -29,9 +29,10 @@ namespace xo {
BinaryOp cmpeq,
BinaryOp cmpne,
BinaryOp cmplt,
BinaryOp cmple)
BinaryOp cmple,
BinaryOp cmpge)
: multiply_{multiply}, divide_{divide}, add_{add}, subtract_{subtract},
cmpeq_{cmpeq}, cmpne_{cmpne}, cmplt_{cmplt}, cmple_{cmple} {}
cmpeq_{cmpeq}, cmpne_{cmpne}, cmplt_{cmplt}, cmple_{cmple}, cmpge_{cmpge} {}
BinaryOp multiply_ = nullptr;
BinaryOp divide_ = nullptr;
@ -46,6 +47,8 @@ namespace xo {
BinaryOp cmplt_ = nullptr;
/** compare numerics (<=) **/
BinaryOp cmple_ = nullptr;
/** compare numerics (>=) **/
BinaryOp cmpge_ = nullptr;
};
template <typename DRepr1, typename DRepr2>
@ -64,7 +67,8 @@ namespace xo {
BinaryOp_Impl cmpeq,
BinaryOp_Impl cmpne,
BinaryOp_Impl cmplt,
BinaryOp_Impl cmple) {
BinaryOp_Impl cmple,
BinaryOp_Impl cmpge) {
return AnonymizedNumericOps(reinterpret_cast<BinaryOp_Anon>(multiply),
reinterpret_cast<BinaryOp_Anon>(divide),
reinterpret_cast<BinaryOp_Anon>(add),
@ -72,7 +76,8 @@ namespace xo {
reinterpret_cast<BinaryOp_Anon>(cmpeq),
reinterpret_cast<BinaryOp_Anon>(cmpne),
reinterpret_cast<BinaryOp_Anon>(cmplt),
reinterpret_cast<BinaryOp_Anon>(cmple));
reinterpret_cast<BinaryOp_Anon>(cmple),
reinterpret_cast<BinaryOp_Anon>(cmpge));
}
};