From 2f5fe67e56fad1e8a05058fe3099774f5c26d19f Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 28 Sep 2024 21:52:37 +0200 Subject: [PATCH] * FSRM works only with movsb --- compiler/x86/cgx86.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/x86/cgx86.pas b/compiler/x86/cgx86.pas index 68c9b6533c..e2fcffb7c5 100644 --- a/compiler/x86/cgx86.pas +++ b/compiler/x86/cgx86.pas @@ -3165,8 +3165,9 @@ unit cgx86; getcpuregister(list,REGCX); if ts_cld in current_settings.targetswitches then list.concat(Taicpu.op_none(A_CLD,S_NO)); - if (cs_opt_size in current_settings.optimizerswitches) and - (len>sizeof(aint)+(sizeof(aint) div 2)) then + if ((cs_opt_size in current_settings.optimizerswitches) and + (len>sizeof(aint)+(sizeof(aint) div 2))) or + ((len<=128) and (CPUX86_HINT_FAST_SHORT_REP_MOVS in cpu_optimization_hints[current_settings.optimizecputype])) then begin a_load_const_reg(list,OS_INT,len,REGCX); list.concat(Taicpu.op_none(A_REP,S_NO));