emit_x64_aes: Eliminate extraneous usage of a scratch register in EmitAESInverseMixColumns()

We can just use the same register the data is in as the result register,
eliminating the need to use a completely separate register to store the
result.
This commit is contained in:
Lioncash 2018-07-21 20:26:01 -04:00 committed by MerryMage
parent e5d80e998e
commit 04b4c8b0cf

View file

@ -57,12 +57,11 @@ void EmitX64::EmitAESInverseMixColumns(EmitContext& ctx, IR::Inst* inst) {
auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto args = ctx.reg_alloc.GetArgumentInfo(inst);
if (code.DoesCpuSupport(Xbyak::util::Cpu::tAESNI)) { if (code.DoesCpuSupport(Xbyak::util::Cpu::tAESNI)) {
const Xbyak::Xmm operand = ctx.reg_alloc.UseXmm(args[0]); const Xbyak::Xmm data = ctx.reg_alloc.UseScratchXmm(args[0]);
const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm();
code.aesimc(result, operand); code.aesimc(data, data);
ctx.reg_alloc.DefineValue(inst, result); ctx.reg_alloc.DefineValue(inst, data);
} else { } else {
EmitAESFunction(args, ctx, code, inst, Common::AES::InverseMixColumns); EmitAESFunction(args, ctx, code, inst, Common::AES::InverseMixColumns);
} }