Pārlūkot izejas kodu

+ add explicit support for LLVM-MC versions 15..18

Nikolay Nikolov 1 gadu atpakaļ
vecāks
revīzija
6ab6d613e0
3 mainītis faili ar 122 papildinājumiem un 2 dzēšanām
  1. 5 1
      compiler/msg/errore.msg
  2. 5 1
      compiler/systems.inc
  3. 112 0
      compiler/wasm32/agllvmmc.pas

+ 5 - 1
compiler/msg/errore.msg

@@ -4036,7 +4036,11 @@ W*2Allvm-mc-10_Assemble using llvm-mc-10
 W*2Allvm-mc-11_Assemble using llvm-mc-11
 W*2Allvm-mc-12_Assemble using llvm-mc-12
 W*2Allvm-mc-13_Assemble using llvm-mc-13
-W*2Allvm-mc_Assemble using llvm-mc (version 14 or later)
+W*2Allvm-mc-14_Assemble using llvm-mc-14
+W*2Allvm-mc-15_Assemble using llvm-mc-15
+W*2Allvm-mc-16_Assemble using llvm-mc-16
+W*2Allvm-mc-17_Assemble using llvm-mc-17
+W*2Allvm-mc_Assemble using llvm-mc (version 18 or later)
 W*2Awabt_Assemble using wasa (experimental)
 x*2Aas_Assemble using GNU AS
 Z*2Asdcc-sdasz80_Assemble using SDCC-SDASZ80

+ 5 - 1
compiler/systems.inc

@@ -280,7 +280,11 @@
              ,as_wasm32_llvm_mc_v11    { WebAssembly code assembled by llvm-mc (llvm machine code playground) from LLVM 11 }
              ,as_wasm32_llvm_mc_v12    { WebAssembly code assembled by llvm-mc (llvm machine code playground) from LLVM 12 }
              ,as_wasm32_llvm_mc_v13    { WebAssembly code assembled by llvm-mc (llvm machine code playground) from LLVM 13 }
-             ,as_wasm32_llvm_mc        { WebAssembly code assembled by llvm-mc (llvm machine code playground) from the latest stable LLVM version (14 or later) }
+             ,as_wasm32_llvm_mc_v14    { WebAssembly code assembled by llvm-mc (llvm machine code playground) from LLVM 14 }
+             ,as_wasm32_llvm_mc_v15    { WebAssembly code assembled by llvm-mc (llvm machine code playground) from LLVM 15 }
+             ,as_wasm32_llvm_mc_v16    { WebAssembly code assembled by llvm-mc (llvm machine code playground) from LLVM 16 }
+             ,as_wasm32_llvm_mc_v17    { WebAssembly code assembled by llvm-mc (llvm machine code playground) from LLVM 17 }
+             ,as_wasm32_llvm_mc        { WebAssembly code assembled by llvm-mc (llvm machine code playground) from the latest stable LLVM version (18 or later) }
              ,as_arm_vasm
              ,as_wasm32_wasm
              ,as_clang_llvm_darwin

+ 112 - 0
compiler/wasm32/agllvmmc.pas

@@ -77,6 +77,30 @@ interface
       constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
     end;
 
+    { TLLVMMachineCodePlaygroundAssemblerV15 }
+
+    TLLVMMachineCodePlaygroundAssemblerV15=class(TLLVMMachineCodePlaygroundAssembler)
+      constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
+    end;
+
+    { TLLVMMachineCodePlaygroundAssemblerV16 }
+
+    TLLVMMachineCodePlaygroundAssemblerV16=class(TLLVMMachineCodePlaygroundAssembler)
+      constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
+    end;
+
+    { TLLVMMachineCodePlaygroundAssemblerV17 }
+
+    TLLVMMachineCodePlaygroundAssemblerV17=class(TLLVMMachineCodePlaygroundAssembler)
+      constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
+    end;
+
+    { TLLVMMachineCodePlaygroundAssemblerV18 }
+
+    TLLVMMachineCodePlaygroundAssemblerV18=class(TLLVMMachineCodePlaygroundAssembler)
+      constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
+    end;
+
     { TWASM32InstrWriter }
 
     TWASM32InstrWriter = class(TCPUInstrWriter)
@@ -137,6 +161,38 @@ implementation
       inherited CreateWithWriter(info, wr, freewriter, smart);
     end;
 
+  { TLLVMMachineCodePlaygroundAssemblerV15 }
+
+  constructor TLLVMMachineCodePlaygroundAssemblerV15.CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
+    begin
+      FLLVMMajorVersion:=15;
+      inherited CreateWithWriter(info, wr, freewriter, smart);
+    end;
+
+  { TLLVMMachineCodePlaygroundAssemblerV16 }
+
+  constructor TLLVMMachineCodePlaygroundAssemblerV16.CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
+    begin
+      FLLVMMajorVersion:=16;
+      inherited CreateWithWriter(info, wr, freewriter, smart);
+    end;
+
+  { TLLVMMachineCodePlaygroundAssemblerV17 }
+
+  constructor TLLVMMachineCodePlaygroundAssemblerV17.CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
+    begin
+      FLLVMMajorVersion:=17;
+      inherited CreateWithWriter(info, wr, freewriter, smart);
+    end;
+
+  { TLLVMMachineCodePlaygroundAssemblerV18 }
+
+  constructor TLLVMMachineCodePlaygroundAssemblerV18.CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
+    begin
+      FLLVMMajorVersion:=18;
+      inherited CreateWithWriter(info, wr, freewriter, smart);
+    end;
+
 
   { TLLVMMachineCodePlaygroundAssembler }
 
@@ -429,6 +485,58 @@ implementation
          dollarsign : '$';
        );
     as_wasm32_llvm_mc_v14_info : tasminfo =
+       (
+         id     : as_wasm32_llvm_mc_v14;
+         idtxt  : 'LLVM-MC-14';
+         asmbin : 'llvm-mc-14';
+         asmcmd : '--assemble --arch=wasm32 -mattr=+sign-ext,+exception-handling,+bulk-memory,+atomics,+reference-types --filetype=obj -o $OBJ $EXTRAOPT $ASM';
+         supported_targets : [system_wasm32_embedded,system_wasm32_wasi];
+         flags : [af_smartlink_sections];
+         labelprefix : '.L';
+         labelmaxlen : -1;
+         comment : '# ';
+         dollarsign : '$';
+       );
+    as_wasm32_llvm_mc_v15_info : tasminfo =
+       (
+         id     : as_wasm32_llvm_mc_v15;
+         idtxt  : 'LLVM-MC-15';
+         asmbin : 'llvm-mc-15';
+         asmcmd : '--assemble --arch=wasm32 -mattr=+sign-ext,+exception-handling,+bulk-memory,+atomics,+reference-types --filetype=obj -o $OBJ $EXTRAOPT $ASM';
+         supported_targets : [system_wasm32_embedded,system_wasm32_wasi];
+         flags : [af_smartlink_sections];
+         labelprefix : '.L';
+         labelmaxlen : -1;
+         comment : '# ';
+         dollarsign : '$';
+       );
+    as_wasm32_llvm_mc_v16_info : tasminfo =
+       (
+         id     : as_wasm32_llvm_mc_v16;
+         idtxt  : 'LLVM-MC-16';
+         asmbin : 'llvm-mc-16';
+         asmcmd : '--assemble --arch=wasm32 -mattr=+sign-ext,+exception-handling,+bulk-memory,+atomics,+reference-types --filetype=obj -o $OBJ $EXTRAOPT $ASM';
+         supported_targets : [system_wasm32_embedded,system_wasm32_wasi];
+         flags : [af_smartlink_sections];
+         labelprefix : '.L';
+         labelmaxlen : -1;
+         comment : '# ';
+         dollarsign : '$';
+       );
+    as_wasm32_llvm_mc_v17_info : tasminfo =
+       (
+         id     : as_wasm32_llvm_mc_v17;
+         idtxt  : 'LLVM-MC-17';
+         asmbin : 'llvm-mc-17';
+         asmcmd : '--assemble --arch=wasm32 -mattr=+sign-ext,+exception-handling,+bulk-memory,+atomics,+reference-types --filetype=obj -o $OBJ $EXTRAOPT $ASM';
+         supported_targets : [system_wasm32_embedded,system_wasm32_wasi];
+         flags : [af_smartlink_sections];
+         labelprefix : '.L';
+         labelmaxlen : -1;
+         comment : '# ';
+         dollarsign : '$';
+       );
+    as_wasm32_llvm_mc_v18_info : tasminfo =
        (
          id     : as_wasm32_llvm_mc;
          idtxt  : 'LLVM-MC';
@@ -448,5 +556,9 @@ initialization
   RegisterAssembler(as_wasm32_llvm_mc_v12_info,TLLVMMachineCodePlaygroundAssemblerV12);
   RegisterAssembler(as_wasm32_llvm_mc_v13_info,TLLVMMachineCodePlaygroundAssemblerV13);
   RegisterAssembler(as_wasm32_llvm_mc_v14_info,TLLVMMachineCodePlaygroundAssemblerV14);
+  RegisterAssembler(as_wasm32_llvm_mc_v15_info,TLLVMMachineCodePlaygroundAssemblerV15);
+  RegisterAssembler(as_wasm32_llvm_mc_v16_info,TLLVMMachineCodePlaygroundAssemblerV16);
+  RegisterAssembler(as_wasm32_llvm_mc_v17_info,TLLVMMachineCodePlaygroundAssemblerV17);
+  RegisterAssembler(as_wasm32_llvm_mc_v18_info,TLLVMMachineCodePlaygroundAssemblerV18);
 end.