From c626d4b1794a9597f168f82420a1d3deab4c6642 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 17 May 2008 18:04:56 +0000 Subject: Add mmx equivalent paddb function git-svn-id: svn://mattst88.com/svn/alpha_mmintrin/trunk@5 f7d56953-e76f-4e43-a77e-20d50f6c004e --- alpha_mmintrin.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3