getting floating point stuff now

This commit is contained in:
2026-05-18 12:06:03 +02:00
parent b13161f9c2
commit aeb5094b05
8 changed files with 77 additions and 36 deletions
+19
View File
@@ -30,12 +30,20 @@ struct broadway {
ircolib::u32 raw;
} xer;
void set_cr(ircolib::u8 value, ircolib::u8 index) {
cr &= ~(0xffff << index * 4);
cr |= (value << index * 4);
}
bool get_cr_bit(ircolib::u8 index, ircolib::u8 bit) { return (cr >> index * 4) & (1 << (4 - bit)); }
// bat registers indexes
static constexpr std::size_t BAT_LOWER_OFFSET = 0;
static constexpr std::size_t BAT_UPPER_OFFSET = 8;
std::array<ircolib::u32, 16> ibat, dbat;
std::array<ircolib::u32, 32> gpr{};
std::array<double, 32> fpr{};
// ircolib::u32 const_gpr_lookup{};
csh capstone;
// Xbyak::CodeGenerator code;
@@ -60,10 +68,21 @@ struct broadway {
void stwu(ircolib::u32, mem &);
void sth(ircolib::u32, mem &);
void lwz(ircolib::u32, mem &);
void lfd(ircolib::u32, mem &);
void bclrx(ircolib::u32);
void cmpi(ircolib::u32);
void rlwinm(ircolib::u32);
void lwzu(ircolib::u32, mem &);
void rfi(ircolib::u32);
inline void cr0_update(bool condition, ircolib::s32 result) {
if (condition) {
const bool b0 = result < 0;
const bool b1 = result >= 0;
const bool b2 = result == 0;
const bool b3 = xer.so;
set_cr((b0 << 3) | (b1 << 2) | (b2 << 1) | (b3 << 0), 0);
}
}
};
} // namespace weee::core