by Illasera » Thu May 18, 2017 11:20 am
Time for another question, Any support for C standard library math functions via callbacks on zscript? (sqrt, log and friends)
that should be safe to add i believe, I am talking about callbacks in zscript that are directly linked to the c standard library under gzdoom.
If so, how do i access them? if there is a wiki page on it? i did look for it , couldn't find it, do i access it as i would with a normal c function?
i can write them myself under zscript if they do not exist as of yet but i am afraid the overhead will be too great if i am to use them in a recursive manner,
some of them can be really expansive (Due to lack of optimization and prefetching), specially when handling functions that use division operator a lot (For those who don't know, dividing stuff , both integers and floating points can be very expansive on the x86 family of hardware, can span up to hundrads of cycles (SIMD excluded) not taking into account cache misses, but that's another topic).
As far as having a scripter writing them in zscript, Such functions do go through a lot of optimization under most C standard libraries, hence their version is better. a direct callback is preferable.
Thanks in advance for any answer towards the question above.