| 20 | } |
| 21 | |
| 22 | CPU::CPU(KMemory* memory) : memory(memory) { |
| 23 | this->reg8[0] = &this->reg[0].u8; |
| 24 | this->reg8[1] = &this->reg[1].u8; |
| 25 | this->reg8[2] = &this->reg[2].u8; |
| 26 | this->reg8[3] = &this->reg[3].u8; |
| 27 | this->reg8[4] = &this->reg[0].h8; |
| 28 | this->reg8[5] = &this->reg[1].h8; |
| 29 | this->reg8[6] = &this->reg[2].h8; |
| 30 | this->reg8[7] = &this->reg[3].h8; |
| 31 | this->reg8[8] = &this->reg[8].u8; |
| 32 | |
| 33 | this->reset(); |
| 34 | this->fpu.reset(); |
| 35 | |
| 36 | opCache = (DecodedOp***)&getMemData(memory)->opCache.pageData[0]; |
| 37 | #ifdef BOXEDWINE_JIT_ARMV8 |
| 38 | sseConstants[SSE_MAX_INT32_PLUS_ONE_AS_DOUBLE].pd.f64[0] = 2147483648.0; |
| 39 | sseConstants[SSE_MAX_INT32_PLUS_ONE_AS_DOUBLE].pd.f64[1] = 2147483648.0; |
| 40 | sseConstants[SSE_MIN_INT32_MINUS_ONE_AS_DOUBLE].pd.f64[0] = -2147483649.0; |
| 41 | sseConstants[SSE_MIN_INT32_MINUS_ONE_AS_DOUBLE].pd.f64[1] = -2147483649.0; |
| 42 | |
| 43 | sseConstants[SSE_MAX_INT32_PLUS_ONE_AS_FLOAT].ps.f32[0] = 2147483648.0; |
| 44 | sseConstants[SSE_MAX_INT32_PLUS_ONE_AS_FLOAT].ps.f32[1] = 2147483648.0; |
| 45 | sseConstants[SSE_MAX_INT32_PLUS_ONE_AS_FLOAT].ps.f32[2] = 2147483648.0; |
| 46 | sseConstants[SSE_MAX_INT32_PLUS_ONE_AS_FLOAT].ps.f32[3] = 2147483648.0; |
| 47 | sseConstants[SSE_MIN_INT32_MINUS_ONE_AS_FLOAT].ps.f32[0] = -2147483649.0f; |
| 48 | sseConstants[SSE_MIN_INT32_MINUS_ONE_AS_FLOAT].ps.f32[1] = -2147483649.0f; |
| 49 | sseConstants[SSE_MIN_INT32_MINUS_ONE_AS_FLOAT].ps.f32[2] = -2147483649.0f; |
| 50 | sseConstants[SSE_MIN_INT32_MINUS_ONE_AS_FLOAT].ps.f32[3] = -2147483649.0f; |
| 51 | |
| 52 | sseConstants[SSE_INT32_BIT_MASK].ps.u32[0] = 1; |
| 53 | sseConstants[SSE_INT32_BIT_MASK].ps.u32[1] = 2; |
| 54 | sseConstants[SSE_INT32_BIT_MASK].ps.u32[2] = 4; |
| 55 | sseConstants[SSE_INT32_BIT_MASK].ps.u32[3] = 8; |
| 56 | #undef u8 |
| 57 | sseConstants[SSE_BYTE8_BIT_MASK].pi.u8[0] = 1; |
| 58 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[1] = 2; |
| 59 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[2] = 4; |
| 60 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[3] = 8; |
| 61 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[4] = 16; |
| 62 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[5] = 32; |
| 63 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[6] = 64; |
| 64 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[7] = 128; |
| 65 | sseConstants[SSE_BYTE8_BIT_MASK].pi.u8[8] = 1; |
| 66 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[9] = 2; |
| 67 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[10] = 4; |
| 68 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[11] = 8; |
| 69 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[12] = 16; |
| 70 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[13] = 32; |
| 71 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[14] = 64; |
| 72 | sseConstants[SSE_BYTE8_BIT_MASK].ps.u8[15] = 128; |
| 73 | #define u8 byte[0] |
| 74 | #endif |
| 75 | } |
| 76 | |
| 77 | void CPU::setSeg(U32 index, U32 address, U32 value) { |
| 78 | this->seg[index].address = address; |
nothing calls this directly
no test coverage detected