1.1 --- a/templates/native/int.c Fri Mar 24 19:07:01 2017 +0100
1.2 +++ b/templates/native/int.c Fri Mar 24 22:08:50 2017 +0100
1.3 @@ -31,6 +31,13 @@
1.4
1.5 /* Integer operations. */
1.6
1.7 +__attr __fn_native_int_is_int(__attr __args[])
1.8 +{
1.9 + __attr * const obj = &__args[1];
1.10 +
1.11 + return __INTEGER(*obj) ? __builtins___boolean_True : __builtins___boolean_False;
1.12 +}
1.13 +
1.14 __attr __fn_native_int_int_add(__attr __args[])
1.15 {
1.16 __attr * const self = &__args[1];
1.17 @@ -207,6 +214,18 @@
1.18 return __new_int(i ^ j);
1.19 }
1.20
1.21 +__attr __fn_native_int_int_le(__attr __args[])
1.22 +{
1.23 + __attr * const self = &__args[1];
1.24 + __attr * const other = &__args[2];
1.25 + /* self and other interpreted as int */
1.26 + int i = __TOINT(*self);
1.27 + int j = __TOINT(*other);
1.28 +
1.29 + /* Return a boolean result. */
1.30 + return i <= j ? __builtins___boolean_True : __builtins___boolean_False;
1.31 +}
1.32 +
1.33 __attr __fn_native_int_int_lt(__attr __args[])
1.34 {
1.35 __attr * const self = &__args[1];
1.36 @@ -219,6 +238,18 @@
1.37 return i < j ? __builtins___boolean_True : __builtins___boolean_False;
1.38 }
1.39
1.40 +__attr __fn_native_int_int_ge(__attr __args[])
1.41 +{
1.42 + __attr * const self = &__args[1];
1.43 + __attr * const other = &__args[2];
1.44 + /* self and other interpreted as int */
1.45 + int i = __TOINT(*self);
1.46 + int j = __TOINT(*other);
1.47 +
1.48 + /* Return a boolean result. */
1.49 + return i >= j ? __builtins___boolean_True : __builtins___boolean_False;
1.50 +}
1.51 +
1.52 __attr __fn_native_int_int_gt(__attr __args[])
1.53 {
1.54 __attr * const self = &__args[1];