1
0
Fork 0
forked from suyu/suyu

Merge pull request #4125 from lioncash/macro-shift

macro_jit_x64: Amend readability of Compile_ExtractShiftLeftRegister()
This commit is contained in:
merry 2020-06-20 16:08:23 +01:00 committed by GitHub
commit 928e9c09aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -239,10 +239,10 @@ void MacroJITx64Impl::Compile_ExtractInsert(Macro::Opcode opcode) {
} }
void MacroJITx64Impl::Compile_ExtractShiftLeftImmediate(Macro::Opcode opcode) { void MacroJITx64Impl::Compile_ExtractShiftLeftImmediate(Macro::Opcode opcode) {
auto dst = Compile_GetRegister(opcode.src_a, eax); const auto dst = Compile_GetRegister(opcode.src_a, eax);
auto src = Compile_GetRegister(opcode.src_b, RESULT); const auto src = Compile_GetRegister(opcode.src_b, RESULT);
shr(src, al); shr(src, dst.cvt8());
if (opcode.bf_size != 0 && opcode.bf_size != 31) { if (opcode.bf_size != 0 && opcode.bf_size != 31) {
and_(src, opcode.GetBitfieldMask()); and_(src, opcode.GetBitfieldMask());
} else if (opcode.bf_size == 0) { } else if (opcode.bf_size == 0) {
@ -258,8 +258,8 @@ void MacroJITx64Impl::Compile_ExtractShiftLeftImmediate(Macro::Opcode opcode) {
} }
void MacroJITx64Impl::Compile_ExtractShiftLeftRegister(Macro::Opcode opcode) { void MacroJITx64Impl::Compile_ExtractShiftLeftRegister(Macro::Opcode opcode) {
auto dst = Compile_GetRegister(opcode.src_a, eax); const auto dst = Compile_GetRegister(opcode.src_a, eax);
auto src = Compile_GetRegister(opcode.src_b, RESULT); const auto src = Compile_GetRegister(opcode.src_b, RESULT);
if (opcode.bf_src_bit != 0) { if (opcode.bf_src_bit != 0) {
shr(src, opcode.bf_src_bit); shr(src, opcode.bf_src_bit);
@ -268,7 +268,8 @@ void MacroJITx64Impl::Compile_ExtractShiftLeftRegister(Macro::Opcode opcode) {
if (opcode.bf_size != 31) { if (opcode.bf_size != 31) {
and_(src, opcode.GetBitfieldMask()); and_(src, opcode.GetBitfieldMask());
} }
shl(src, al); shl(src, dst.cvt8());
Compile_ProcessResult(opcode.result_operation, opcode.dst); Compile_ProcessResult(opcode.result_operation, opcode.dst);
} }