mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Added initial intvec/floatvec operator
This commit is contained in:
committed by
Christoffer Lerno
parent
3d110850df
commit
3a09f71830
@@ -3,7 +3,7 @@ module std::bits;
|
||||
/**
|
||||
* @require types::is_intlike($typeof(i)) `The input must be an integer or integer vector`
|
||||
**/
|
||||
macro popcount(i)
|
||||
macro popcount(i) @operator(intvec)
|
||||
{
|
||||
return $$popcount(i);
|
||||
}
|
||||
@@ -27,7 +27,7 @@ macro bswap(i) @builtin
|
||||
/**
|
||||
* @require types::is_intlike($typeof(i)) `The input must be an integer or integer vector`
|
||||
**/
|
||||
macro ctz(i) @builtin
|
||||
macro ctz(i) @operator(intvec) @builtin
|
||||
{
|
||||
return $$ctz(i);
|
||||
}
|
||||
@@ -35,15 +35,14 @@ macro ctz(i) @builtin
|
||||
/**
|
||||
* @require types::is_intlike($typeof(i)) `The input must be an integer or integer vector`
|
||||
**/
|
||||
macro clz(i) @builtin
|
||||
macro clz(i) @operator(intvec) @builtin
|
||||
{
|
||||
return $$clz(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* @require types::is_intlike($typeof(hi)) && types::is_intlike($typeof(lo)) && types::is_intlike($typeof(shift)) `The input must be an integer or integer vector`
|
||||
* @require types::is_same_type(hi, lo) `Hi and low arguments must have the same type`
|
||||
* @require types::is_same_type(hi, shift) `The shift value must have the same type as shifted types`
|
||||
* @require types::@has_same(hi, lo, shift) `Hi, low and shift arguments must have the same type`
|
||||
**/
|
||||
macro fshl(hi, lo, shift) @builtin
|
||||
{
|
||||
@@ -52,8 +51,7 @@ macro fshl(hi, lo, shift) @builtin
|
||||
|
||||
/**
|
||||
* @require types::is_intlike($typeof(hi)) && types::is_intlike($typeof(lo)) && types::is_intlike($typeof(shift)) `The input must be an integer or integer vector`
|
||||
* @require types::is_same_type(hi, lo) `Hi and low arguments must have the same type`
|
||||
* @require types::is_same_type(hi, shift) `The shift value must have the same type as shifted types`
|
||||
* @require types::@has_same(hi, lo, shift) `Hi, low and shift arguments must have the same type`
|
||||
**/
|
||||
macro fshr(hi, lo, shift) @builtin
|
||||
{
|
||||
@@ -62,18 +60,18 @@ macro fshr(hi, lo, shift) @builtin
|
||||
|
||||
/**
|
||||
* @require types::is_intlike($typeof(i)) && types::is_intlike($typeof(shift)) `The input must be an integer or integer vector`
|
||||
* @require types::is_same_type(i, shift) `The shift value must have the same type as shifted types`
|
||||
* @require types::@has_same(i, shift) `The shift value must have the same type as shifted types`
|
||||
**/
|
||||
macro rotl(i, shift) @builtin
|
||||
macro rotl(i, shift) @operator(intvec) @builtin
|
||||
{
|
||||
return $$fshl(i, i, shift);
|
||||
}
|
||||
|
||||
/**
|
||||
* @require types::is_intlike($typeof(i)) && types::is_intlike($typeof(shift)) `The input must be an integer or integer vector`
|
||||
* @require types::is_same_type(i, shift) `The shift value must have the same type as shifted types`
|
||||
* @require types::@has_same(i, shift) `The shift value must have the same type as shifted types`
|
||||
**/
|
||||
macro rotr(i, shift) @builtin
|
||||
macro rotr(i, shift) @operator(intvec) @builtin
|
||||
{
|
||||
return $$fshr(i, i, shift);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user