projects
/
sfpy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
518c4b4
)
revise fma/qma interface to match SoftPosit
author
Bill Zorn
<bill.zorn@gmail.com>
Thu, 9 Aug 2018 00:23:27 +0000
(17:23 -0700)
committer
Bill Zorn
<bill.zorn@gmail.com>
Thu, 9 Aug 2018 00:23:27 +0000
(17:23 -0700)
sfpy/float.pyx
patch
|
blob
|
history
sfpy/posit.pyx
patch
|
blob
|
history
diff --git
a/sfpy/float.pyx
b/sfpy/float.pyx
index 968323f8f0f90191ad09702f69b68913b069bfb7..daf21a225bb741ca37a61838d0583087976f44d0 100644
(file)
--- a/
sfpy/float.pyx
+++ b/
sfpy/float.pyx
@@
-261,11
+261,7
@@
cdef class Float16:
def __mul__(self, Float16 other):
return self.mul(other)
def __mul__(self, Float16 other):
return self.mul(other)
- cpdef Float16 fma(self, Float16 a2, Float16 a3):
- cdef cfloat.float16_t f = cfloat.f16_mulAdd(self._c_float, a2._c_float, a3._c_float)
- return Float16.from_c_float(f)
-
- cpdef Float16 fam(self, Float16 a1, Float16 a2):
+ cpdef Float16 fma(self, Float16 a1, Float16 a2):
cdef cfloat.float16_t f = cfloat.f16_mulAdd(a1._c_float, a2._c_float, self._c_float)
return Float16.from_c_float(f)
cdef cfloat.float16_t f = cfloat.f16_mulAdd(a1._c_float, a2._c_float, self._c_float)
return Float16.from_c_float(f)
@@
-319,10
+315,7
@@
cdef class Float16:
self.imul(other)
return self
self.imul(other)
return self
- cpdef void ifma(self, Float16 a2, Float16 a3):
- self._c_float = cfloat.f16_mulAdd(self._c_float, a2._c_float, a3._c_float)
-
- cpdef void ifam(self, Float16 a1, Float16 a2):
+ cpdef void ifma(self, Float16 a1, Float16 a2):
self._c_float = cfloat.f16_mulAdd(a1._c_float, a2._c_float, self._c_float)
cpdef void idiv(self, Float16 other):
self._c_float = cfloat.f16_mulAdd(a1._c_float, a2._c_float, self._c_float)
cpdef void idiv(self, Float16 other):
@@
-408,12
+401,8
@@
cpdef Float16 f16_mul(Float16 a1, Float16 a2):
cdef cfloat.float16_t f = cfloat.f16_mul(a1._c_float, a2._c_float)
return Float16.from_c_float(f)
cdef cfloat.float16_t f = cfloat.f16_mul(a1._c_float, a2._c_float)
return Float16.from_c_float(f)
-cpdef Float16 f16_fma(Float16 a1, Float16 a2, Float16 a3):
- cdef cfloat.float16_t f = cfloat.f16_mulAdd(a1._c_float, a2._c_float, a3._c_float)
- return Float16.from_c_float(f)
-
-cpdef Float16 f16_fam(Float16 a3, Float16 a1, Float16 a2):
- cdef cfloat.float16_t f = cfloat.f16_mulAdd(a1._c_float, a2._c_float, a3._c_float)
+cpdef Float16 f16_fma(Float16 acc, Float16 a1, Float16 a2):
+ cdef cfloat.float16_t f = cfloat.f16_mulAdd(a1._c_float, a2._c_float, acc._c_float)
return Float16.from_c_float(f)
cpdef Float16 f16_div(Float16 a1, Float16 a2):
return Float16.from_c_float(f)
cpdef Float16 f16_div(Float16 a1, Float16 a2):
@@
-570,11
+559,7
@@
cdef class Float32:
def __mul__(self, Float32 other):
return self.mul(other)
def __mul__(self, Float32 other):
return self.mul(other)
- cpdef Float32 fma(self, Float32 a2, Float32 a3):
- cdef cfloat.float32_t f = cfloat.f32_mulAdd(self._c_float, a2._c_float, a3._c_float)
- return Float32.from_c_float(f)
-
- cpdef Float32 fam(self, Float32 a1, Float32 a2):
+ cpdef Float32 fma(self, Float32 a1, Float32 a2):
cdef cfloat.float32_t f = cfloat.f32_mulAdd(a1._c_float, a2._c_float, self._c_float)
return Float32.from_c_float(f)
cdef cfloat.float32_t f = cfloat.f32_mulAdd(a1._c_float, a2._c_float, self._c_float)
return Float32.from_c_float(f)
@@
-628,10
+613,7
@@
cdef class Float32:
self.imul(other)
return self
self.imul(other)
return self
- cpdef void ifma(self, Float32 a2, Float32 a3):
- self._c_float = cfloat.f32_mulAdd(self._c_float, a2._c_float, a3._c_float)
-
- cpdef void ifam(self, Float32 a1, Float32 a2):
+ cpdef void ifma(self, Float32 a1, Float32 a2):
self._c_float = cfloat.f32_mulAdd(a1._c_float, a2._c_float, self._c_float)
cpdef void idiv(self, Float32 other):
self._c_float = cfloat.f32_mulAdd(a1._c_float, a2._c_float, self._c_float)
cpdef void idiv(self, Float32 other):
@@
-717,12
+699,8
@@
cpdef Float32 f32_mul(Float32 a1, Float32 a2):
cdef cfloat.float32_t f = cfloat.f32_mul(a1._c_float, a2._c_float)
return Float32.from_c_float(f)
cdef cfloat.float32_t f = cfloat.f32_mul(a1._c_float, a2._c_float)
return Float32.from_c_float(f)
-cpdef Float32 f32_fma(Float32 a1, Float32 a2, Float32 a3):
- cdef cfloat.float32_t f = cfloat.f32_mulAdd(a1._c_float, a2._c_float, a3._c_float)
- return Float32.from_c_float(f)
-
-cpdef Float32 f32_fam(Float32 a3, Float32 a1, Float32 a2):
- cdef cfloat.float32_t f = cfloat.f32_mulAdd(a1._c_float, a2._c_float, a3._c_float)
+cpdef Float32 f32_fma(Float32 acc, Float32 a1, Float32 a2):
+ cdef cfloat.float32_t f = cfloat.f32_mulAdd(a1._c_float, a2._c_float, acc._c_float)
return Float32.from_c_float(f)
cpdef Float32 f32_div(Float32 a1, Float32 a2):
return Float32.from_c_float(f)
cpdef Float32 f32_div(Float32 a1, Float32 a2):
@@
-877,11
+855,7
@@
cdef class Float64:
def __mul__(self, Float64 other):
return self.mul(other)
def __mul__(self, Float64 other):
return self.mul(other)
- cpdef Float64 fma(self, Float64 a2, Float64 a3):
- cdef cfloat.float64_t f = cfloat.f64_mulAdd(self._c_float, a2._c_float, a3._c_float)
- return Float64.from_c_float(f)
-
- cpdef Float64 fam(self, Float64 a1, Float64 a2):
+ cpdef Float64 fma(self, Float64 a1, Float64 a2):
cdef cfloat.float64_t f = cfloat.f64_mulAdd(a1._c_float, a2._c_float, self._c_float)
return Float64.from_c_float(f)
cdef cfloat.float64_t f = cfloat.f64_mulAdd(a1._c_float, a2._c_float, self._c_float)
return Float64.from_c_float(f)
@@
-935,10
+909,7
@@
cdef class Float64:
self.imul(other)
return self
self.imul(other)
return self
- cpdef void ifma(self, Float64 a2, Float64 a3):
- self._c_float = cfloat.f64_mulAdd(self._c_float, a2._c_float, a3._c_float)
-
- cpdef void ifam(self, Float64 a1, Float64 a2):
+ cpdef void ifma(self, Float64 a1, Float64 a2):
self._c_float = cfloat.f64_mulAdd(a1._c_float, a2._c_float, self._c_float)
cpdef void idiv(self, Float64 other):
self._c_float = cfloat.f64_mulAdd(a1._c_float, a2._c_float, self._c_float)
cpdef void idiv(self, Float64 other):
@@
-1024,12
+995,8
@@
cpdef Float64 f64_mul(Float64 a1, Float64 a2):
cdef cfloat.float64_t f = cfloat.f64_mul(a1._c_float, a2._c_float)
return Float64.from_c_float(f)
cdef cfloat.float64_t f = cfloat.f64_mul(a1._c_float, a2._c_float)
return Float64.from_c_float(f)
-cpdef Float64 f64_fma(Float64 a1, Float64 a2, Float64 a3):
- cdef cfloat.float64_t f = cfloat.f64_mulAdd(a1._c_float, a2._c_float, a3._c_float)
- return Float64.from_c_float(f)
-
-cpdef Float64 f64_fam(Float64 a3, Float64 a1, Float64 a2):
- cdef cfloat.float64_t f = cfloat.f64_mulAdd(a1._c_float, a2._c_float, a3._c_float)
+cpdef Float64 f64_fma(Float64 acc, Float64 a1, Float64 a2):
+ cdef cfloat.float64_t f = cfloat.f64_mulAdd(a1._c_float, a2._c_float, acc._c_float)
return Float64.from_c_float(f)
cpdef Float64 f64_div(Float64 a1, Float64 a2):
return Float64.from_c_float(f)
cpdef Float64 f64_div(Float64 a1, Float64 a2):
diff --git
a/sfpy/posit.pyx
b/sfpy/posit.pyx
index f2f76a706996899af8025902de69b4b521db0727..fac8280b0faed279e6a5816f9720194f4347b978 100644
(file)
--- a/
sfpy/posit.pyx
+++ b/
sfpy/posit.pyx
@@
-135,11
+135,7
@@
cdef class Posit8:
def __mul__(self, Posit8 other):
return self.mul(other)
def __mul__(self, Posit8 other):
return self.mul(other)
- cpdef Posit8 fma(self, Posit8 a2, Posit8 a3):
- cdef cposit.posit8_t f = cposit.p8_mulAdd(self._c_posit, a2._c_posit, a3._c_posit)
- return Posit8.from_c_posit(f)
-
- cpdef Posit8 fam(self, Posit8 a1, Posit8 a2):
+ cpdef Posit8 fma(self, Posit8 a1, Posit8 a2):
cdef cposit.posit8_t f = cposit.p8_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
return Posit8.from_c_posit(f)
cdef cposit.posit8_t f = cposit.p8_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
return Posit8.from_c_posit(f)
@@
-186,10
+182,7
@@
cdef class Posit8:
self.imul(other)
return self
self.imul(other)
return self
- cpdef void ifma(self, Posit8 a2, Posit8 a3):
- self._c_posit = cposit.p8_mulAdd(self._c_posit, a2._c_posit, a3._c_posit)
-
- cpdef void ifam(self, Posit8 a1, Posit8 a2):
+ cpdef void ifma(self, Posit8 a1, Posit8 a2):
self._c_posit = cposit.p8_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
cpdef void idiv(self, Posit8 other):
self._c_posit = cposit.p8_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
cpdef void idiv(self, Posit8 other):
@@
-301,18
+294,18
@@
cdef class Quire8:
# arithmetic
# arithmetic
- cpdef Quire8 q
am
(self, Posit8 a1, Posit8 a2):
+ cpdef Quire8 q
ma
(self, Posit8 a1, Posit8 a2):
cdef cposit.quire8_t f = cposit.q8_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
return Quire8.from_c_quire(f)
cdef cposit.quire8_t f = cposit.q8_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
return Quire8.from_c_quire(f)
- cpdef Quire8 q
sm
(self, Posit8 a1, Posit8 a2):
+ cpdef Quire8 q
ms
(self, Posit8 a1, Posit8 a2):
cdef cposit.quire8_t f = cposit.q8_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
return Quire8.from_c_quire(f)
cdef cposit.quire8_t f = cposit.q8_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
return Quire8.from_c_quire(f)
- cpdef void iq
am
(self, Posit8 a1, Posit8 a2):
+ cpdef void iq
ma
(self, Posit8 a1, Posit8 a2):
self._c_quire = cposit.q8_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
self._c_quire = cposit.q8_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
- cpdef void iq
sm
(self, Posit8 a1, Posit8 a2):
+ cpdef void iq
ms
(self, Posit8 a1, Posit8 a2):
self._c_quire = cposit.q8_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
cpdef void iclr(self):
self._c_quire = cposit.q8_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
cpdef void iclr(self):
@@
-351,12
+344,8
@@
cpdef Posit8 p8_mul(Posit8 a1, Posit8 a2):
cdef cposit.posit8_t f = cposit.p8_mul(a1._c_posit, a2._c_posit)
return Posit8.from_c_posit(f)
cdef cposit.posit8_t f = cposit.p8_mul(a1._c_posit, a2._c_posit)
return Posit8.from_c_posit(f)
-cpdef Posit8 p8_fma(Posit8 a1, Posit8 a2, Posit8 a3):
- cdef cposit.posit8_t f = cposit.p8_mulAdd(a1._c_posit, a2._c_posit, a3._c_posit)
- return Posit8.from_c_posit(f)
-
-cpdef Posit8 p8_fam(Posit8 a3, Posit8 a1, Posit8 a2):
- cdef cposit.posit8_t f = cposit.p8_mulAdd(a1._c_posit, a2._c_posit, a3._c_posit)
+cpdef Posit8 p8_fma(Posit8 acc, Posit8 a1, Posit8 a2):
+ cdef cposit.posit8_t f = cposit.p8_mulAdd(a1._c_posit, a2._c_posit, acc._c_posit)
return Posit8.from_c_posit(f)
cpdef Posit8 p8_div(Posit8 a1, Posit8 a2):
return Posit8.from_c_posit(f)
cpdef Posit8 p8_div(Posit8 a1, Posit8 a2):
@@
-390,12
+379,12
@@
cpdef Quire8 p8_to_q8(Posit8 a1):
f = cposit.q8_fdp_add(f, a1._c_posit, _p8_one)
return Quire8.from_c_quire(f)
f = cposit.q8_fdp_add(f, a1._c_posit, _p8_one)
return Quire8.from_c_quire(f)
-cpdef Quire8 q8_q
am(Quire8 a3
, Posit8 a1, Posit8 a2):
- cdef cposit.quire8_t f = cposit.q8_fdp_add(a
3
._c_quire, a1._c_posit, a2._c_posit)
+cpdef Quire8 q8_q
ma(Quire8 acc
, Posit8 a1, Posit8 a2):
+ cdef cposit.quire8_t f = cposit.q8_fdp_add(a
cc
._c_quire, a1._c_posit, a2._c_posit)
return Quire8.from_c_quire(f)
return Quire8.from_c_quire(f)
-cpdef Quire8 q8_q
sm(Quire8 a3
, Posit8 a1, Posit8 a2):
- cdef cposit.quire8_t f = cposit.q8_fdp_sub(a
3
._c_quire, a1._c_posit, a2._c_posit)
+cpdef Quire8 q8_q
ms(Quire8 acc
, Posit8 a1, Posit8 a2):
+ cdef cposit.quire8_t f = cposit.q8_fdp_sub(a
cc
._c_quire, a1._c_posit, a2._c_posit)
return Quire8.from_c_quire(f)
cpdef Posit8 q8_to_p8(Quire8 a1):
return Quire8.from_c_quire(f)
cpdef Posit8 q8_to_p8(Quire8 a1):
@@
-505,11
+494,7
@@
cdef class Posit16:
def __mul__(self, Posit16 other):
return self.mul(other)
def __mul__(self, Posit16 other):
return self.mul(other)
- cpdef Posit16 fma(self, Posit16 a2, Posit16 a3):
- cdef cposit.posit16_t f = cposit.p16_mulAdd(self._c_posit, a2._c_posit, a3._c_posit)
- return Posit16.from_c_posit(f)
-
- cpdef Posit16 fam(self, Posit16 a1, Posit16 a2):
+ cpdef Posit16 fma(self, Posit16 a1, Posit16 a2):
cdef cposit.posit16_t f = cposit.p16_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
return Posit16.from_c_posit(f)
cdef cposit.posit16_t f = cposit.p16_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
return Posit16.from_c_posit(f)
@@
-556,10
+541,7
@@
cdef class Posit16:
self.imul(other)
return self
self.imul(other)
return self
- cpdef void ifma(self, Posit16 a2, Posit16 a3):
- self._c_posit = cposit.p16_mulAdd(self._c_posit, a2._c_posit, a3._c_posit)
-
- cpdef void ifam(self, Posit16 a1, Posit16 a2):
+ cpdef void ifma(self, Posit16 a1, Posit16 a2):
self._c_posit = cposit.p16_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
cpdef void idiv(self, Posit16 other):
self._c_posit = cposit.p16_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
cpdef void idiv(self, Posit16 other):
@@
-689,18
+671,18
@@
cdef class Quire16:
# arithmetic
# arithmetic
- cpdef Quire16 q
am
(self, Posit16 a1, Posit16 a2):
+ cpdef Quire16 q
ma
(self, Posit16 a1, Posit16 a2):
cdef cposit.quire16_t f = cposit.q16_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
return Quire16.from_c_quire(f)
cdef cposit.quire16_t f = cposit.q16_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
return Quire16.from_c_quire(f)
- cpdef Quire16 q
sm
(self, Posit16 a1, Posit16 a2):
+ cpdef Quire16 q
ms
(self, Posit16 a1, Posit16 a2):
cdef cposit.quire16_t f = cposit.q16_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
return Quire16.from_c_quire(f)
cdef cposit.quire16_t f = cposit.q16_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
return Quire16.from_c_quire(f)
- cpdef void iq
am
(self, Posit16 a1, Posit16 a2):
+ cpdef void iq
ma
(self, Posit16 a1, Posit16 a2):
self._c_quire = cposit.q16_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
self._c_quire = cposit.q16_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
- cpdef void iq
sm
(self, Posit16 a1, Posit16 a2):
+ cpdef void iq
ms
(self, Posit16 a1, Posit16 a2):
self._c_quire = cposit.q16_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
cpdef void iclr(self):
self._c_quire = cposit.q16_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
cpdef void iclr(self):
@@
-739,12
+721,8
@@
cpdef Posit16 p16_mul(Posit16 a1, Posit16 a2):
cdef cposit.posit16_t f = cposit.p16_mul(a1._c_posit, a2._c_posit)
return Posit16.from_c_posit(f)
cdef cposit.posit16_t f = cposit.p16_mul(a1._c_posit, a2._c_posit)
return Posit16.from_c_posit(f)
-cpdef Posit16 p16_fma(Posit16 a1, Posit16 a2, Posit16 a3):
- cdef cposit.posit16_t f = cposit.p16_mulAdd(a1._c_posit, a2._c_posit, a3._c_posit)
- return Posit16.from_c_posit(f)
-
-cpdef Posit16 p16_fam(Posit16 a3, Posit16 a1, Posit16 a2):
- cdef cposit.posit16_t f = cposit.p16_mulAdd(a1._c_posit, a2._c_posit, a3._c_posit)
+cpdef Posit16 p16_fma(Posit16 acc, Posit16 a1, Posit16 a2):
+ cdef cposit.posit16_t f = cposit.p16_mulAdd(a1._c_posit, a2._c_posit, acc._c_posit)
return Posit16.from_c_posit(f)
cpdef Posit16 p16_div(Posit16 a1, Posit16 a2):
return Posit16.from_c_posit(f)
cpdef Posit16 p16_div(Posit16 a1, Posit16 a2):
@@
-778,12
+756,12
@@
cpdef Quire16 p16_to_q16(Posit16 a1):
f = cposit.q16_fdp_add(f, a1._c_posit, _p16_one)
return Quire16.from_c_quire(f)
f = cposit.q16_fdp_add(f, a1._c_posit, _p16_one)
return Quire16.from_c_quire(f)
-cpdef Quire16 q16_q
am(Quire16 a3
, Posit16 a1, Posit16 a2):
- cdef cposit.quire16_t f = cposit.q16_fdp_add(a
3
._c_quire, a1._c_posit, a2._c_posit)
+cpdef Quire16 q16_q
ma(Quire16 acc
, Posit16 a1, Posit16 a2):
+ cdef cposit.quire16_t f = cposit.q16_fdp_add(a
cc
._c_quire, a1._c_posit, a2._c_posit)
return Quire16.from_c_quire(f)
return Quire16.from_c_quire(f)
-cpdef Quire16 q16_q
sm(Quire16 a3
, Posit16 a1, Posit16 a2):
- cdef cposit.quire16_t f = cposit.q16_fdp_sub(a
3
._c_quire, a1._c_posit, a2._c_posit)
+cpdef Quire16 q16_q
ms(Quire16 acc
, Posit16 a1, Posit16 a2):
+ cdef cposit.quire16_t f = cposit.q16_fdp_sub(a
cc
._c_quire, a1._c_posit, a2._c_posit)
return Quire16.from_c_quire(f)
cpdef Posit16 q16_to_p16(Quire16 a1):
return Quire16.from_c_quire(f)
cpdef Posit16 q16_to_p16(Quire16 a1):
@@
-893,11
+871,7
@@
cdef class Posit32:
def __mul__(self, Posit32 other):
return self.mul(other)
def __mul__(self, Posit32 other):
return self.mul(other)
- cpdef Posit32 fma(self, Posit32 a2, Posit32 a3):
- cdef cposit.posit32_t f = cposit.p32_mulAdd(self._c_posit, a2._c_posit, a3._c_posit)
- return Posit32.from_c_posit(f)
-
- cpdef Posit32 fam(self, Posit32 a1, Posit32 a2):
+ cpdef Posit32 fma(self, Posit32 a1, Posit32 a2):
cdef cposit.posit32_t f = cposit.p32_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
return Posit32.from_c_posit(f)
cdef cposit.posit32_t f = cposit.p32_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
return Posit32.from_c_posit(f)
@@
-944,10
+918,7
@@
cdef class Posit32:
self.imul(other)
return self
self.imul(other)
return self
- cpdef void ifma(self, Posit32 a2, Posit32 a3):
- self._c_posit = cposit.p32_mulAdd(self._c_posit, a2._c_posit, a3._c_posit)
-
- cpdef void ifam(self, Posit32 a1, Posit32 a2):
+ cpdef void ifma(self, Posit32 a1, Posit32 a2):
self._c_posit = cposit.p32_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
cpdef void idiv(self, Posit32 other):
self._c_posit = cposit.p32_mulAdd(a1._c_posit, a2._c_posit, self._c_posit)
cpdef void idiv(self, Posit32 other):
@@
-1077,18
+1048,18
@@
cdef class Quire32:
# arithmetic
# arithmetic
- cpdef Quire32 q
am
(self, Posit32 a1, Posit32 a2):
+ cpdef Quire32 q
ma
(self, Posit32 a1, Posit32 a2):
cdef cposit.quire32_t f = cposit.q32_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
return Quire32.from_c_quire(f)
cdef cposit.quire32_t f = cposit.q32_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
return Quire32.from_c_quire(f)
- cpdef Quire32 q
sm
(self, Posit32 a1, Posit32 a2):
+ cpdef Quire32 q
ms
(self, Posit32 a1, Posit32 a2):
cdef cposit.quire32_t f = cposit.q32_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
return Quire32.from_c_quire(f)
cdef cposit.quire32_t f = cposit.q32_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
return Quire32.from_c_quire(f)
- cpdef void iq
am
(self, Posit32 a1, Posit32 a2):
+ cpdef void iq
ma
(self, Posit32 a1, Posit32 a2):
self._c_quire = cposit.q32_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
self._c_quire = cposit.q32_fdp_add(self._c_quire, a1._c_posit, a2._c_posit)
- cpdef void iq
sm
(self, Posit32 a1, Posit32 a2):
+ cpdef void iq
ms
(self, Posit32 a1, Posit32 a2):
self._c_quire = cposit.q32_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
cpdef void iclr(self):
self._c_quire = cposit.q32_fdp_sub(self._c_quire, a1._c_posit, a2._c_posit)
cpdef void iclr(self):
@@
-1127,12
+1098,8
@@
cpdef Posit32 p32_mul(Posit32 a1, Posit32 a2):
cdef cposit.posit32_t f = cposit.p32_mul(a1._c_posit, a2._c_posit)
return Posit32.from_c_posit(f)
cdef cposit.posit32_t f = cposit.p32_mul(a1._c_posit, a2._c_posit)
return Posit32.from_c_posit(f)
-cpdef Posit32 p32_fma(Posit32 a1, Posit32 a2, Posit32 a3):
- cdef cposit.posit32_t f = cposit.p32_mulAdd(a1._c_posit, a2._c_posit, a3._c_posit)
- return Posit32.from_c_posit(f)
-
-cpdef Posit32 p32_fam(Posit32 a3, Posit32 a1, Posit32 a2):
- cdef cposit.posit32_t f = cposit.p32_mulAdd(a1._c_posit, a2._c_posit, a3._c_posit)
+cpdef Posit32 p32_fma(Posit32 acc, Posit32 a1, Posit32 a2):
+ cdef cposit.posit32_t f = cposit.p32_mulAdd(a1._c_posit, a2._c_posit, acc._c_posit)
return Posit32.from_c_posit(f)
cpdef Posit32 p32_div(Posit32 a1, Posit32 a2):
return Posit32.from_c_posit(f)
cpdef Posit32 p32_div(Posit32 a1, Posit32 a2):
@@
-1166,12
+1133,12
@@
cpdef Quire32 p32_to_q32(Posit32 a1):
f = cposit.q32_fdp_add(f, a1._c_posit, _p32_one)
return Quire32.from_c_quire(f)
f = cposit.q32_fdp_add(f, a1._c_posit, _p32_one)
return Quire32.from_c_quire(f)
-cpdef Quire32 q32_q
am(Quire32 a3
, Posit32 a1, Posit32 a2):
- cdef cposit.quire32_t f = cposit.q32_fdp_add(a
3
._c_quire, a1._c_posit, a2._c_posit)
+cpdef Quire32 q32_q
ma(Quire32 acc
, Posit32 a1, Posit32 a2):
+ cdef cposit.quire32_t f = cposit.q32_fdp_add(a
cc
._c_quire, a1._c_posit, a2._c_posit)
return Quire32.from_c_quire(f)
return Quire32.from_c_quire(f)
-cpdef Quire32 q32_q
sm(Quire32 a3
, Posit32 a1, Posit32 a2):
- cdef cposit.quire32_t f = cposit.q32_fdp_sub(a
3
._c_quire, a1._c_posit, a2._c_posit)
+cpdef Quire32 q32_q
ms(Quire32 acc
, Posit32 a1, Posit32 a2):
+ cdef cposit.quire32_t f = cposit.q32_fdp_sub(a
cc
._c_quire, a1._c_posit, a2._c_posit)
return Quire32.from_c_quire(f)
cpdef Posit32 q32_to_p32(Quire32 a1):
return Quire32.from_c_quire(f)
cpdef Posit32 q32_to_p32(Quire32 a1):