impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Youwei Wang (Code Review)" <>
Subject [Impala-CR](cdh5-trunk) IMPALA-2809: Improve ByteSwap with builtin function or SSSE3 or AVX2.
Date Mon, 11 Jul 2016 07:51:50 GMT
Youwei Wang has posted comments on this change.

Change subject: IMPALA-2809: Improve ByteSwap with builtin function or SSSE3 or AVX2.

Patch Set 30:

File be/src/util/

Line 169:   EXPECT_EQ(BitUtil::ByteSwap(static_cast<uint32_t>(0)), 0);
> This doesn't look done to me. In the AVX case, it looks like only  SSSE3 co
File be/src/util/

Line 99: //   CpuInfo::AVX2 for ByteSwapAVX2_Unit;
> In our codebase, function parameters are explained before the function name

PS29, Line 106: 
BTW, Code: ASSERT_EQ(CpuFlag, CpuInfo::AVX2);
will not compile and generate following error:
/root/Impala/be/src/util/ undefined reference to `impala::CpuInfo::AVX2'.

However, Code:
static const int64_t AVX2_MASK = CpuInfo::AVX2;
will compile flawlessly.

Line 106:   } else {
> ASSERT_EQ, not 'else if', since there is no other choice.
Hi Jim. 
The parameter "CpuFlag" for this function has only two options: CpuInfo::SSSE3 or CpuInfo::AVX2.
However, "CpuFlag" for the function TestByteswapSimd has three options: CpuInfo::SSSE3 or
CpuInfo::AVX2 or 0. It is reasonable to use ASSERT_EQ to verify the value of "CpuFlag" in
the else branch here. But it is not this case for TestByteswapSimd.
As for TestByteswapSimd, if "CpuFlag" is not CpuInfo::SSSE3 or CpuInfo::AVX2, the variable
start_size will keep 0, which means we want a black box test there, as described like this:
// CpuFlag == 0: test the internal logic of BitUtil::ByteSwap
Thank you.
File be/src/util/bit-util.inline.h:

Line 166
> Please don't pollute the impala namespace with a typedef with a name this g

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I392ed5a8d5683f30f161282c228c1aedd7b648c1
Gerrit-PatchSet: 30
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Youwei Wang <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Jim Apple <>
Gerrit-Reviewer: Marcel Kornacker <>
Gerrit-Reviewer: Mostafa Mokhtar <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-Reviewer: Youwei Wang <>
Gerrit-HasComments: Yes

View raw message