diff --git a/lib/std/bits.c3 b/lib/std/bits.c3 index 1a6e7fd17..5807e3e92 100644 --- a/lib/std/bits.c3 +++ b/lib/std/bits.c3 @@ -59,3 +59,20 @@ macro fshr(hi, lo, shift) @builtin { return $$fshr(hi, lo, ($typeof(hi))shift); } + +/** + * @require types::is_intlike($typeof(i)) && types::is_intlike($typeof(amount)) `The input must be an integer or integer vector` + **/ +macro rotate_left(i, amount) @builtin +{ + return $$fshl(i, i, ($typeof(i))amount); +} + +/** + * @require types::is_intlike($typeof(i)) && types::is_intlike($typeof(amount)) `The input must be an integer or integer vector` + **/ +macro rotate_right(i, amount) @builtin +{ + return $$fshr(i, i, ($typeof(i))amount); +} +