From 2f6939a2cecc37691a1e474ff15a7801f9509cfb Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 30 Sep 2020 16:08:00 -0700 Subject: Clean up support/bits.h (#3177) Use overloads instead of templates where applicable and change function names from PascalCase to camelCase. Also puts the functions in the Bits namespace to avoid naming conflicts. --- src/wasm/literal.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/wasm/literal.cpp') diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp index 54453b356..f42727aeb 100644 --- a/src/wasm/literal.cpp +++ b/src/wasm/literal.cpp @@ -472,30 +472,30 @@ std::ostream& operator<<(std::ostream& o, const ExceptionPackage& exn) { Literal Literal::countLeadingZeroes() const { if (type == Type::i32) { - return Literal((int32_t)CountLeadingZeroes(i32)); + return Literal((int32_t)Bits::countLeadingZeroes(i32)); } if (type == Type::i64) { - return Literal((int64_t)CountLeadingZeroes(i64)); + return Literal((int64_t)Bits::countLeadingZeroes(i64)); } WASM_UNREACHABLE("invalid type"); } Literal Literal::countTrailingZeroes() const { if (type == Type::i32) { - return Literal((int32_t)CountTrailingZeroes(i32)); + return Literal((int32_t)Bits::countTrailingZeroes(i32)); } if (type == Type::i64) { - return Literal((int64_t)CountTrailingZeroes(i64)); + return Literal((int64_t)Bits::countTrailingZeroes(i64)); } WASM_UNREACHABLE("invalid type"); } Literal Literal::popCount() const { if (type == Type::i32) { - return Literal((int32_t)PopCount(i32)); + return Literal((int32_t)Bits::popCount(i32)); } if (type == Type::i64) { - return Literal((int64_t)PopCount(i64)); + return Literal((int64_t)Bits::popCount(i64)); } WASM_UNREACHABLE("invalid type"); } @@ -1149,9 +1149,9 @@ Literal Literal::shrU(const Literal& other) const { Literal Literal::rotL(const Literal& other) const { switch (type.getBasic()) { case Type::i32: - return Literal(RotateLeft(uint32_t(i32), uint32_t(other.i32))); + return Literal(Bits::rotateLeft(uint32_t(i32), uint32_t(other.i32))); case Type::i64: - return Literal(RotateLeft(uint64_t(i64), uint64_t(other.i64))); + return Literal(Bits::rotateLeft(uint64_t(i64), uint64_t(other.i64))); default: WASM_UNREACHABLE("unexpected type"); } @@ -1160,9 +1160,9 @@ Literal Literal::rotL(const Literal& other) const { Literal Literal::rotR(const Literal& other) const { switch (type.getBasic()) { case Type::i32: - return Literal(RotateRight(uint32_t(i32), uint32_t(other.i32))); + return Literal(Bits::rotateRight(uint32_t(i32), uint32_t(other.i32))); case Type::i64: - return Literal(RotateRight(uint64_t(i64), uint64_t(other.i64))); + return Literal(Bits::rotateRight(uint64_t(i64), uint64_t(other.i64))); default: WASM_UNREACHABLE("unexpected type"); } -- cgit v1.2.3