From 35e52b90f5763f65bfb6953d4b4bd0973753ff2a Mon Sep 17 00:00:00 2001 From: "J. Gareth \"Curious Kit\" Moreton" Date: Tue, 22 Aug 2023 13:12:57 +0100 Subject: [PATCH] * Added missing register allocations to SSE/AVX optimisations --- compiler/x86/aoptx86.pas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/x86/aoptx86.pas b/compiler/x86/aoptx86.pas index baefcec7ea..fce78248f0 100644 --- a/compiler/x86/aoptx86.pas +++ b/compiler/x86/aoptx86.pas @@ -2282,6 +2282,10 @@ unit aoptx86; begin DebugMsg(SPeepholeOptimization + '(V)MOVA*(V)MOVA*2(V)MOVA* 1',p); taicpu(p).loadoper(1,taicpu(hp1).oper[1]^); + + TransferUsedRegs(TmpUsedRegs); + AllocRegBetween(taicpu(hp1).oper[1]^.reg, p, hp1, TmpUsedRegs); + RemoveInstruction(hp1); result:=true; exit; @@ -2315,7 +2319,7 @@ unit aoptx86; vmovs* reg2, dealloc reg2 => - vmovs* reg1,reg3 } + vmovs* reg1, } TransferUsedRegs(TmpUsedRegs); UpdateUsedRegsBetween(TmpUsedRegs, p, hp1); if not(RegUsedAfterInstruction(taicpu(p).oper[1]^.reg,hp1,TmpUsedRegs)) then @@ -2323,6 +2327,10 @@ unit aoptx86; DebugMsg(SPeepholeOptimization + '(V)MOVA*(V)MOVS*2(V)MOVS* 1',p); taicpu(p).opcode:=taicpu(hp1).opcode; taicpu(p).loadoper(1,taicpu(hp1).oper[1]^); + + TransferUsedRegs(TmpUsedRegs); + AllocRegBetween(taicpu(p).oper[0]^.reg, p, hp1, TmpUsedRegs); + RemoveInstruction(hp1); result:=true; exit;