From 723baca4c2cb23e1a19de92a8afc86c771eb88e1 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Thu, 11 Sep 2014 15:18:36 +0400 Subject: [PATCH] added several useful defines and a warning that '__vec16_i1' might not be working with embree --- examples/intrinsics/knc.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/intrinsics/knc.h b/examples/intrinsics/knc.h index 1c9696a6..08037728 100644 --- a/examples/intrinsics/knc.h +++ b/examples/intrinsics/knc.h @@ -44,6 +44,15 @@ #include // for operator<<(m512[i]) #include // for operator<<(m512[i]) +#define STRING(x) #x +#define TOSTRING(x) STRING(x) +#define PING std::cout << __FILE__ << " (" << __LINE__ << "): " << __FUNCTION__ << std::endl +#define PRINT(x) std::cout << STRING(x) << " = " << (x) << std::endl +#define PRINT2(x,y) std::cout << STRING(x) << " = " << (x) << ", " << STRING(y) << " = " << (y) << std::endl +#define PRINT3(x,y,z) std::cout << STRING(x) << " = " << (x) << ", " << STRING(y) << " = " << (y) << ", " << STRING(z) << " = " << (z) << std::endl +#define PRINT4(x,y,z,w) std::cout << STRING(x) << " = " << (x) << ", " << STRING(y) << " = " << (y) << ", " << STRING(z) << " = " << (z) << ", " << STRING(w) << " = " << (w) << std::endl + + #define FORCEINLINE __forceinline #ifdef _MSC_VER #define PRE_ALIGN(x) /*__declspec(align(x))*/ @@ -75,8 +84,11 @@ typedef int64_t __vec1_i64; struct __vec16_i32; -//typedef __mmask16 POST_ALIGN(2) __vec16_i1; - +/* (iw) actually, this *SHOULD* be the right implementation for a + vec16_i1: this one is a class that can have a constructor (which + ISPC sometimes emits for these vectors...) This version might + not be working with embree's ISPC bindings, probably because + embree still uses the 'wrong' implementation */ typedef struct PRE_ALIGN(2) __vec16_i1 { FORCEINLINE operator __mmask16() const { return v; }