[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:
parent
f1ab58cb28
commit
f9128a8bff
@ -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();
|
||||
|
19
src/utils.h
19
src/utils.h
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user