Skip to content

Commit

Permalink
Delete unnecessary 128 bit cast Emscripten work around.
Browse files Browse the repository at this point in the history
  • Loading branch information
philass committed Aug 14, 2021
1 parent c6a5ffa commit 1db4aea
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions rts/c/scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -823,20 +823,6 @@ static uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {
return aa * bb >> 32;
}

#ifdef __EMSCRIPTEN__
static uint64_t futrts_mul_hi64(uint64_t x, uint64_t y) {
uint64_t a = x >> 32, b = x & 0xffffffff;
uint64_t c = y >> 32, d = y & 0xffffffff;
uint64_t ac = a * c;
uint64_t bc = b * c;
uint64_t ad = a * d;
uint64_t bd = b * d;
uint64_t mid34 = (bd >> 32) + (bc & 0xffffffff) + (ad & 0xffffffff);
uint64_t upper64 = ac + (bc >> 32) + (ad >> 32) + (mid34 >> 32);

return upper64;
}
#else // Not Emscripten
static uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {
__uint128_t aa = a;
__uint128_t bb = b;
Expand All @@ -845,8 +831,6 @@ static uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {
}
#endif

#endif

#if defined(__OPENCL_VERSION__)
static uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {
return mad_hi(a, b, c);
Expand Down

0 comments on commit 1db4aea

Please sign in to comment.