mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add rotate_left and rotate_right macros
This commit is contained in:
committed by
Christoffer Lerno
parent
dabe5769dd
commit
27a0e12979
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user