1.1 --- a/templates/native/int.c Mon Apr 03 00:13:46 2017 +0200
1.2 +++ b/templates/native/int.c Mon Apr 03 01:36:47 2017 +0200
1.3 @@ -192,6 +192,28 @@
1.4 return __new_int(i ^ j);
1.5 }
1.6
1.7 +__attr __fn_native_int_int_lshift(__attr __self, __attr self, __attr other)
1.8 +{
1.9 + /* self and other interpreted as int */
1.10 + int i = __TOINT(self);
1.11 + int j = __TOINT(other);
1.12 +
1.13 + /* Return the new integer. */
1.14 + /* NOTE: No overflow test applied. */
1.15 + return __new_int(i << j);
1.16 +}
1.17 +
1.18 +__attr __fn_native_int_int_rshift(__attr __self, __attr self, __attr other)
1.19 +{
1.20 + /* self and other interpreted as int */
1.21 + int i = __TOINT(self);
1.22 + int j = __TOINT(other);
1.23 +
1.24 + /* Return the new integer. */
1.25 + /* NOTE: No overflow test applied. */
1.26 + return __new_int(i >> j);
1.27 +}
1.28 +
1.29 __attr __fn_native_int_int_le(__attr __self, __attr self, __attr other)
1.30 {
1.31 /* self and other interpreted as int */