1.1 --- a/templates/native/int.c Fri Mar 24 22:46:46 2017 +0100
1.2 +++ b/templates/native/int.c Sat Mar 25 01:07:08 2017 +0100
1.3 @@ -31,6 +31,11 @@
1.4
1.5 /* Integer operations. */
1.6
1.7 +__attr __fn_native_int_is_int(__attr __self, __attr obj)
1.8 +{
1.9 + return __INTEGER(obj) ? __builtins___boolean_True : __builtins___boolean_False;
1.10 +}
1.11 +
1.12 __attr __fn_native_int_int_add(__attr __self, __attr self, __attr other)
1.13 {
1.14 /* self and other interpreted as int */
1.15 @@ -187,6 +192,16 @@
1.16 return __new_int(i ^ j);
1.17 }
1.18
1.19 +__attr __fn_native_int_int_le(__attr __self, __attr self, __attr other)
1.20 +{
1.21 + /* self and other interpreted as int */
1.22 + int i = __TOINT(self);
1.23 + int j = __TOINT(other);
1.24 +
1.25 + /* Return a boolean result. */
1.26 + return i <= j ? __builtins___boolean_True : __builtins___boolean_False;
1.27 +}
1.28 +
1.29 __attr __fn_native_int_int_lt(__attr __self, __attr self, __attr other)
1.30 {
1.31 /* self and other interpreted as int */
1.32 @@ -197,6 +212,16 @@
1.33 return i < j ? __builtins___boolean_True : __builtins___boolean_False;
1.34 }
1.35
1.36 +__attr __fn_native_int_int_ge(__attr __self, __attr self, __attr other)
1.37 +{
1.38 + /* self and other interpreted as int */
1.39 + int i = __TOINT(self);
1.40 + int j = __TOINT(other);
1.41 +
1.42 + /* Return a boolean result. */
1.43 + return i >= j ? __builtins___boolean_True : __builtins___boolean_False;
1.44 +}
1.45 +
1.46 __attr __fn_native_int_int_gt(__attr __self, __attr self, __attr other)
1.47 {
1.48 /* self and other interpreted as int */