[PATCH] D26890: SHA1: unroll loop in hashBlock.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 19 16:52:36 PST 2016


mehdi_amini added inline comments.


================
Comment at: lib/Support/SHA1.cpp:51
+  z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5);                 \
+  w = rol(w, 30);
+#define R1(v, w, x, y, z, i)                                                   \
----------------
joerg wrote:
> mehdi_amini wrote:
> > Why a macro for all the `RX(..)`?
> The macros reflect the building blocks of the main loop, e.g. the different constants and blocks used.
> Again, this could be an inline function with references and hoping the compiler optimised all away, but using a macro keeps the diff down.
`Keeping the diff` down is not a metric I value, especially if it is by using macros instead of functions.



https://reviews.llvm.org/D26890





More information about the llvm-commits mailing list