Skip to content
Snippets Groups Projects
Commit b0635c78 authored by Radek Hušek's avatar Radek Hušek Committed by Radek Hušek
Browse files

Speed optimization of Z4

Replacement of % 4 with faster & 3
parent d09eeeab
Branches
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ template < typename T_ > struct Name { \ ...@@ -14,7 +14,7 @@ template < typename T_ > struct Name { \
static const T zero = 0; \ static const T zero = 0; \
} }
MakeRing(Z4, 4, (a + b) % 4, (4 - a) % 4, (a * b) % 4, 1); MakeRing(Z4, 4, (a + b) & 3, (4 - a) & 3, (a * b) & 3, 1);
MakeRing(Z2_2, 4, a^b, a, a&b, 3); MakeRing(Z2_2, 4, a^b, a, a&b, 3);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment