summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-05-17 18:04:56 +0000
committerMatt Turner <mattst88@gmail.com>2008-05-17 18:04:56 +0000
commitc626d4b1794a9597f168f82420a1d3deab4c6642 (patch)
tree3d0eb989211554646abb87b8618fb20db7876c25
parent79bf34419f2b1ad8bb6fab4b42c1bd044821b245 (diff)
Add mmx equivalent paddb function
git-svn-id: svn://mattst88.com/svn/alpha_mmintrin/trunk@5 f7d56953-e76f-4e43-a77e-20d50f6c004e
-rw-r--r--alpha_mmintrin.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/alpha_mmintrin.h b/alpha_mmintrin.h
index 525f04d..d741005 100644
--- a/alpha_mmintrin.h
+++ b/alpha_mmintrin.h
@@ -45,7 +45,18 @@ __ctlz(uint64_t val) {
return ret;
}
-/* Add the 16-bit values in M1 to the 16-bit values in M2 (paddw). */
+/* Add the 8-bit values in M! to the 8-bit values in M2 (paddb). */
+static __inline uint64_t
+__addub8(uint64_t m1, uint64_t m2) {
+ uint64_t signs = (m1 ^ m2) & 0x8080808080808080;
+ m1 &= ~signs;
+ m2 &= ~signs;
+ m1 += m2;
+ m1 ^= signs;
+ return m1;
+}
+
+/* Add the 16-bit values in M1 to the 16-bit values in M2 (paddw). */
static __inline uint64_t
__adduw4(uint64_t m1, uint64_t m2) {
uint64_t signs = (m1 ^ m2) & 0x8000800080008000;