Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lamphamsy committed Aug 7, 2018
1 parent 156e3f0 commit 6879e22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/fec_rs_nf4.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class RsNf4 : public FecCode<T> {
std::vector<size_t> packed_symbs;
// pack marked symbols
for (auto const& data : props[frag_id].get_map()) {
off_t loc_offset = data.first.get_offset();
const off_t loc_offset = data.first.get_offset();
if (loc_offset >= offset && loc_offset < offset_max) {
// As loc.offset := offset + j * this->word_size
const size_t j = (loc_offset - offset) / this->word_size;
Expand Down
7 changes: 2 additions & 5 deletions src/simd_nf4.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ inline aint128 expand32(uint32_t* arr, int n)

inline GroupedValues<__uint128_t> unpack(__uint128_t a, int n)
{
uint32_t flag;
uint16_t ai[8];
aint128 values;

Expand All @@ -88,10 +87,8 @@ inline GroupedValues<__uint128_t> unpack(__uint128_t a, int n)
ai[6] = _mm_extract_epi16(_a, 6);
ai[7] = _mm_extract_epi16(_a, 7);

flag = ai[1];
flag += (ai[3] > 0) ? 2 : 0;
flag += (ai[5] > 0) ? 4 : 0;
flag += (ai[7] > 0) ? 8 : 0;
const uint32_t flag =
ai[1] | (!!ai[3] << 1u) | (!!ai[5] << 2u) | (!!ai[7] << 3u);

m128i val = _mm_set_epi64(
_mm_setzero_si64(), _mm_set_pi16(ai[6], ai[4], ai[2], ai[0]));
Expand Down

0 comments on commit 6879e22

Please sign in to comment.