+ introduced thlcgobj.a_jmp_always_pascal_goto - same as .a_jmp_always, but generated by a pascal goto statement

This commit is contained in:
Nikolay Nikolov 2023-10-22 04:12:59 +03:00
parent 064172d65a
commit 5486182f56
3 changed files with 15 additions and 3 deletions

View File

@ -393,6 +393,7 @@ unit hlcgobj;
procedure a_cmp_ref_loc_label(list: TAsmList; size: tdef;cmp_op: topcmp; const ref: treference; const loc: tlocation; l : tasmlabel);virtual;
procedure a_jmp_always(list : TAsmList;l: tasmlabel); virtual;abstract;
procedure a_jmp_always_pascal_goto(list : TAsmList;l: tasmlabel);virtual;
{$ifdef cpuflags}
procedure a_jmp_flags(list : TAsmList;const f : TResFlags;l: tasmlabel); virtual; abstract;
@ -3361,6 +3362,12 @@ implementation
end;
procedure thlcgobj.a_jmp_always_pascal_goto(list : TAsmList;l: tasmlabel);
begin
a_jmp_always(list,l);
end;
procedure thlcgobj.g_exception_reason_save(list: TAsmList; fromsize, tosize: tdef; reg: tregister; const href: treference);
begin
a_load_reg_ref(list,fromsize,tosize,reg,href);

View File

@ -473,7 +473,7 @@ implementation
location_reset(location,LOC_VOID,OS_NO);
include(flowcontrol,fc_gotolabel);
hlcg.a_jmp_always(current_asmdata.CurrAsmList,tcglabelnode(labelnode).getasmlabel);
hlcg.a_jmp_always_pascal_goto(current_asmdata.CurrAsmList,tcglabelnode(labelnode).getasmlabel);
if not(cs_opt_size in current_settings.optimizerswitches) then
current_asmdata.CurrAsmList.concat(cai_align.create_max(current_settings.alignment.jumpalign,current_settings.alignment.jumpalignskipmax));
end;

View File

@ -103,6 +103,7 @@ uses
procedure a_cmp_reg_reg_label(list: TAsmList; size: tdef; cmp_op: topcmp; reg1, reg2: tregister; l: tasmlabel); override;
procedure a_jmp_always(list : TAsmList;l: tasmlabel); override;
procedure a_jmp_always_pascal_goto(list : TAsmList;l: tasmlabel); override;
procedure a_loadfpu_ref_ref(list: TAsmList; fromsize, tosize: tdef; const ref1, ref2: treference); override;
procedure a_loadfpu_ref_reg(list: TAsmList; fromsize, tosize: tdef; const ref: treference; reg: tregister); override;
@ -1921,8 +1922,7 @@ implementation
begin
if (l=current_procinfo.CurrBreakLabel) or
(l=current_procinfo.CurrContinueLabel) or
(l=current_procinfo.CurrExitLabel) or
tcpuprocinfo(current_procinfo).is_goto_target(l) then
(l=current_procinfo.CurrExitLabel) then
list.concat(taicpu.op_sym(a_br,l))
else
begin
@ -1933,6 +1933,11 @@ implementation
end;
end;
procedure thlcgwasm.a_jmp_always_pascal_goto(list: TAsmList; l: tasmlabel);
begin
list.concat(taicpu.op_sym(a_br,l));
end;
procedure thlcgwasm.a_loadfpu_ref_ref(list: TAsmList; fromsize, tosize: tdef; const ref1, ref2: treference);
var
dstack_slots: longint;