From eee2e9f950fd49954fb68db74f47a6d92f4d15b7 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 5 Apr 2020 21:12:12 +0000 Subject: [PATCH 01/11] * commented test git-svn-id: trunk@44610 - --- tests/webtbs/tw14315b.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/webtbs/tw14315b.pp b/tests/webtbs/tw14315b.pp index 97658b5a67..f45665ca7b 100644 --- a/tests/webtbs/tw14315b.pp +++ b/tests/webtbs/tw14315b.pp @@ -1,3 +1,4 @@ +{ this test fails for x86_64-linux with r44578, reason not found yet } program Project1; {$mode objfpc}{$H+} From e8fabb752a5bb2506421e911497b1cc0aaaf9969 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 5 Apr 2020 21:12:12 +0000 Subject: [PATCH 02/11] + basic xtensa-linux support in the compiler git-svn-id: trunk@44611 - --- compiler/systems.inc | 3 +- compiler/systems/i_linux.pas | 76 ++++++++++++++++++++++++++++++++++++ compiler/systems/t_linux.pas | 12 ++++++ compiler/xtensa/cputarg.pas | 10 ++++- 4 files changed, 99 insertions(+), 2 deletions(-) diff --git a/compiler/systems.inc b/compiler/systems.inc index 7d16a927d9..87702b8ed8 100644 --- a/compiler/systems.inc +++ b/compiler/systems.inc @@ -192,7 +192,8 @@ system_x86_64_android, { 101 } system_x86_64_haiku, { 102 } system_xtensa_embedded, { 103 } - system_xtensa_freertos { 104 } + system_xtensa_freertos, { 104 } + system_xtensa_linux { 105 } ); type diff --git a/compiler/systems/i_linux.pas b/compiler/systems/i_linux.pas index 5a510815ec..3ff8669aa0 100644 --- a/compiler/systems/i_linux.pas +++ b/compiler/systems/i_linux.pas @@ -1243,6 +1243,76 @@ unit i_linux; llvmdatalayout : 'E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:64:64-v128:128:128-n32:64'; ); + system_xtensa_linux_info : tsysteminfo = + ( + system : system_xtensa_linux; + name : 'Linux for Xtensa'; + shortname : 'Linux'; + flags : [tf_needs_symbol_size,tf_smartlink_sections, + tf_needs_symbol_type,tf_files_case_sensitive, + tf_requires_proper_alignment,tf_has_winlike_resources, + tf_supports_hidden_symbols]; + cpu : cpu_xtensa; + unit_env : 'LINUXUNITS'; + extradefines : 'UNIX;HASUNIX'; + exeext : ''; + defext : '.def'; + scriptext : '.sh'; + smartext : '.sl'; + unitext : '.ppu'; + unitlibext : '.ppl'; + asmext : '.s'; + objext : '.o'; + resext : '.res'; + resobjext : '.or'; + sharedlibext : '.so'; + staticlibext : '.a'; + staticlibprefix : 'libp'; + sharedlibprefix : 'lib'; + sharedClibext : '.so'; + staticClibext : '.a'; + staticClibprefix : 'lib'; + sharedClibprefix : 'lib'; + importlibprefix : 'libimp'; + importlibext : '.a'; +// p_ext_support : false; + Cprefix : ''; + newline : #10; + dirsep : '/'; + assem : as_gas; + assemextern : as_gas; + link : ld_none; + linkextern : ld_linux; + ar : ar_gnu_ar; + res : res_elf; + dbg : dbg_dwarf2; + script : script_unix; + endian : endian_little; + alignment : + ( + procalign : 4; + loopalign : 4; + jumpalign : 0; + jumpalignskipmax : 0; + coalescealign : 0; + coalescealignskipmax: 0; + constalignmin : 0; + constalignmax : 8; + varalignmin : 0; + varalignmax : 8; + localalignmin : 4; + localalignmax : 16; + recordalignmin : 0; + recordalignmax : 8; + maxCrecordalign : 8 + ); + first_parm_offset : 0; + stacksize : 32*1024*1024; + stackalign : 16; + abi : abi_xtensa_windowed; + llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64'; + ); + implementation initialization @@ -1319,4 +1389,10 @@ initialization set_source_info(system_riscv64_linux_info); {$endif linux} {$endif CPURISCV64} +{$ifdef CPUXTENSA} + {$ifdef linux} + set_source_info(system_xtensa_linux_info); + {$endif linux} +{$endif CPUXTENSA} end. + diff --git a/compiler/systems/t_linux.pas b/compiler/systems/t_linux.pas index bfad4acff4..37e4168276 100644 --- a/compiler/systems/t_linux.pas +++ b/compiler/systems/t_linux.pas @@ -253,10 +253,15 @@ const defdynlinker='/lib/ld-linux-aarch64.so.1'; {$ifdef riscv32} const defdynlinker='/lib32/ld.so.1'; {$endif riscv32} + {$ifdef riscv64} const defdynlinker='/lib/ld-linux-riscv64-lp64d.so.1'; {$endif riscv64} +{$ifdef xtensa} + const defdynlinker='/lib/ld.so.1'; +{$endif xtensa} + procedure SetupDynlinker(out DynamicLinker:string;out libctype:TLibcType); begin @@ -363,6 +368,7 @@ const {$endif} {$ifdef riscv32} platform_select='-m elf32lriscv';{$endif} {$ifdef riscv64} platform_select='-m elf64lriscv';{$endif} +{$ifdef xtensa} platform_select='';{$endif} var platformopt: string; @@ -2029,5 +2035,11 @@ initialization RegisterExport(system_riscv64_linux,texportliblinux); RegisterTarget(system_riscv64_linux_info); {$endif riscv64} +{$ifdef xtensa} + RegisterImport(system_xtensa_linux,timportliblinux); + RegisterExport(system_xtensa_linux,texportliblinux); + RegisterTarget(system_xtensa_linux_info); +{$endif xtensa} RegisterRes(res_elf_info,TWinLikeResourceFile); end. + diff --git a/compiler/xtensa/cputarg.pas b/compiler/xtensa/cputarg.pas index f93754e093..bf8f9890a5 100644 --- a/compiler/xtensa/cputarg.pas +++ b/compiler/xtensa/cputarg.pas @@ -36,7 +36,15 @@ implementation **************************************} {$ifndef NOTARGETEMBEDDED} - ,t_embed,t_freertos + ,t_embed + {$endif} + + {$ifndef NOTARGETFREERTOS} + ,t_freertos + {$endif} + + {$ifndef NOTARGETLINUX} + ,t_linux {$endif} {************************************** From 460369405ecbc3200eeaf38350bf8b2e082fd34f Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 5 Apr 2020 21:12:13 +0000 Subject: [PATCH 03/11] + xtensa-linux: OS specific system unit header files git-svn-id: trunk@44612 - --- .gitattributes | 3 +++ rtl/linux/xtensa/sighndh.inc | 46 +++++++++++++++++++++++++++++++++++ rtl/linux/xtensa/stat.inc | 46 +++++++++++++++++++++++++++++++++++ rtl/linux/xtensa/syscallh.inc | 34 ++++++++++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 rtl/linux/xtensa/sighndh.inc create mode 100644 rtl/linux/xtensa/stat.inc create mode 100644 rtl/linux/xtensa/syscallh.inc diff --git a/.gitattributes b/.gitattributes index 19f7ce48f0..ae2ad05aaf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11180,6 +11180,9 @@ rtl/linux/x86_64/stat.inc svneol=native#text/plain rtl/linux/x86_64/syscall.inc svneol=native#text/plain rtl/linux/x86_64/syscallh.inc svneol=native#text/plain rtl/linux/x86_64/sysnr.inc svneol=native#text/plain +rtl/linux/xtensa/sighndh.inc svneol=native#text/plain +rtl/linux/xtensa/stat.inc svneol=native#text/plain +rtl/linux/xtensa/syscallh.inc svneol=native#text/plain rtl/m68k/cpuh.inc svneol=native#text/plain rtl/m68k/int64p.inc svneol=native#text/plain rtl/m68k/lowmath.inc svneol=native#text/plain diff --git a/rtl/linux/xtensa/sighndh.inc b/rtl/linux/xtensa/sighndh.inc new file mode 100644 index 0000000000..a75569a722 --- /dev/null +++ b/rtl/linux/xtensa/sighndh.inc @@ -0,0 +1,46 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 1999-2000 by Jonas Maebe, + member of the Free Pascal development team. + + TSigContext + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + +{$packrecords C} + +type + PSigContext = ^TSigContext; + TSigContext = record + sc_pc, + sc_ps, + sc_lbeg, + sc_lend, + sc_lcount, + sc_sar, + sc_acclo, + sc_acchi : culong; + sc_a : array[0..15] of culong; + end; + + stack_t = record + ss_sp : pointer; + ss_flags : cint; + ss_size : size_t; + end; + + pucontext = ^tucontext; + tucontext = record + uc_flags : culong; + uc_link : pucontext; + uc_stack : stack_t; + uc_mcontext : TSigContext; + uc_sigmask : tsigset; + end; diff --git a/rtl/linux/xtensa/stat.inc b/rtl/linux/xtensa/stat.inc new file mode 100644 index 0000000000..10e4e06460 --- /dev/null +++ b/rtl/linux/xtensa/stat.inc @@ -0,0 +1,46 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 1999-2000 by Jonas Maebe, (c) 2005 Thomas Schatzl, + members of the Free Pascal development team. + + Contains the definition of the stat type for the Xtensa platform. + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + +{ This structure was adapted from + + include/uapi/asm-generic/stat.h + + in Linux 4.0. Note that the stat record is the same for direct + syscalls as for when linking to libc. +} + +{$PACKRECORDS C} + stat = record + st_dev : culonglong; + st_ino : culonglong; + st_mode : cuint; + st_nlink : cuint; + st_uid : cuint; + st_gid : cuint; + st_rdev : culonglong; + st_size : clonglong; + st_blksize : culong; + __unused2 : culong; + st_blocks : culonglong; + st_atime : cULong; + st_atime_nsec : cULong; + st_mtime : cULong; + st_mtime_nsec : cULong; + st_ctime : cULong; + st_ctime_nsec : cULong; + __unused4a : cULong; + __unused5a : cULong; + end; diff --git a/rtl/linux/xtensa/syscallh.inc b/rtl/linux/xtensa/syscallh.inc new file mode 100644 index 0000000000..8f1359ba94 --- /dev/null +++ b/rtl/linux/xtensa/syscallh.inc @@ -0,0 +1,34 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2002 Marco van de Voort + member of the Free Pascal development team. + + Xtensa syscall headers for Linux + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + +Type + TSysResult = longint; // all platforms, cint=32-bit. + // On platforms with off_t =64-bit, people should + // use int64, and typecast all calls that don't + // return off_t to cint. + +// I don't think this is going to work on several platforms +// 64-bit machines don't have only 64-bit params. + + TSysParam = Longint; + +function Do_SysCall(sysnr:TSysParam):TSysResult; external name 'FPC_SYSCALL0'; +function Do_SysCall(sysnr,param1:TSysParam):TSysResult; external name 'FPC_SYSCALL1'; +function Do_SysCall(sysnr,param1,param2:TSysParam):TSysResult; external name 'FPC_SYSCALL2'; +function Do_SysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; external name 'FPC_SYSCALL3'; +function Do_SysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; external name 'FPC_SYSCALL4'; +function Do_SysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResult; external name 'FPC_SYSCALL5'; +function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):TSysResult; external name 'FPC_SYSCALL6'; From 4836ff29bd6df688f05ed8f1047cb43f54ba7231 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 5 Apr 2020 21:12:14 +0000 Subject: [PATCH 04/11] + more instructions git-svn-id: trunk@44613 - --- compiler/xtensa/xtensaatt.inc | 4 +++- compiler/xtensa/xtensaop.inc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/xtensa/xtensaatt.inc b/compiler/xtensa/xtensaatt.inc index c9375d1af2..58ef29eb49 100644 --- a/compiler/xtensa/xtensaatt.inc +++ b/compiler/xtensa/xtensaatt.inc @@ -1,5 +1,5 @@ ( -'none', +'', 'abs', 'add', 'add.s', @@ -18,6 +18,7 @@ 'callx12', 'entry', 'extui', +'ill', 'l8ui', 'l16si', 'l16ui', @@ -54,6 +55,7 @@ 'ssr', 'sub', 'sub.s', +'syscall', 'xor' ); diff --git a/compiler/xtensa/xtensaop.inc b/compiler/xtensa/xtensaop.inc index a4286eaa03..c1da8025b9 100644 --- a/compiler/xtensa/xtensaop.inc +++ b/compiler/xtensa/xtensaop.inc @@ -18,6 +18,7 @@ A_CALLX8, A_CALLX12, A_ENTRY, A_EXTUI, +A_ILL, A_L8UI, A_L16SI, A_L16UI, @@ -54,6 +55,7 @@ A_SSL, A_SSR, A_SUB, A_SUB_S, +A_SYSCALL, A_XOR ); From 79f74bf8cbc84baf1776c08713b3659103d86541 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 5 Apr 2020 21:12:15 +0000 Subject: [PATCH 05/11] + xtensa-linux added to systems_linux git-svn-id: trunk@44614 - --- compiler/systems.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/systems.pas b/compiler/systems.pas index 27b8fa09da..26dd2e8b2b 100644 --- a/compiler/systems.pas +++ b/compiler/systems.pas @@ -257,7 +257,7 @@ interface systems_linux = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,system_powerpc64_linux, system_arm_linux,system_sparc_linux,system_sparc64_linux,system_m68k_linux, system_x86_6432_linux,system_mipseb_linux,system_mipsel_linux,system_aarch64_linux, - system_riscv32_linux,system_riscv64_linux]; + system_riscv32_linux,system_riscv64_linux,system_xtensa_linux]; systems_dragonfly = [system_x86_64_dragonfly]; systems_freebsd = [system_i386_freebsd, system_x86_64_freebsd]; From 9dd0a1f3b59c01b9901688cb77c93a86e33abc24 Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 6 Apr 2020 06:43:05 +0000 Subject: [PATCH 06/11] Fix ppudump after addition of system_xtensa_linux target git-svn-id: trunk@44617 - --- compiler/utils/ppuutils/ppudump.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/utils/ppuutils/ppudump.pp b/compiler/utils/ppuutils/ppudump.pp index 4edd13f57c..c401880c2d 100644 --- a/compiler/utils/ppuutils/ppudump.pp +++ b/compiler/utils/ppuutils/ppudump.pp @@ -222,7 +222,8 @@ const { 101 } 'Android-x86-64', { 102 } 'Haiku-x86-64', { 103 } 'Embedded-Xtensa', - { 104 } 'FreeRTos-Xtensa' + { 104 } 'FreeRTos-Xtensa', + { 105 } 'Linux-Xtensa' ); const From 6a6ef1c8c1a9c468efa24f5bad043c1836509b5f Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 6 Apr 2020 06:44:20 +0000 Subject: [PATCH 07/11] Update revision.inc after commit #44544 git-svn-id: trunk@44618 - --- utils/fpcm/revision.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/fpcm/revision.inc b/utils/fpcm/revision.inc index 9aa853f909..de2cb271af 100644 --- a/utils/fpcm/revision.inc +++ b/utils/fpcm/revision.inc @@ -1 +1 @@ -'2020-03-29 rev 44400' +'2020-04-03 rev 44544' From 04f3784af5fd1c73d88a00ece5bc26566313fc2e Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 6 Apr 2020 20:44:31 +0000 Subject: [PATCH 08/11] * better setting of expectloc git-svn-id: trunk@44619 - --- compiler/ncnv.pas | 4 ++++ compiler/nmat.pas | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/ncnv.pas b/compiler/ncnv.pas index db34e40bf6..34f33cbc5e 100644 --- a/compiler/ncnv.pas +++ b/compiler/ncnv.pas @@ -3529,7 +3529,11 @@ implementation (left.resultdef.size=resultdef.size) and (left.expectloc in [LOC_REFERENCE,LOC_CREFERENCE,LOC_CREGISTER]) then begin +{$ifdef xtensa} + expectloc:=LOC_REGISTER; +{$else xtensa} expectloc:=left.expectloc; +{$endif xtensa} exit; end; { when converting 64bit int to C-ctyle boolean, first convert to an int32 and then } diff --git a/compiler/nmat.pas b/compiler/nmat.pas index fd452ab4a4..60925f8a8e 100644 --- a/compiler/nmat.pas +++ b/compiler/nmat.pas @@ -1317,12 +1317,12 @@ implementation begin if (expectloc in [LOC_REFERENCE,LOC_CREFERENCE,LOC_CREGISTER]) then expectloc:=LOC_REGISTER; - { before loading it into flags we need to load it into - a register thus 1 register is need PM } -{$ifdef cpuflags} + { xtensa has boolean registers which are treateed as flags but they + are not used for boolean expressions } +{$if defined(cpuflags) and not(defined(xtensa))} if left.expectloc<>LOC_JUMP then expectloc:=LOC_FLAGS; -{$endif def cpuflags} +{$endif defined(cpuflags) and not(defined(xtensa)} end else {$ifdef SUPPORT_MMX} From 2e23e2b0fd526e37e53a5ed07821159fd9a8822f Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 6 Apr 2020 20:44:32 +0000 Subject: [PATCH 09/11] + optimize SUB for small constants using ADDI git-svn-id: trunk@44620 - --- compiler/xtensa/cgcpu.pas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/xtensa/cgcpu.pas b/compiler/xtensa/cgcpu.pas index b44255557c..9a2a40db74 100644 --- a/compiler/xtensa/cgcpu.pas +++ b/compiler/xtensa/cgcpu.pas @@ -470,6 +470,8 @@ implementation a_op_const_reg_reg(list,OP_SHL,size,l1,src,dst) else if (op=OP_ADD) and (a>=-128) and (a<=127) then list.concat(taicpu.op_reg_reg_const(A_ADDI,dst,src,a)) + else if (op=OP_SUB) and (a>=-127) and (a<=128) then + list.concat(taicpu.op_reg_reg_const(A_ADDI,dst,src,-a)) else if (op=OP_SHL) and (a>=1) and (a<=31) then list.concat(taicpu.op_reg_reg_const(A_SLLI,dst,src,a)) else if (op=OP_SHR) and (a>=0) and (a<=15) then From 759803f2689c544947533e29231cd63e42f6bf9e Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 6 Apr 2020 20:44:32 +0000 Subject: [PATCH 10/11] * improve assembler reader git-svn-id: trunk@44621 - --- compiler/xtensa/racpugas.pas | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/xtensa/racpugas.pas b/compiler/xtensa/racpugas.pas index a188c94087..521ab2112e 100644 --- a/compiler/xtensa/racpugas.pas +++ b/compiler/xtensa/racpugas.pas @@ -596,9 +596,10 @@ Unit racpugas; BuildReference(oper); end; - AS_HASH: { Constant expression } + AS_MINUS, + AS_PLUS, + AS_INTNUM: { Constant expression } Begin - Consume(AS_HASH); BuildConstantOperand(oper); end; AS_ID: { A constant expression, or a Variable ref. } @@ -841,14 +842,13 @@ Unit racpugas; actcondition:=C_None; - { first, handle B else BLS is read wrong } - if ((hs[1]='J') and (length(hs)=3)) then + if hs[1]='B' then begin for icond:=low(tasmcond) to high(tasmcond) do begin - if copy(hs,2,3)=uppercond2str[icond] then + if copy(hs,2,length(hs)-1)=uppercond2str[icond] then begin - actopcode:=A_J; + actopcode:=A_Bcc; actasmtoken:=AS_OPCODE; actcondition:=icond; is_asmopcode:=true; @@ -856,7 +856,7 @@ Unit racpugas; end; end; end; - maxlen:=min(length(hs),6); + maxlen:=min(length(hs),7); actopcode:=A_NONE; j2:=maxlen; hs2:=hs; From f99fbafabccaac7dd1cf69debc8c983973c14a1f Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 6 Apr 2020 20:44:33 +0000 Subject: [PATCH 11/11] + initial thlcgxtensa.g_intf_wrapper git-svn-id: trunk@44622 - --- compiler/xtensa/hlcgcpu.pas | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/compiler/xtensa/hlcgcpu.pas b/compiler/xtensa/hlcgcpu.pas index dc3cd4636c..abb628b573 100644 --- a/compiler/xtensa/hlcgcpu.pas +++ b/compiler/xtensa/hlcgcpu.pas @@ -48,6 +48,7 @@ implementation aasmbase,aasmtai, symconst,symsym,defutil, cpubase,aasmcpu,parabase, + procinfo, cgobj,cgcpu; procedure create_hlcodegen_cpu; @@ -59,7 +60,53 @@ implementation procedure thlcgxtensa.g_intf_wrapper(list : TAsmList; procdef : tprocdef; const labelname : string; ioffset : longint); + var + make_global : boolean; + tmpref : treference; + l : TAsmLabel; begin + if not(procdef.proctypeoption in [potype_function,potype_procedure]) then + Internalerror(200006137); + if not assigned(procdef.struct) or + (procdef.procoptions*[po_classmethod, po_staticmethod, + po_methodpointer, po_interrupt, po_iocheck]<>[]) then + Internalerror(200006138); + if procdef.owner.symtabletype<>ObjectSymtable then + Internalerror(200109191); + + make_global:=false; + if (not current_module.is_unit) or + create_smartlink or + (procdef.owner.defowner.owner.symtabletype=globalsymtable) then + make_global:=true; + + if make_global then + list.concat(Tai_symbol.Createname_global(labelname,AT_FUNCTION,0,procdef)) + else + list.concat(Tai_symbol.Createname_hidden(labelname,AT_FUNCTION,0,procdef)); + + { the wrapper might need aktlocaldata for the additional data to + load the constant } + current_procinfo:=cprocinfo.create(nil); + + { set param1 interface to self } + g_adjust_self_value(list,procdef,ioffset); + + { case 4 } + if (po_virtualmethod in procdef.procoptions) and + not is_objectpascal_helper(procdef.struct) then + begin +// loadvmttor12; +// op_onr12methodaddr; + end + else + list.concat(taicpu.op_sym(A_CALL0,current_asmdata.RefAsmSymbol(procdef.mangledname,AT_FUNCTION))); + list.concatlist(current_procinfo.aktlocaldata); + + current_procinfo.Free; + current_procinfo:=nil; + + list.concat(Tai_symbol_end.Createname(labelname)); end;