Zach Amsden has posted comments on this change.

Change subject: IMPALA-2020, 4915, 4936: Add rounding for decimal casts
......................................................................


Patch Set 22:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/5951/22/be/src/runtime/decimal-value.inline.h
File be/src/runtime/decimal-value.inline.h:

PS22, Line 54: UNLIKELY(std::isnan(d)) || UNLIKELY(std::fabs(d) >= max_value))
> nit: UNLIKELY(std::isnan(d) || std::fabs(d) >= max_value))
clang at least generates better code with the double UNLIKELY form.  It seems 
all UNLIKELY conditions are combined into the same forward jump, where as the 
combined UNLIKELY form has a forward branch to decide the inner condition which 
gets taken on the likely path:

https://godbolt.org/g/fnGuSP

I'll try out a couple other compilers and see what results I get.  This is a 
most interesting experiment I've never actually done before.

Update: GCC gets the optimal form both ways.


-- 
To view, visit http://gerrit.cloudera.org:8080/5951
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2daf186b4770a022f9cb349d512067a1dd624810
Gerrit-PatchSet: 22
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Zach Amsden <[email protected]>
Gerrit-Reviewer: Dan Hecht <[email protected]>
Gerrit-Reviewer: Marcel Kornacker <[email protected]>
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Michael Ho <[email protected]>
Gerrit-Reviewer: Zach Amsden <[email protected]>
Gerrit-HasComments: Yes

Reply via email to