Re: [PATCH 2/8] opensm/complib: define if statements with branch prediction hints

2012-09-11 Thread Yevgeny Kliteynik
I would not abstract the 'if' statement. If CL_PREDICT_FALSE/TRUE are not readable, then shorten those. if (PF(...)) is just as readable as if_PF(...) OK, agree. I'll issue a v2 shortly - the only difference would be change in this macro and rebase to the updated trunk. -- YK --

RE: [PATCH 2/8] opensm/complib: define if statements with branch prediction hints

2012-08-27 Thread Hefty, Sean
On 8/15/2012 12:54 AM, Jason Gunthorpe wrote: On Tue, Aug 14, 2012 at 09:39:23PM +, Hefty, Sean wrote: +#define if_PF(cond) if(CL_PREDICT_FALSE(cond)) +#define if_PT(cond) if(CL_PREDICT_TRUE(cond)) If CL_PREDICT_TRUE/FALSE are too long, why not just shorten

Re: [PATCH 2/8] opensm/complib: define if statements with branch prediction hints

2012-08-26 Thread Yevgeny Kliteynik
On 8/26/2012 4:43 PM, Yevgeny Kliteynik wrote: If you are typing these so often (ie more than in some datastructure kernels) that the length is a problem then you really should be using profile guided optimization instead... I'm trying to optimize all the 'if' conditions in the SM.

[PATCH 2/8] opensm/complib: define if statements with branch prediction hints

2012-08-14 Thread Yevgeny Kliteynik
Defined if_PT and if_PF for predict true and predict false respectively. Signed-off-by: Yevgeny Kliteynik klit...@dev.mellanox.co.il --- include/complib/cl_types_osd.h | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/include/complib/cl_types_osd.h

RE: [PATCH 2/8] opensm/complib: define if statements with branch prediction hints

2012-08-14 Thread Hefty, Sean
+#define if_PF(cond) if(CL_PREDICT_FALSE(cond)) +#define if_PT(cond) if(CL_PREDICT_TRUE(cond)) If CL_PREDICT_TRUE/FALSE are too long, why not just shorten those, rather than abstract if statements behind a macro? -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH 2/8] opensm/complib: define if statements with branch prediction hints

2012-08-14 Thread Jason Gunthorpe
On Tue, Aug 14, 2012 at 09:39:23PM +, Hefty, Sean wrote: +#define if_PF(cond)if(CL_PREDICT_FALSE(cond)) +#define if_PT(cond)if(CL_PREDICT_TRUE(cond)) If CL_PREDICT_TRUE/FALSE are too long, why not just shorten those, rather than abstract if statements