Commit f9128a8b authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

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

R=marja@chromium.org

Change-Id: I3efa9e87f985b3ccb63c89881340a0e3ec7875f0
Reviewed-on: https://chromium-review.googlesource.com/522643Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45685}
parent f1ab58cb
......@@ -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();
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment