| 1 |
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 2 |
* vim: set ts=8 sts=2 et sw=2 tw=80: |
| 3 |
* This Source Code Form is subject to the terms of the Mozilla Public |
| 4 |
* License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 |
|
| 7 |
#ifndef jit_none_Architecture_none_h |
| 8 |
#define jit_none_Architecture_none_h |
| 9 |
|
| 10 |
// JitSpewer.h is included through MacroAssembler implementations for other |
| 11 |
// platforms, so include it here to avoid inadvertent build bustage. |
| 12 |
#include "jit/JitSpewer.h" |
| 13 |
|
| 14 |
#include "jit/shared/Architecture-shared.h" |
| 15 |
|
| 16 |
namespace js { |
| 17 |
namespace jit { |
| 18 |
|
| 19 |
static const uint32_t SimdMemoryAlignment = |
| 20 |
4; // Make it 4 to avoid a bunch of div-by-zero warnings |
| 21 |
static const uint32_t WasmStackAlignment = 8; |
| 22 |
static const uint32_t WasmTrapInstructionLength = 0; |
| 23 |
|
| 24 |
// See comments in wasm::GenerateFunctionPrologue. |
| 25 |
static constexpr uint32_t WasmCheckedCallEntryOffset = 0u; |
| 26 |
|
| 27 |
class Registers { |
| 28 |
public: |
| 29 |
enum RegisterID { |
| 30 |
r0 = 0, |
| 31 |
invalid_reg, |
| 32 |
invalid_reg2, // To avoid silly static_assert failures. |
| 33 |
}; |
| 34 |
using Code = uint8_t; |
| 35 |
using Encoding = RegisterID; |
| 36 |
union RegisterContent { |
| 37 |
uintptr_t r; |
| 38 |
}; |
| 39 |
|
| 40 |
using SetType = uint8_t; |
| 41 |
|
| 42 |
static uint32_t SetSize(SetType) { MOZ_CRASH(); } |
| 43 |
static uint32_t FirstBit(SetType) { MOZ_CRASH(); } |
| 44 |
static uint32_t LastBit(SetType) { MOZ_CRASH(); } |
| 45 |
static const char* GetName(Code) { MOZ_CRASH(); } |
| 46 |
static Code FromName(const char*) { MOZ_CRASH(); } |
| 47 |
|
| 48 |
static const Encoding StackPointer = invalid_reg; |
| 49 |
static const Encoding Invalid = invalid_reg; |
| 50 |
static const uint32_t Total = 1; |
| 51 |
static const uint32_t TotalPhys = 0; |
| 52 |
static const uint32_t Allocatable = 0; |
| 53 |
static const SetType AllMask = 0; |
| 54 |
static const SetType ArgRegMask = 0; |
| 55 |
static const SetType VolatileMask = 0; |
| 56 |
static const SetType NonVolatileMask = 0; |
| 57 |
static const SetType NonAllocatableMask = 0; |
| 58 |
static const SetType AllocatableMask = 0; |
| 59 |
static const SetType JSCallMask = 0; |
| 60 |
static const SetType CallMask = 0; |
| 61 |
}; |
| 62 |
|
| 63 |
using PackedRegisterMask = uint8_t; |
| 64 |
|
| 65 |
class FloatRegisters { |
| 66 |
public: |
| 67 |
enum FPRegisterID { f0 = 0, invalid_reg }; |
| 68 |
using Code = FPRegisterID; |
| 69 |
using Encoding = FPRegisterID; |
| 70 |
union RegisterContent { |
| 71 |
float s; |
| 72 |
double d; |
| 73 |
}; |
| 74 |
|
| 75 |
using SetType = uint32_t; |
| 76 |
|
| 77 |
static const char* GetName(Code) { MOZ_CRASH(); } |
| 78 |
static Code FromName(const char*) { MOZ_CRASH(); } |
| 79 |
|
| 80 |
static const Code Invalid = invalid_reg; |
| 81 |
static const uint32_t Total = 0; |
| 82 |
static const uint32_t TotalPhys = 0; |
| 83 |
static const uint32_t Allocatable = 0; |
| 84 |
static const SetType AllMask = 0; |
| 85 |
static const SetType AllDoubleMask = 0; |
| 86 |
static const SetType AllSingleMask = 0; |
| 87 |
static const SetType VolatileMask = 0; |
| 88 |
static const SetType NonVolatileMask = 0; |
| 89 |
static const SetType NonAllocatableMask = 0; |
| 90 |
static const SetType AllocatableMask = 0; |
| 91 |
}; |
| 92 |
|
| 93 |
template <typename T> |
| 94 |
class TypedRegisterSet; |
| 95 |
|
| 96 |
struct FloatRegister { |
| 97 |
using Codes = FloatRegisters; |
| 98 |
using Code = Codes::Code; |
| 99 |
using Encoding = Codes::Encoding; |
| 100 |
using SetType = Codes::SetType; |
| 101 |
|
| 102 |
Code _; |
| 103 |
|
| 104 |
static uint32_t FirstBit(SetType) { MOZ_CRASH(); } |
| 105 |
static uint32_t LastBit(SetType) { MOZ_CRASH(); } |
| 106 |
static FloatRegister FromCode(uint32_t) { MOZ_CRASH(); } |
| 107 |
bool isSingle() const { MOZ_CRASH(); } |
| 108 |
bool isDouble() const { MOZ_CRASH(); } |
| 109 |
bool isSimd128() const { MOZ_CRASH(); } |
| 110 |
bool isInvalid() const { MOZ_CRASH(); } |
| 111 |
FloatRegister asSingle() const { MOZ_CRASH(); } |
| 112 |
FloatRegister asDouble() const { MOZ_CRASH(); } |
| 113 |
FloatRegister asSimd128() const { MOZ_CRASH(); } |
| 114 |
Code code() const { MOZ_CRASH(); } |
| 115 |
Encoding encoding() const { MOZ_CRASH(); } |
| 116 |
const char* name() const { MOZ_CRASH(); } |
| 117 |
bool volatile_() const { MOZ_CRASH(); } |
| 118 |
bool operator!=(FloatRegister) const { MOZ_CRASH(); } |
| 119 |
bool operator==(FloatRegister) const { MOZ_CRASH(); } |
| 120 |
bool aliases(FloatRegister) const { MOZ_CRASH(); } |
| 121 |
uint32_t numAliased() const { MOZ_CRASH(); } |
| 122 |
FloatRegister aliased(uint32_t) { MOZ_CRASH(); } |
| 123 |
bool equiv(FloatRegister) const { MOZ_CRASH(); } |
| 124 |
uint32_t size() const { MOZ_CRASH(); } |
| 125 |
uint32_t numAlignedAliased() const { MOZ_CRASH(); } |
| 126 |
FloatRegister alignedAliased(uint32_t) { MOZ_CRASH(); } |
| 127 |
SetType alignedOrDominatedAliasedSet() const { MOZ_CRASH(); } |
| 128 |
|
| 129 |
static constexpr RegTypeName DefaultType = RegTypeName::Float64; |
| 130 |
|
| 131 |
template <RegTypeName = DefaultType> |
| 132 |
static SetType LiveAsIndexableSet(SetType s) { |
| 133 |
return SetType(0); |
| 134 |
} |
| 135 |
|
| 136 |
template <RegTypeName Name = DefaultType> |
| 137 |
static SetType AllocatableAsIndexableSet(SetType s) { |
| 138 |
static_assert(Name != RegTypeName::Any, "Allocatable set are not iterable"); |
| 139 |
return SetType(0); |
| 140 |
} |
| 141 |
|
| 142 |
template <typename T> |
| 143 |
static T ReduceSetForPush(T) { |
| 144 |
MOZ_CRASH(); |
| 145 |
} |
| 146 |
uint32_t getRegisterDumpOffsetInBytes() { MOZ_CRASH(); } |
| 147 |
static uint32_t SetSize(SetType x) { MOZ_CRASH(); } |
| 148 |
static Code FromName(const char* name) { MOZ_CRASH(); } |
| 149 |
|
| 150 |
// This is used in static initializers, so produce a bogus value instead of |
| 151 |
// crashing. |
| 152 |
static uint32_t GetPushSizeInBytes(const TypedRegisterSet<FloatRegister>&) { |
| 153 |
return 0; |
| 154 |
} |
| 155 |
}; |
| 156 |
|
| 157 |
inline bool hasUnaliasedDouble() { MOZ_CRASH(); } |
| 158 |
inline bool hasMultiAlias() { MOZ_CRASH(); } |
| 159 |
|
| 160 |
static constexpr uint32_t ShadowStackSpace = 0; |
| 161 |
static const uint32_t JumpImmediateRange = INT32_MAX; |
| 162 |
|
| 163 |
#ifdef JS_NUNBOX32 |
| 164 |
static const int32_t NUNBOX32_TYPE_OFFSET = 4; |
| 165 |
static const int32_t NUNBOX32_PAYLOAD_OFFSET = 0; |
| 166 |
#endif |
| 167 |
|
| 168 |
} // namespace jit |
| 169 |
} // namespace js |
| 170 |
|
| 171 |
#endif /* jit_none_Architecture_none_h */ |