of course if the reg is marked constant, actually read its value at compile time, not emit code to read it at run time, idiot
This commit is contained in:
@@ -78,41 +78,81 @@ s8 Registers::Read<s8>(size_t idx) {
|
|||||||
#ifndef __aarch64__
|
#ifndef __aarch64__
|
||||||
template <>
|
template <>
|
||||||
void Registers::Read<u64>(size_t idx, Xbyak::Reg reg) {
|
void Registers::Read<u64>(size_t idx, Xbyak::Reg reg) {
|
||||||
|
if(IsRegConstant(idx)) {
|
||||||
|
jit->code.mov(reg.cvt64(), Read<u64>(idx));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jit->code.mov(reg.cvt64(), jit->GPR<u64>(idx));
|
jit->code.mov(reg.cvt64(), jit->GPR<u64>(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void Registers::Read<s64>(size_t idx, Xbyak::Reg reg) {
|
void Registers::Read<s64>(size_t idx, Xbyak::Reg reg) {
|
||||||
|
if(IsRegConstant(idx)) {
|
||||||
|
jit->code.mov(reg.cvt64(), Read<s64>(idx));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jit->code.mov(reg.cvt64(), jit->GPR<u64>(idx));
|
jit->code.mov(reg.cvt64(), jit->GPR<u64>(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void Registers::Read<u32>(size_t idx, Xbyak::Reg reg) {
|
void Registers::Read<u32>(size_t idx, Xbyak::Reg reg) {
|
||||||
|
if(IsRegConstant(idx)) {
|
||||||
|
jit->code.mov(reg.cvt32(), Read<u32>(idx));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jit->code.mov(reg.cvt32(), jit->GPR<u32>(idx));
|
jit->code.mov(reg.cvt32(), jit->GPR<u32>(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void Registers::Read<s32>(size_t idx, Xbyak::Reg reg) {
|
void Registers::Read<s32>(size_t idx, Xbyak::Reg reg) {
|
||||||
|
if(IsRegConstant(idx)) {
|
||||||
|
jit->code.mov(reg.cvt32(), Read<s32>(idx));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jit->code.mov(reg.cvt32(), jit->GPR<s32>(idx));
|
jit->code.mov(reg.cvt32(), jit->GPR<s32>(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void Registers::Read<u16>(size_t idx, Xbyak::Reg reg) {
|
void Registers::Read<u16>(size_t idx, Xbyak::Reg reg) {
|
||||||
|
if(IsRegConstant(idx)) {
|
||||||
|
jit->code.mov(reg.cvt16(), Read<u16>(idx));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jit->code.mov(reg.cvt16(), jit->GPR<u16>(idx));
|
jit->code.mov(reg.cvt16(), jit->GPR<u16>(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void Registers::Read<s16>(size_t idx, Xbyak::Reg reg) {
|
void Registers::Read<s16>(size_t idx, Xbyak::Reg reg) {
|
||||||
|
if(IsRegConstant(idx)) {
|
||||||
|
jit->code.mov(reg.cvt16(), Read<s16>(idx));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jit->code.mov(reg.cvt16(), jit->GPR<u16>(idx));
|
jit->code.mov(reg.cvt16(), jit->GPR<u16>(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void Registers::Read<u8>(size_t idx, Xbyak::Reg reg) {
|
void Registers::Read<u8>(size_t idx, Xbyak::Reg reg) {
|
||||||
|
if(IsRegConstant(idx)) {
|
||||||
|
jit->code.mov(reg.cvt8(), Read<u8>(idx));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jit->code.mov(reg.cvt8(), jit->GPR<u8>(idx));
|
jit->code.mov(reg.cvt8(), jit->GPR<u8>(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void Registers::Read<s8>(size_t idx, Xbyak::Reg reg) {
|
void Registers::Read<s8>(size_t idx, Xbyak::Reg reg) {
|
||||||
|
if(IsRegConstant(idx)) {
|
||||||
|
jit->code.mov(reg.cvt8(), Read<s8>(idx));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jit->code.mov(reg.cvt8(), jit->GPR<s8>(idx));
|
jit->code.mov(reg.cvt8(), jit->GPR<s8>(idx));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user