diff options
author | Matt Turner <mattst88@gmail.com> | 2008-05-13 18:18:23 +0000 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2008-05-13 18:18:23 +0000 |
commit | 79bf34419f2b1ad8bb6fab4b42c1bd044821b245 (patch) | |
tree | e2a98d8eda2470fffee6624dfd265f625433c9f5 | |
parent | 5117e7e647d2f380a883661571e441ce603220a9 (diff) |
Add packed unsigned saturated subtraction routines
git-svn-id: svn://mattst88.com/svn/alpha_mmintrin/trunk@4 f7d56953-e76f-4e43-a77e-20d50f6c004e
-rw-r--r-- | alpha_mmintrin.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/alpha_mmintrin.h b/alpha_mmintrin.h index 34a2b63..525f04d 100644 --- a/alpha_mmintrin.h +++ b/alpha_mmintrin.h @@ -70,6 +70,20 @@ __addusw4(uint64_t m1, uint64_t m2) { return m1 + __minuw4(m2, ~m1); } +/* Subtract the 8-bit values in M1 to the 8-bit values in M2 using unsigned + * saturated arithmetic (psubusb) */ +static __inline uint64_t +__subusb8(uint64_t m1, uint64_t m2) { + return m1 - __minub8(m2, m1); +} + +/* Subtract the 16-bit values in M1 to the 16-bit values in M2 using unsigned + * saturating arithmetic (psubusw) */ +static __inline uint64_t +__subusw4(uint64_t m1, uint64_t m2) { + return m1 - __minuw4(m2, m1); +} + /* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce the low 16 bits of the results (pmullw). */ static __inline uint64_t |