diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-10-04 19:49:02 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-10-04 19:49:02 +0200 |
commit | d2af6b40af268fafdbd04c0222e785167b9ae021 (patch) | |
tree | e9af398812fffa0d3209780e09731a1e533bb83f /sys/src/libc/arm | |
parent | 9124e491e5d172feec53dd662c2fe6d999cb2d3f (diff) |
libc: add _uv2d()/uv2f() and _vas*d() functions to vlrt.c
on 32 bit archs, implement 64 bit vasop with floatingpoint right hand side.
also added is uvlong->double conversion function.
Diffstat (limited to 'sys/src/libc/arm')
-rw-r--r-- | sys/src/libc/arm/vlrt.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sys/src/libc/arm/vlrt.c b/sys/src/libc/arm/vlrt.c index 6a0c5df6a..cba8b27f1 100644 --- a/sys/src/libc/arm/vlrt.c +++ b/sys/src/libc/arm/vlrt.c @@ -128,6 +128,43 @@ _v2f(Vlong x) return _v2d(x); } +double +_uv2d(Vlong x) +{ + return x.hi*4294967296. + x.lo; +} + +float +_uv2f(Vlong x) +{ + return _uv2d(x); +} + +void +_vasaddd(Vlong *ret, Vlong *lv, double v2d(Vlong), double rv) +{ + _d2v(lv, v2d(*lv)+rv); + *ret = *lv; +} +void +_vassubd(Vlong *ret, Vlong *lv, double v2d(Vlong), double rv) +{ + _d2v(lv, v2d(*lv)-rv); + *ret = *lv; +} +void +_vasmuld(Vlong *ret, Vlong *lv, double v2d(Vlong), double rv) +{ + _d2v(lv, v2d(*lv)*rv); + *ret = *lv; +} +void +_vasdivd(Vlong *ret, Vlong *lv, double v2d(Vlong), double rv) +{ + _d2v(lv, v2d(*lv)/rv); + *ret = *lv; +} + /* too many of these are also needed by profiler; leave them out */ #pragma profile off |