aboutsummaryrefslogtreecommitdiffstats
path: root/src/zor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/zor.c')
-rw-r--r--src/zor.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/zor.c b/src/zor.c
index 2152c7f..ed952ca 100644
--- a/src/zor.c
+++ b/src/zor.c
@@ -2,27 +2,6 @@
#include "internals.h"
-O2 static inline void
-zor_impl_3(register zahl_char_t *restrict a,
- register const zahl_char_t *restrict b, size_t n)
-{
- size_t i;
- for (i = 0; i < n; i++)
- a[i] |= b[i];
-}
-
-static inline void
-zor_impl_5(register zahl_char_t *restrict a,
- register const zahl_char_t *restrict b, size_t n,
- register const zahl_char_t *restrict c, size_t m)
-{
- size_t i;
- for (i = 0; i < n; i++)
- a[i] = b[i] | c[i];
- for (; i < m; i++)
- a[i] = c[i];
-}
-
void
zor(z_t a, z_t b, z_t c)
{
@@ -40,17 +19,19 @@ zor(z_t a, z_t b, z_t c)
ENSURE_SIZE(a, m);
if (a == b) {
- zor_impl_3(a->chars, c->chars, n);
+ ZMEM_OP(a->chars, a->chars, c->chars, n, |);
if (a->used < c->used)
zmemcpy_range(a->chars, c->chars, n, m);
} else if (unlikely(a == c)) {
- zor_impl_3(a->chars, b->chars, n);
+ ZMEM_OP(a->chars, a->chars, b->chars, n, |);
if (a->used < b->used)
zmemcpy_range(a->chars, b->chars, n, m);
} else if (m == b->used) {
- zor_impl_5(a->chars, c->chars, n, b->chars, m);
+ ZMEM_OP(a->chars, c->chars, b->chars, n, |);
+ zmemcpy_range(a->chars, b->chars, n, m);
} else {
- zor_impl_5(a->chars, b->chars, n, c->chars, m);
+ ZMEM_OP(a->chars, b->chars, c->chars, n, |);
+ zmemcpy_range(a->chars, c->chars, n, m);
}
a->used = m;