I have c inline function which may get constant int as argument:
static __always_inline uint32_t funcA(uint32_t num)
{
//do something with that num
}
I want to run this function with the numbers: 0-100, and I want the compiler to write the function assembler code 100 times, each time with different value.
for(uint32_t i=0;i<100;i++)
{
funcA(i);
}
Is it possible to run the function in a loop, and somehow to cause the compiler to duplicate it's assembler? or I need to write this function call 100 times?
Note: this is not duplicate of http://stackoverflow.com/questions/4071690/tell-gcc-to-specifically-unroll-a-loop
because the solution suggested there, causes GCC errors regarding to inline assembler as I wrote below.