mirror of
https://github.com/nzp-team/dquakeplus.git
synced 2024-11-29 23:22:29 +00:00
15 lines
336 B
C
15 lines
336 B
C
#include "pspmath.h"
|
|
|
|
float vfpu_powf(float x, float y) {
|
|
float result;
|
|
// result = exp2f(y * log2f(x));
|
|
__asm__ volatile (
|
|
"mtv %1, S000\n"
|
|
"mtv %2, S001\n"
|
|
"vlog2.s S001, S001\n"
|
|
"vmul.s S000, S000, S001\n"
|
|
"vexp2.s S000, S000\n"
|
|
"mfv %0, S000\n"
|
|
: "=r"(result) : "r"(x), "r"(y));
|
|
return result;
|
|
}
|