From 6e680aa31c9ff0a2705452801664ce6e3d0545e3 Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 6 Jan 2016 11:48:18 +0100 Subject: [PATCH] Workaround for either pocl or llvm fails and produces invalid optimized code --- include/kernel_functions.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/kernel_functions.c b/include/kernel_functions.c index b5cad0f..31835da 100644 --- a/include/kernel_functions.c +++ b/include/kernel_functions.c @@ -150,8 +150,12 @@ #define SHA1_F0(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) #define SHA1_F1(x,y,z) ((x) ^ (y) ^ (z)) #define SHA1_F2(x,y,z) (((x) & (y)) | ((z) & ((x) ^ (y)))) -#define SHA1_F0o(x,y,z) (SHA1_F0 ((x), (y), (z))) -#define SHA1_F2o(x,y,z) (SHA1_F2 ((x), (y), (z))) +// either pocl or llvm fails and produces invalid optimized code +//#define SHA1_F0o(x,y,z) (SHA1_F0 ((x), (y), (z))) +//#define SHA1_F2o(x,y,z) (SHA1_F2 ((x), (y), (z))) +// luckily we can use bitselect as a workaround +#define SHA1_F0o(x,y,z) (bitselect ((z), (y), (x))) +#define SHA1_F2o(x,y,z) (bitselect ((x), (y), ((x) ^ (z)))) #endif #define SHA1_STEP(f,a,b,c,d,e,x) \ -- 2.43.0