Update to v106r72 release.

byuu says:

For this WIP, I added more TLCS900H instructions. All of the
ADC,ADD,SBB/SBC,SUB,AND,OR,XOR.CP,PUSH,POP instructions are in.

Still an incredible amount of work left to do on this core ... it has all kinds
of novel instructions that aren't on any other processors.

Still no disassembler support yet, so I can't even test what I'm doing. Fun!
This commit is contained in:
Tim Allen
2019-01-05 18:04:27 +11:00
parent 1a889ae232
commit cb86cd116c
10 changed files with 548 additions and 204 deletions

View File

@@ -36,6 +36,8 @@ template<uint Bits> struct Natural {
enum : type { Mask = ~0ull >> (64 - Bits) };
static inline constexpr auto bits() -> uint { return Bits; }
inline Natural() : data(0) {}
template<typename T> inline Natural(const T& value) { set(value); }
@@ -101,6 +103,10 @@ template<uint Bits> struct Natural {
const type Hi;
};
inline auto zero() const -> bool { return data == 0; }
inline auto positive() const -> bool { return (data >> bits() - 1) == 0; }
inline auto negative() const -> bool { return (data >> bits() - 1) == 1; }
inline auto bits(uint lo, uint hi) -> Reference { return {*this, lo < hi ? lo : hi, hi > lo ? hi : lo}; }
inline auto bit(uint index) -> Reference { return {*this, index, index}; }
inline auto byte(uint index) -> Reference { return {*this, index * 8 + 0, index * 8 + 7}; }
@@ -140,6 +146,8 @@ template<uint Bits> struct Integer {
enum : utype { Mask = ~0ull >> (64 - Bits), Sign = 1ull << (Bits - 1) };
static inline constexpr auto bits() -> uint { return Bits; }
inline Integer() : data(0) {}
template<typename T> inline Integer(const T& value) { set(value); }
@@ -205,6 +213,10 @@ template<uint Bits> struct Integer {
const uint Hi;
};
inline auto zero() const -> bool { return data == 0; }
inline auto positive() const -> bool { return data >= 0; }
inline auto negative() const -> bool { return data < 0; }
inline auto bits(uint lo, uint hi) -> Reference { return {*this, lo < hi ? lo : hi, hi > lo ? hi : lo}; }
inline auto bit(uint index) -> Reference { return {*this, index, index}; }
inline auto byte(uint index) -> Reference { return {*this, index * 8 + 0, index * 8 + 7}; }
@@ -239,6 +251,8 @@ template<uint Bits> struct Real {
typename conditional<Bits == 64, float64_t,
void>::type>::type;
static inline constexpr auto bits() -> uint { return Bits; }
inline Real() : data(0.0) {}
template<typename T> inline Real(const T& value) : data((type)value) {}