From 6ead9f417fabd55cc26a93c6d54bdde1110fccd4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 2 Feb 2025 19:10:44 +0000 Subject: Add runtime support for relational int operations --- runtime/src/shed/ints.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'runtime/src') diff --git a/runtime/src/shed/ints.c b/runtime/src/shed/ints.c index c7c2c8ea..ed18c263 100644 --- a/runtime/src/shed/ints.c +++ b/runtime/src/shed/ints.c @@ -44,3 +44,27 @@ bool shed__runtime__int_not_equal(ShedObject left, ShedObject right) { PatioInt right_value = shed__runtime__int_value(right); return left_value != right_value; } + +bool shed__runtime__int_less_than(ShedObject left, ShedObject right) { + PatioInt left_value = shed__runtime__int_value(left); + PatioInt right_value = shed__runtime__int_value(right); + return left_value < right_value; +} + +bool shed__runtime__int_less_than_or_equal(ShedObject left, ShedObject right) { + PatioInt left_value = shed__runtime__int_value(left); + PatioInt right_value = shed__runtime__int_value(right); + return left_value <= right_value; +} + +bool shed__runtime__int_greater_than(ShedObject left, ShedObject right) { + PatioInt left_value = shed__runtime__int_value(left); + PatioInt right_value = shed__runtime__int_value(right); + return left_value > right_value; +} + +bool shed__runtime__int_greater_than_or_equal(ShedObject left, ShedObject right) { + PatioInt left_value = shed__runtime__int_value(left); + PatioInt right_value = shed__runtime__int_value(right); + return left_value >= right_value; +} -- cgit v1.2.3