static void
store(ThreadContext *tc, const Integer &i)
{
- if (std::is_same<Integer, Addr>::value) {
- tc->setIntReg(ArmISA::INTREG_R0, (uint32_t)i);
- } else if (ArmISA::byteOrder(tc) == ByteOrder::little) {
+ if (ArmISA::byteOrder(tc) == ByteOrder::little) {
tc->setIntReg(ArmISA::INTREG_R0, (uint32_t)(i >> 0));
tc->setIntReg(ArmISA::INTREG_R1, (uint32_t)(i >> 32));
} else {
static Integer
get(ThreadContext *tc, Aapcs32::State &state)
{
- if (std::is_same<Integer, Addr>::value &&
- state.ncrn <= state.MAX_CRN) {
- return tc->readIntReg(state.ncrn++);
- }
-
if (alignof(Integer) == 8 && (state.ncrn % 2))
state.ncrn++;
struct Argument<ABI, Arg,
typename std::enable_if_t<
std::is_base_of<ArmISA::RegABI32, ABI>::value &&
+ std::is_integral<Arg>::value &&
ABI::template IsWide<Arg>::value>>
{
static Arg
template <typename Arg>
struct Argument<SparcISA::SEWorkload::SyscallABI32, Arg,
typename std::enable_if_t<
+ std::is_integral<Arg>::value &&
SparcISA::SEWorkload::SyscallABI32::IsWide<Arg>::value>>
{
using ABI = SparcISA::SEWorkload::SyscallABI32;
template <typename Arg>
struct Argument<X86ISA::EmuLinux::SyscallABI32, Arg,
- typename std::enable_if_t<
+ typename std::enable_if_t<std::is_integral<Arg>::value &&
X86ISA::EmuLinux::SyscallABI32::IsWide<Arg>::value>>
{
using ABI = X86ISA::EmuLinux::SyscallABI32;
class SyscallDesc;
-namespace GuestABI
-{
-
-// Does this normally 64 bit data type shrink down to 32 bits for 32 bit ABIs?
-template <typename T, typename Enabled=void>
-struct IsConforming : public std::false_type {};
-
-template <>
-struct IsConforming<Addr> : public std::true_type {};
-
-} // namespace GuestABI
-
struct GenericSyscallABI
{
using State = int;
// Is this argument too big for a single register?
template <typename T, typename Enabled=void>
- struct IsWide;
+ struct IsWide : public std::false_type {};
template <typename T>
- struct IsWide<T, typename std::enable_if_t<
- std::is_integral<T>::value &&
- (sizeof(T) <= sizeof(UintPtr) ||
- GuestABI::IsConforming<T>::value)>>
- {
- static const bool value = false;
- };
-
- template <typename T>
- struct IsWide<T, typename std::enable_if_t<
- std::is_integral<T>::value &&
- (sizeof(T) > sizeof(UintPtr)) &&
- !GuestABI::IsConforming<T>::value>>
- {
- static const bool value = true;
- };
+ struct IsWide<T, std::enable_if_t<(sizeof(T) > sizeof(UintPtr))>> :
+ public std::true_type
+ {};
// Read two registers and merge them into one value.
static uint64_t
// arguments aren't handled generically.
template <typename ABI, typename Arg>
struct Argument<ABI, Arg,
- typename std::enable_if_t<!ABI::template IsWide<Arg>::value>>
+ typename std::enable_if_t<std::is_integral<Arg>::value &&
+ !ABI::template IsWide<Arg>::value>>
{
static Arg
get(ThreadContext *tc, typename ABI::State &state)