[cleanup] Use std::make_unsigned in favor of our own.

R=marja@chromium.org

Change-Id: I3efa9e87f985b3ccb63c89881340a0e3ec7875f0
Reviewed-on: https://chromium-review.googlesource.com/522643
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45685}
This commit is contained in:
Michael Starzinger 2017-06-02 11:37:33 +02:00 committed by Commit Bot
parent f1ab58cb28
commit f9128a8bff
2 changed files with 4 additions and 22 deletions

View File

@ -5,6 +5,7 @@
#include <stdlib.h>
#include <cmath>
#include <cstdarg>
#include <type_traits>
#if V8_TARGET_ARCH_ARM64
@ -1017,7 +1018,7 @@ void Simulator::AddSubWithCarry(Instruction* instr) {
template <typename T>
T Simulator::ShiftOperand(T value, Shift shift_type, unsigned amount) {
typedef typename make_unsigned<T>::type unsignedT;
typedef typename std::make_unsigned<T>::type unsignedT;
if (amount == 0) {
return value;
@ -2518,7 +2519,7 @@ void Simulator::DataProcessing2Source(Instruction* instr) {
}
case UDIV_w:
case UDIV_x: {
typedef typename make_unsigned<T>::type unsignedT;
typedef typename std::make_unsigned<T>::type unsignedT;
unsignedT rn = static_cast<unsignedT>(reg<T>(instr->Rn()));
unsignedT rm = static_cast<unsignedT>(reg<T>(instr->Rm()));
if (rm == 0) {
@ -2623,7 +2624,7 @@ void Simulator::VisitDataProcessing3Source(Instruction* instr) {
template <typename T>
void Simulator::BitfieldHelper(Instruction* instr) {
typedef typename make_unsigned<T>::type unsignedT;
typedef typename std::make_unsigned<T>::type unsignedT;
T reg_size = sizeof(T) * 8;
T R = instr->ImmR();
T S = instr->ImmS();

View File

@ -267,25 +267,6 @@ inline int32_t WhichPowerOf2Abs(int32_t x) {
}
// Obtains the unsigned type corresponding to T
// available in C++11 as std::make_unsigned
template<typename T>
struct make_unsigned {
typedef T type;
};
// Template specializations necessary to have make_unsigned work
template<> struct make_unsigned<int32_t> {
typedef uint32_t type;
};
template<> struct make_unsigned<int64_t> {
typedef uint64_t type;
};
// ----------------------------------------------------------------------------
// BitField is a help template for encoding and decode bitfield with
// unsigned content.