impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zach Amsden (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-2020, 4915, 4936: Add rounding for decimal casts
Date Fri, 24 Feb 2017 01:19:22 GMT
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 <zamsden@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <marcel@cloudera.com>
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Michael Ho <kwho@cloudera.com>
Gerrit-Reviewer: Zach Amsden <zamsden@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message