Jelajahi Sumber

* synchronized with trunk

git-svn-id: branches/wasm@47448 -
nickysn 4 tahun lalu
induk
melakukan
509821260e
100 mengubah file dengan 2256 tambahan dan 1683 penghapusan
  1. 25 0
      .gitattributes
  2. 1 1
      compiler/aarch64/aoptcpu.pas
  3. 1 1
      compiler/arm/aoptcpu.pas
  4. 2 0
      compiler/armgen/aoptarm.pas
  5. 0 4
      compiler/fpcdefs.inc
  6. 4 0
      compiler/generic/cpuinfo.pas
  7. 26 18
      compiler/globals.pas
  8. 2 0
      compiler/i386/aoptcpu.pas
  9. 1 1
      compiler/i386/i386att.inc
  10. 11 11
      compiler/i386/i386atts.inc
  11. 1 1
      compiler/i386/i386nop.inc
  12. 231 77
      compiler/i386/i386tab.inc
  13. 1 1
      compiler/i8086/i8086att.inc
  14. 11 11
      compiler/i8086/i8086atts.inc
  15. 1 1
      compiler/i8086/i8086nop.inc
  16. 231 77
      compiler/i8086/i8086tab.inc
  17. 13 5
      compiler/m68k/ra68kmot.pas
  18. 3 2
      compiler/msg/errore.msg
  19. 3 2
      compiler/msgidx.inc
  20. 262 261
      compiler/msgtxt.inc
  21. 27 33
      compiler/nadd.pas
  22. 6 0
      compiler/nbas.pas
  23. 5 2
      compiler/ncnv.pas
  24. 2 1
      compiler/ncon.pas
  25. 8 3
      compiler/nflw.pas
  26. 25 5
      compiler/options.pas
  27. 5 0
      compiler/pdecsub.pas
  28. 3 3
      compiler/pmodules.pas
  29. 7 7
      compiler/systems.pas
  30. 3 3
      compiler/systems/i_macos.pas
  31. 5 5
      compiler/systems/i_sinclairql.pas
  32. 16 761
      compiler/systems/t_linux.pas
  33. 5 5
      compiler/systems/t_msdos.pas
  34. 41 14
      compiler/systems/t_sinclairql.pas
  35. 1 1
      compiler/utils/Makefile
  36. 1 1
      compiler/utils/Makefile.fpc
  37. 5 0
      compiler/utils/mkx86ins.pp
  38. 14 8
      compiler/x86/aasmcpu.pas
  39. 2 0
      compiler/x86/agx86att.pas
  40. 11 4
      compiler/x86/agx86nsm.pas
  41. 5 0
      compiler/x86/cgx86.pas
  42. 1 1
      compiler/x86/cpubase.pas
  43. 9 1
      compiler/x86/itcpugas.pas
  44. 158 60
      compiler/x86/rax86.pas
  45. 2 0
      compiler/x86/rax86att.pas
  46. 86 58
      compiler/x86/x86ins.dat
  47. 2 0
      compiler/x86_64/aoptcpu.pas
  48. 11 11
      compiler/x86_64/x8664ats.inc
  49. 1 1
      compiler/x86_64/x8664att.inc
  50. 1 1
      compiler/x86_64/x8664nop.inc
  51. 232 78
      compiler/x86_64/x8664tab.inc
  52. 1 1
      packages/bzip2/fpmake.pp
  53. 1 1
      packages/chm/fpmake.pp
  54. 1 1
      packages/fcl-base/fpmake.pp
  55. 1 1
      packages/fcl-db/fpmake.pp
  56. 6 6
      packages/fcl-db/src/base/sqlscript.pp
  57. 12 4
      packages/fcl-db/src/sqldb/interbase/ibconnection.pp
  58. 1 1
      packages/fcl-fpcunit/fpmake.pp
  59. 1 1
      packages/fcl-image/fpmake.pp
  60. 1 1
      packages/fcl-js/fpmake.pp
  61. 1 1
      packages/fcl-json/fpmake.pp
  62. 1 1
      packages/fcl-net/fpmake.pp
  63. 1 1
      packages/fcl-passrc/fpmake.pp
  64. 2 0
      packages/fcl-passrc/src/pasresolveeval.pas
  65. 11 3
      packages/fcl-passrc/src/pasresolver.pp
  66. 3 8
      packages/fcl-passrc/src/pasuseanalyzer.pas
  67. 3 0
      packages/fcl-passrc/src/pparser.pp
  68. 6 2
      packages/fcl-passrc/src/pscanner.pp
  69. 25 0
      packages/fcl-passrc/tests/tcuseanalyzer.pas
  70. 1 1
      packages/fcl-pdf/fpmake.pp
  71. 40 10
      packages/fcl-pdf/src/fppdf.pp
  72. 1 1
      packages/fcl-process/fpmake.pp
  73. 1 1
      packages/fcl-registry/fpmake.pp
  74. 1 0
      packages/fcl-registry/src/regini.inc
  75. 59 19
      packages/fcl-registry/src/xregreg.inc
  76. 1 1
      packages/fcl-res/fpmake.pp
  77. 1 1
      packages/fcl-sdo/fpmake.pp
  78. 1 1
      packages/fcl-sound/fpmake.pp
  79. TEMPAT SAMPAH
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16.wav
  80. 1 0
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16.wav.info.txt
  81. TEMPAT SAMPAH
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16_tag.wav
  82. 1 0
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16_tag.wav.info.txt
  83. TEMPAT SAMPAH
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_24.wav
  84. 1 0
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_24.wav.info.txt
  85. TEMPAT SAMPAH
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav
  86. 1 0
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav.info.txt
  87. TEMPAT SAMPAH
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav
  88. 1 0
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav.info.txt
  89. 67 0
      packages/fcl-sound/tests/tcwavreader.pas
  90. 75 0
      packages/fcl-sound/tests/testfclsound.lpi
  91. 15 0
      packages/fcl-sound/tests/testfclsound.lpr
  92. 1 1
      packages/fcl-stl/fpmake.pp
  93. 1 1
      packages/fcl-xml/fpmake.pp
  94. 16 37
      packages/fcl-xml/src/sax_xml.pp
  95. 1 0
      packages/fpmake_add.inc
  96. 5 0
      packages/fpmake_proc.inc
  97. 1 1
      packages/fpmkunit/fpmake.pp
  98. 353 32
      packages/fpmkunit/src/fpmkunit.pp
  99. 1 1
      packages/fppkg/fpmake.pp
  100. 1 1
      packages/hash/fpmake.pp

+ 25 - 0
.gitattributes

@@ -4356,6 +4356,19 @@ packages/fcl-sound/fpmake.pp svneol=native#text/plain
 packages/fcl-sound/src/fpwavformat.pas svneol=native#text/plain
 packages/fcl-sound/src/fpwavreader.pas svneol=native#text/plain
 packages/fcl-sound/src/fpwavwriter.pas svneol=native#text/plain
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16.wav -text svneol=unset#audio/x-wav
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16.wav.info.txt svneol=native#text/plain
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16_tag.wav -text svneol=unset#audio/x-wav
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16_tag.wav.info.txt svneol=native#text/plain
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_24.wav -text svneol=unset#audio/x-wav
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_24.wav.info.txt svneol=native#text/plain
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav -text svneol=unset#audio/x-wav
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav.info.txt svneol=native#text/plain
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav -text svneol=unset#audio/x-wav
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav.info.txt svneol=native#text/plain
+packages/fcl-sound/tests/tcwavreader.pas svneol=native#text/plain
+packages/fcl-sound/tests/testfclsound.lpi svneol=native#text/plain
+packages/fcl-sound/tests/testfclsound.lpr svneol=native#text/plain
 packages/fcl-stl/Makefile svneol=native#text/plain
 packages/fcl-stl/Makefile.fpc svneol=native#text/plain
 packages/fcl-stl/Makefile.fpc.fpcmake svneol=native#text/plain
@@ -6265,6 +6278,7 @@ packages/ide/fp.pas svneol=native#text/plain
 packages/ide/fp.term -text svneol=unset#application/octet-stream
 packages/ide/fp32.ico -text
 packages/ide/fp32.rc -text
+packages/ide/fparm.lpi svneol=native#text/plain
 packages/ide/fpcalc.pas svneol=native#text/plain
 packages/ide/fpcatch.pas svneol=native#text/plain
 packages/ide/fpcodcmp.pas svneol=native#text/plain
@@ -8726,6 +8740,11 @@ packages/pxlib/examples/Makefile.fpc svneol=native#text/plain
 packages/pxlib/examples/ppxview.pp svneol=native#text/plain
 packages/pxlib/fpmake.pp svneol=native#text/plain
 packages/pxlib/src/pxlib.pp svneol=native#text/plain
+packages/qlunits/Makefile svneol=native#text/plain
+packages/qlunits/Makefile.fpc svneol=native#text/plain
+packages/qlunits/README.txt svneol=native#text/plain
+packages/qlunits/fpmake.pp svneol=native#text/plain
+packages/qlunits/src/qdos.pas svneol=native#text/plain
 packages/regexpr/Makefile svneol=native#text/plain
 packages/regexpr/Makefile.fpc svneol=native#text/plain
 packages/regexpr/Makefile.fpc.fpcmake svneol=native#text/plain
@@ -18539,6 +18558,7 @@ tests/webtbs/tw37508.pp svneol=native#text/pascal
 tests/webtbs/tw3751.pp svneol=native#text/plain
 tests/webtbs/tw37554.pp svneol=native#text/pascal
 tests/webtbs/tw3758.pp svneol=native#text/plain
+tests/webtbs/tw37621.pp -text svneol=native#text/pascal
 tests/webtbs/tw3764.pp svneol=native#text/plain
 tests/webtbs/tw3765.pp svneol=native#text/plain
 tests/webtbs/tw37650.pp svneol=native#text/pascal
@@ -18564,6 +18584,10 @@ tests/webtbs/tw38022.pp svneol=native#text/pascal
 tests/webtbs/tw3805.pp svneol=native#text/plain
 tests/webtbs/tw38051.pp svneol=native#text/pascal
 tests/webtbs/tw38054.pp svneol=native#text/plain
+tests/webtbs/tw38058.pp svneol=native#text/pascal
+tests/webtbs/tw38069.pp svneol=native#text/pascal
+tests/webtbs/tw38074.pp svneol=native#text/pascal
+tests/webtbs/tw38083.pp svneol=native#text/pascal
 tests/webtbs/tw3814.pp svneol=native#text/plain
 tests/webtbs/tw3827.pp svneol=native#text/plain
 tests/webtbs/tw3829.pp svneol=native#text/plain
@@ -19103,6 +19127,7 @@ tests/webtbs/uw35918a.pp svneol=native#text/pascal
 tests/webtbs/uw35918b.pp svneol=native#text/pascal
 tests/webtbs/uw35918c.pp svneol=native#text/pascal
 tests/webtbs/uw36544.pp svneol=native#text/pascal
+tests/webtbs/uw38069.pp svneol=native#text/pascal
 tests/webtbs/uw3968.pp svneol=native#text/plain
 tests/webtbs/uw4056.pp svneol=native#text/plain
 tests/webtbs/uw4140.pp svneol=native#text/plain

+ 1 - 1
compiler/aarch64/aoptcpu.pas

@@ -85,11 +85,11 @@ Implementation
     var
       p: taicpu;
     begin
-      p := taicpu(hp);
       Result := false;
       if not ((assigned(hp)) and (hp.typ = ait_instruction)) then
         exit;
 
+      p := taicpu(hp);
       case p.opcode of
         { These operands do not write into a register at all }
         A_CMP, A_CMN, A_TST, A_B, A_BL, A_MSR, A_FCMP:

+ 1 - 1
compiler/arm/aoptcpu.pas

@@ -220,11 +220,11 @@ Implementation
     var
       p: taicpu;
     begin
-      p := taicpu(hp);
       Result := false;
       if not ((assigned(hp)) and (hp.typ = ait_instruction)) then
         exit;
 
+      p := taicpu(hp);
       case p.opcode of
         { These operands do not write into a register at all }
         A_CMP, A_CMN, A_TST, A_TEQ, A_B, A_BL, A_BX, A_BLX, A_SWI, A_MSR, A_PLD,

+ 2 - 0
compiler/armgen/aoptarm.pas

@@ -378,6 +378,8 @@ Implementation
 {$ifdef ARM}
             and not (getsupreg(taicpu(p).oper[0]^.reg) in [RS_PC, RS_R14, RS_STACK_POINTER_REG])
             and (getsupreg(taicpu(p).oper[1]^.reg) <> RS_PC)
+            { Thumb does not support references with base and index one being SP }
+            and (not(GenerateThumbCode) or (getsupreg(taicpu(p).oper[1]^.reg) <> RS_STACK_POINTER_REG))
 {$endif ARM}
 {$ifdef AARCH64}
             and (getsupreg(taicpu(p).oper[0]^.reg) <> RS_STACK_POINTER_REG)

+ 0 - 4
compiler/fpcdefs.inc

@@ -314,10 +314,6 @@
   {$define cpucapabilities}
 {$endif z80}
 
-{$IFDEF MACOS}
-{$DEFINE USE_FAKE_SYSUTILS}
-{$ENDIF MACOS}
-
 {$ifdef riscv64}
   {$define riscv}
   {$define cpu64bit}

+ 4 - 0
compiler/generic/cpuinfo.pas

@@ -44,6 +44,10 @@ Type
       (cpu_none
       );
 
+   { copied from arm/cpuinfo unit for arm specific
+     TSettings field }
+   tinstructionset = (is_thumb,is_arm);
+
 
 Type
    tfputype =

+ 26 - 18
compiler/globals.pas

@@ -44,9 +44,9 @@ interface
       { comphook pulls in sysutils anyways }
       cutils,cclasses,cfileutl,
       cpuinfo,
-{$if defined(LLVM) and not defined(GENERIC_CPU)}
+{$if defined(LLVM) or defined(GENERIC_CPU)}
       llvminfo,
-{$endif LLVM and not GENERIC_CPU}
+{$endif LLVM or GENERIC_CPU}
       globtype,version,systems;
 
     const
@@ -166,23 +166,31 @@ interface
 
          tlsmodel : ttlsmodel;
 
-{$if defined(i8086)}
-         x86memorymodel  : tx86memorymodel;
-{$endif defined(i8086)}
-
-{$if defined(ARM)}
-         instructionset : tinstructionset;
-{$endif defined(ARM)}
-
-{$if defined(LLVM) and not defined(GENERIC_CPU)}
-         llvmversion: tllvmversion;
-{$endif defined(LLVM) and not defined(GENERIC_CPU)}
-
         { CPU targets with microcontroller support can add a controller specific unit }
          controllertype   : tcontrollertype;
 
          { WARNING: this pointer cannot be written as such in record token }
          pmessage : pmessagestaterecord;
+{$if defined(generic_cpu)}
+         case byte of
+{$endif}
+{$if defined(i8086) or defined(generic_cpu)}
+   {$ifdef generic_cpu} 1:({$endif}
+           x86memorymodel  : tx86memorymodel;
+   {$ifdef generic_cpu}   );{$endif}
+{$endif defined(i8086) or defined(generic_cpu)}
+
+{$if defined(ARM) or defined(generic_cpu)}
+   {$ifdef generic_cpu} 2:({$endif}
+         instructionset : tinstructionset;
+   {$ifdef generic_cpu}   );{$endif}
+{$endif defined(ARM) or defined(generic_cpu)}
+
+{$if defined(LLVM) or defined(GENERIC_CPU)}
+   {$ifdef generic_cpu} 3:({$endif}
+         llvmversion: tllvmversion;
+   {$ifdef generic_cpu}   );{$endif}
+{$endif defined(LLVM) or defined(GENERIC_CPU)}
        end;
 
     const
@@ -597,17 +605,17 @@ interface
         disabledircache : false;
 
         tlsmodel : tlsm_none;
-{$if defined(i8086)}
+        controllertype : ct_none;
+        pmessage : nil;
+{$if defined(i8086) or defined(GENERIC_CPU)}
         x86memorymodel : mm_small;
-{$endif defined(i8086)}
+{$endif defined(i8086) or defined(GENERIC_CPU)}
 {$if defined(ARM)}
         instructionset : is_arm;
 {$endif defined(ARM)}
 {$if defined(LLVM) and not defined(GENERIC_CPU)}
         llvmversion    : llvmver_7_0;
 {$endif defined(LLVM) and not defined(GENERIC_CPU)}
-        controllertype : ct_none;
-        pmessage : nil;
       );
 
     var

+ 2 - 0
compiler/i386/aoptcpu.pas

@@ -143,6 +143,8 @@ unit aoptcpu;
                   Result:=OptPass1Imul(p);
                 A_CMP:
                   Result:=OptPass1Cmp(p);
+                A_VPXORD,
+                A_VPXORQ,
                 A_VXORPS,
                 A_VXORPD,
                 A_VPXOR:

+ 1 - 1
compiler/i386/i386att.inc

@@ -1201,7 +1201,7 @@
 'vcompresspd',
 'vcompressps',
 'vcvtpd2qq',
-'vcvtpd2udq',
+' vcvtpd2udq',
 'vcvtpd2uqq',
 'vcvtps2qq',
 'vcvtps2udq',

+ 11 - 11
compiler/i386/i386atts.inc

@@ -781,8 +781,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufMM,
-attsufMM,
+attsufMMX,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -793,7 +793,7 @@ attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
-attsufMM,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1201,14 +1201,17 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1218,6 +1221,9 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1235,14 +1241,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,

+ 1 - 1
compiler/i386/i386nop.inc

@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-4150;
+4172;

+ 231 - 77
compiler/i386/i386tab.inc

@@ -10433,7 +10433,7 @@
   (
     opcode  : A_VCVTDQ2PD;
     ops     : 2;
-    optypes : (ot_zmmreg_mz,ot_ymmreg_er,ot_none,ot_none);
+    optypes : (ot_zmmreg_mz,ot_ymmreg,ot_none,ot_none);
     code    : #219#232#233#248#1#230#72;
     flags   : [if_avx512]
   ),
@@ -10493,6 +10493,13 @@
     code    : #232#233#248#1#91#72;
     flags   : [if_avx512]
   ),
+  (
+    opcode  : A_VCVTPD2DQ;
+    ops     : 2;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits256,ot_none,ot_none);
+    code    : #220#232#234#242#244#248#1#230#72;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
   (
     opcode  : A_VCVTPD2DQ;
     ops     : 2;
@@ -10503,9 +10510,9 @@
   (
     opcode  : A_VCVTPD2DQ;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_ymmrm,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_ymmreg,ot_none,ot_none);
     code    : #220#232#234#242#244#248#1#230#72;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
   ),
   (
     opcode  : A_VCVTPD2DQ;
@@ -10832,7 +10839,7 @@
   (
     opcode  : A_VCVTSI2SD;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
     code    : #220#232#242#248#1#42#61#80;
     flags   : [if_avx,if_sandybridge,if_sd]
   ),
@@ -10846,7 +10853,7 @@
   (
     opcode  : A_VCVTSI2SS;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
     code    : #219#232#242#248#1#42#61#80;
     flags   : [if_avx,if_sandybridge,if_sd]
   ),
@@ -11232,7 +11239,7 @@
     opcode  : A_VEXTRACTPS;
     ops     : 3;
     optypes : (ot_reg64,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
-    code    : #232#241#250#1#23#65#22;
+    code    : #232#241#242#250#1#23#65#22;
     flags   : [if_avx512]
   ),
   (
@@ -15039,9 +15046,16 @@
   (
     opcode  : A_VPSLLD;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#114#60#142#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSLLD;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#114#60#142#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSLLD;
@@ -15060,9 +15074,16 @@
   (
     opcode  : A_VPSLLD;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#114#60#142#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSLLD;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#114#60#142#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSLLD;
@@ -15151,10 +15172,17 @@
   (
     opcode  : A_VPSLLQ;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#248#1#115#60#142#22;
     flags   : [if_avx,if_sandybridge,if_tfv]
   ),
+  (
+    opcode  : A_VPSLLQ;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#248#1#115#60#142#22;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
     opcode  : A_VPSLLQ;
     ops     : 3;
@@ -15172,9 +15200,16 @@
   (
     opcode  : A_VPSLLQ;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#244#248#1#115#60#142#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSLLQ;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#244#248#1#115#60#142#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSLLQ;
@@ -15214,9 +15249,16 @@
   (
     opcode  : A_VPSLLW;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#113#60#142#22;
-    flags   : [if_avx,if_sandybridge,if_tfvm]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSLLW;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#113#60#142#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSLLW;
@@ -15228,9 +15270,16 @@
   (
     opcode  : A_VPSLLW;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#113#60#142#22;
-    flags   : [if_avx2,if_tfvm]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSLLW;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#113#60#142#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSLLW;
@@ -15249,9 +15298,16 @@
   (
     opcode  : A_VPSRAD;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#114#60#140#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRAD;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#114#60#140#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRAD;
@@ -15270,9 +15326,16 @@
   (
     opcode  : A_VPSRAD;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#114#60#140#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRAD;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#114#60#140#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRAD;
@@ -15312,9 +15375,16 @@
   (
     opcode  : A_VPSRAW;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#113#60#140#22;
-    flags   : [if_avx,if_sandybridge,if_tfvm]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRAW;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#113#60#140#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRAW;
@@ -15326,9 +15396,16 @@
   (
     opcode  : A_VPSRAW;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#113#60#140#22;
-    flags   : [if_avx2,if_tfvm]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRAW;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#113#60#140#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRAW;
@@ -15354,9 +15431,16 @@
   (
     opcode  : A_VPSRLD;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#114#60#138#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRLD;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#114#60#138#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRLD;
@@ -15382,10 +15466,17 @@
   (
     opcode  : A_VPSRLD;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#114#60#138#22;
     flags   : [if_avx2,if_tfv]
   ),
+  (
+    opcode  : A_VPSRLD;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#114#60#138#22;
+    flags   : [if_avx2,if_tfv]
+  ),
   (
     opcode  : A_VPSRLD;
     ops     : 3;
@@ -15459,9 +15550,16 @@
   (
     opcode  : A_VPSRLQ;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#248#1#115#60#138#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRLQ;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#248#1#115#60#138#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRLQ;
@@ -15473,9 +15571,16 @@
   (
     opcode  : A_VPSRLQ;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#244#248#1#115#60#138#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRLQ;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#244#248#1#115#60#138#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRLQ;
@@ -15515,9 +15620,16 @@
   (
     opcode  : A_VPSRLW;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#113#60#138#22;
-    flags   : [if_avx,if_sandybridge,if_tfvm]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRLW;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#113#60#138#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRLW;
@@ -15529,9 +15641,16 @@
   (
     opcode  : A_VPSRLW;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#113#60#138#22;
-    flags   : [if_avx2,if_tfvm]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRLW;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#113#60#138#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRLW;
@@ -19758,7 +19877,7 @@
     opcode  : A_VFNMADD231SD;
     ops     : 3;
     optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
-    code    : #223#241#242#243#249#1#189#61#80;
+    code    : #223#232#234#241#242#243#249#1#189#61#80;
     flags   : [if_fma,if_t1s]
   ),
   (
@@ -22053,7 +22172,7 @@
   (
     opcode  : A_VCVTUDQ2PD;
     ops     : 2;
-    optypes : (ot_zmmreg_mz,ot_ymmreg_er,ot_none,ot_none);
+    optypes : (ot_zmmreg_mz,ot_ymmreg,ot_none,ot_none);
     code    : #219#232#233#248#1#122#72;
     flags   : [if_avx512]
   ),
@@ -22221,10 +22340,17 @@
   (
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_rm_gpr or ot_bits64,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
     code    : #220#232#234#248#1#123#61#80;
     flags   : [if_avx512,if_t1s]
   ),
+  (
+    opcode  : A_VCVTUSI2SD;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg64,ot_none);
+    code    : #220#232#234#248#1#123#61#80;
+    flags   : [if_avx512]
+  ),
   (
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
@@ -22687,6 +22813,20 @@
     code    : #232#241#250#1#85#61#80#23;
     flags   : [if_avx512]
   ),
+  (
+    opcode  : A_VFPCLASSPD;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#244#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VFPCLASSPD;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits512,ot_immediate or ot_bits8,ot_none);
+    code    : #232#233#234#241#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
     opcode  : A_VFPCLASSPD;
     ops     : 3;
@@ -22704,9 +22844,9 @@
   (
     opcode  : A_VFPCLASSPD;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#244#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPD;
@@ -22718,9 +22858,9 @@
   (
     opcode  : A_VFPCLASSPD;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_zmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_zmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#233#234#241#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPD;
@@ -22729,6 +22869,20 @@
     code    : #232#233#234#241#250#1#102#72#22;
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
+  (
+    opcode  : A_VFPCLASSPS;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VFPCLASSPS;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits512,ot_immediate or ot_bits8,ot_none);
+    code    : #232#233#241#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
     opcode  : A_VFPCLASSPS;
     ops     : 3;
@@ -22746,9 +22900,9 @@
   (
     opcode  : A_VFPCLASSPS;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#244#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPS;
@@ -22760,9 +22914,9 @@
   (
     opcode  : A_VFPCLASSPS;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_zmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_zmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#233#241#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPS;
@@ -28194,21 +28348,21 @@
     ops     : 2;
     optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
     code    : #232#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPCOMPRESSB;
     ops     : 2;
     optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
     code    : #232#241#244#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPCOMPRESSB;
     ops     : 2;
     optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
     code    : #232#233#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPCOMPRESSB;
@@ -28236,21 +28390,21 @@
     ops     : 2;
     optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
     code    : #232#234#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPCOMPRESSW;
     ops     : 2;
     optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
     code    : #232#234#241#244#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPCOMPRESSW;
     ops     : 2;
     optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
     code    : #232#233#234#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPCOMPRESSW;
@@ -28444,85 +28598,85 @@
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
-    optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
-    code    : #232#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
+    code    : #232#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
-    optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
-    code    : #232#241#244#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_none,ot_none);
+    code    : #232#241#244#249#1#98#72;
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
-    optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_zmmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    code    : #232#233#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
     optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
-    code    : #232#241#249#1#98#65;
+    code    : #232#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
     optypes : (ot_ymmreg_mz,ot_ymmreg,ot_none,ot_none);
-    code    : #232#241#244#249#1#98#65;
+    code    : #232#241#244#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
     optypes : (ot_zmmreg_mz,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#241#249#1#98#65;
+    code    : #232#233#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
-    optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
-    code    : #232#234#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
+    code    : #232#234#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
-    optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
-    code    : #232#234#241#244#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_none,ot_none);
+    code    : #232#234#241#244#249#1#98#72;
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
-    optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#234#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_zmmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    code    : #232#233#234#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
     optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
-    code    : #232#234#241#249#1#98#65;
+    code    : #232#234#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
     optypes : (ot_ymmreg_mz,ot_ymmreg,ot_none,ot_none);
-    code    : #232#234#241#244#249#1#98#65;
+    code    : #232#234#241#244#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
     optypes : (ot_zmmreg_mz,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#234#241#249#1#98#65;
+    code    : #232#233#234#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (

+ 1 - 1
compiler/i8086/i8086att.inc

@@ -1215,7 +1215,7 @@
 'vcompresspd',
 'vcompressps',
 'vcvtpd2qq',
-'vcvtpd2udq',
+' vcvtpd2udq',
 'vcvtpd2uqq',
 'vcvtps2qq',
 'vcvtps2udq',

+ 11 - 11
compiler/i8086/i8086atts.inc

@@ -781,8 +781,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufMM,
-attsufMM,
+attsufMMX,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -793,7 +793,7 @@ attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
-attsufMM,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1215,14 +1215,17 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1232,6 +1235,9 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1249,14 +1255,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,

+ 1 - 1
compiler/i8086/i8086nop.inc

@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-4182;
+4204;

+ 231 - 77
compiler/i8086/i8086tab.inc

@@ -10461,7 +10461,7 @@
   (
     opcode  : A_VCVTDQ2PD;
     ops     : 2;
-    optypes : (ot_zmmreg_mz,ot_ymmreg_er,ot_none,ot_none);
+    optypes : (ot_zmmreg_mz,ot_ymmreg,ot_none,ot_none);
     code    : #219#232#233#248#1#230#72;
     flags   : [if_avx512]
   ),
@@ -10521,6 +10521,13 @@
     code    : #232#233#248#1#91#72;
     flags   : [if_avx512]
   ),
+  (
+    opcode  : A_VCVTPD2DQ;
+    ops     : 2;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits256,ot_none,ot_none);
+    code    : #220#232#234#242#244#248#1#230#72;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
   (
     opcode  : A_VCVTPD2DQ;
     ops     : 2;
@@ -10531,9 +10538,9 @@
   (
     opcode  : A_VCVTPD2DQ;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_ymmrm,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_ymmreg,ot_none,ot_none);
     code    : #220#232#234#242#244#248#1#230#72;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
   ),
   (
     opcode  : A_VCVTPD2DQ;
@@ -10860,7 +10867,7 @@
   (
     opcode  : A_VCVTSI2SD;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
     code    : #220#232#242#248#1#42#61#80;
     flags   : [if_avx,if_sandybridge,if_sd]
   ),
@@ -10874,7 +10881,7 @@
   (
     opcode  : A_VCVTSI2SS;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
     code    : #219#232#242#248#1#42#61#80;
     flags   : [if_avx,if_sandybridge,if_sd]
   ),
@@ -11260,7 +11267,7 @@
     opcode  : A_VEXTRACTPS;
     ops     : 3;
     optypes : (ot_reg64,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
-    code    : #232#241#250#1#23#65#22;
+    code    : #232#241#242#250#1#23#65#22;
     flags   : [if_avx512]
   ),
   (
@@ -15067,9 +15074,16 @@
   (
     opcode  : A_VPSLLD;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#114#60#142#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSLLD;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#114#60#142#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSLLD;
@@ -15088,9 +15102,16 @@
   (
     opcode  : A_VPSLLD;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#114#60#142#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSLLD;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#114#60#142#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSLLD;
@@ -15179,10 +15200,17 @@
   (
     opcode  : A_VPSLLQ;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#248#1#115#60#142#22;
     flags   : [if_avx,if_sandybridge,if_tfv]
   ),
+  (
+    opcode  : A_VPSLLQ;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#248#1#115#60#142#22;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
     opcode  : A_VPSLLQ;
     ops     : 3;
@@ -15200,9 +15228,16 @@
   (
     opcode  : A_VPSLLQ;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#244#248#1#115#60#142#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSLLQ;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#244#248#1#115#60#142#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSLLQ;
@@ -15242,9 +15277,16 @@
   (
     opcode  : A_VPSLLW;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#113#60#142#22;
-    flags   : [if_avx,if_sandybridge,if_tfvm]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSLLW;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#113#60#142#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSLLW;
@@ -15256,9 +15298,16 @@
   (
     opcode  : A_VPSLLW;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#113#60#142#22;
-    flags   : [if_avx2,if_tfvm]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSLLW;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#113#60#142#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSLLW;
@@ -15277,9 +15326,16 @@
   (
     opcode  : A_VPSRAD;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#114#60#140#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRAD;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#114#60#140#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRAD;
@@ -15298,9 +15354,16 @@
   (
     opcode  : A_VPSRAD;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#114#60#140#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRAD;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#114#60#140#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRAD;
@@ -15340,9 +15403,16 @@
   (
     opcode  : A_VPSRAW;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#113#60#140#22;
-    flags   : [if_avx,if_sandybridge,if_tfvm]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRAW;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#113#60#140#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRAW;
@@ -15354,9 +15424,16 @@
   (
     opcode  : A_VPSRAW;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#113#60#140#22;
-    flags   : [if_avx2,if_tfvm]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRAW;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#113#60#140#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRAW;
@@ -15382,9 +15459,16 @@
   (
     opcode  : A_VPSRLD;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#114#60#138#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRLD;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#114#60#138#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRLD;
@@ -15410,10 +15494,17 @@
   (
     opcode  : A_VPSRLD;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#114#60#138#22;
     flags   : [if_avx2,if_tfv]
   ),
+  (
+    opcode  : A_VPSRLD;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#114#60#138#22;
+    flags   : [if_avx2,if_tfv]
+  ),
   (
     opcode  : A_VPSRLD;
     ops     : 3;
@@ -15487,9 +15578,16 @@
   (
     opcode  : A_VPSRLQ;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#248#1#115#60#138#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRLQ;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#248#1#115#60#138#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRLQ;
@@ -15501,9 +15599,16 @@
   (
     opcode  : A_VPSRLQ;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#244#248#1#115#60#138#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRLQ;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#244#248#1#115#60#138#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRLQ;
@@ -15543,9 +15648,16 @@
   (
     opcode  : A_VPSRLW;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#113#60#138#22;
-    flags   : [if_avx,if_sandybridge,if_tfvm]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRLW;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#113#60#138#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRLW;
@@ -15557,9 +15669,16 @@
   (
     opcode  : A_VPSRLW;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#113#60#138#22;
-    flags   : [if_avx2,if_tfvm]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRLW;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#113#60#138#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRLW;
@@ -19982,7 +20101,7 @@
     opcode  : A_VFNMADD231SD;
     ops     : 3;
     optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
-    code    : #223#241#242#243#249#1#189#61#80;
+    code    : #223#232#234#241#242#243#249#1#189#61#80;
     flags   : [if_fma,if_t1s]
   ),
   (
@@ -22277,7 +22396,7 @@
   (
     opcode  : A_VCVTUDQ2PD;
     ops     : 2;
-    optypes : (ot_zmmreg_mz,ot_ymmreg_er,ot_none,ot_none);
+    optypes : (ot_zmmreg_mz,ot_ymmreg,ot_none,ot_none);
     code    : #219#232#233#248#1#122#72;
     flags   : [if_avx512]
   ),
@@ -22445,10 +22564,17 @@
   (
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_rm_gpr or ot_bits64,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
     code    : #220#232#234#248#1#123#61#80;
     flags   : [if_avx512,if_t1s]
   ),
+  (
+    opcode  : A_VCVTUSI2SD;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg64,ot_none);
+    code    : #220#232#234#248#1#123#61#80;
+    flags   : [if_avx512]
+  ),
   (
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
@@ -22911,6 +23037,20 @@
     code    : #232#241#250#1#85#61#80#23;
     flags   : [if_avx512]
   ),
+  (
+    opcode  : A_VFPCLASSPD;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#244#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VFPCLASSPD;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits512,ot_immediate or ot_bits8,ot_none);
+    code    : #232#233#234#241#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
     opcode  : A_VFPCLASSPD;
     ops     : 3;
@@ -22928,9 +23068,9 @@
   (
     opcode  : A_VFPCLASSPD;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#244#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPD;
@@ -22942,9 +23082,9 @@
   (
     opcode  : A_VFPCLASSPD;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_zmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_zmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#233#234#241#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPD;
@@ -22953,6 +23093,20 @@
     code    : #232#233#234#241#250#1#102#72#22;
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
+  (
+    opcode  : A_VFPCLASSPS;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VFPCLASSPS;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits512,ot_immediate or ot_bits8,ot_none);
+    code    : #232#233#241#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
     opcode  : A_VFPCLASSPS;
     ops     : 3;
@@ -22970,9 +23124,9 @@
   (
     opcode  : A_VFPCLASSPS;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#244#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPS;
@@ -22984,9 +23138,9 @@
   (
     opcode  : A_VFPCLASSPS;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_zmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_zmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#233#241#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPS;
@@ -28418,21 +28572,21 @@
     ops     : 2;
     optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
     code    : #232#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPCOMPRESSB;
     ops     : 2;
     optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
     code    : #232#241#244#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPCOMPRESSB;
     ops     : 2;
     optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
     code    : #232#233#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPCOMPRESSB;
@@ -28460,21 +28614,21 @@
     ops     : 2;
     optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
     code    : #232#234#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPCOMPRESSW;
     ops     : 2;
     optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
     code    : #232#234#241#244#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPCOMPRESSW;
     ops     : 2;
     optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
     code    : #232#233#234#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPCOMPRESSW;
@@ -28668,85 +28822,85 @@
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
-    optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
-    code    : #232#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
+    code    : #232#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
-    optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
-    code    : #232#241#244#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_none,ot_none);
+    code    : #232#241#244#249#1#98#72;
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
-    optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_zmmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    code    : #232#233#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
     optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
-    code    : #232#241#249#1#98#65;
+    code    : #232#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
     optypes : (ot_ymmreg_mz,ot_ymmreg,ot_none,ot_none);
-    code    : #232#241#244#249#1#98#65;
+    code    : #232#241#244#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
     optypes : (ot_zmmreg_mz,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#241#249#1#98#65;
+    code    : #232#233#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
-    optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
-    code    : #232#234#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
+    code    : #232#234#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
-    optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
-    code    : #232#234#241#244#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_none,ot_none);
+    code    : #232#234#241#244#249#1#98#72;
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
-    optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#234#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_zmmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    code    : #232#233#234#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
     optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
-    code    : #232#234#241#249#1#98#65;
+    code    : #232#234#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
     optypes : (ot_ymmreg_mz,ot_ymmreg,ot_none,ot_none);
-    code    : #232#234#241#244#249#1#98#65;
+    code    : #232#234#241#244#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
     optypes : (ot_zmmreg_mz,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#234#241#249#1#98#65;
+    code    : #232#233#234#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (

+ 13 - 5
compiler/m68k/ra68kmot.pas

@@ -1148,10 +1148,17 @@ const
             end;
         else
           begin
+            if actasmtoken in [AS_COMMA,AS_SEPARATOR] then
+              begin
+                { no longer in an expression }
+                if not ErrorFlag then
+                  BuildRefExpression := CalculateExpression(expr);
+                exit;
+              end;
+
             { write error only once. }
             if not errorflag then
               Message(asmr_e_invalid_constant_expression);
-            if actasmtoken in [AS_COMMA,AS_SEPARATOR] then exit;
             { consume tokens until we find COMMA or SEPARATOR }
             errorflag := true;
         end;
@@ -1421,7 +1428,7 @@ const
                          Message(asmr_e_invalid_operand_type);
                       { identifiers are handled by BuildExpression }
                       oper.opr.typ := OPR_CONSTANT;
-		      l:=BuildExpression(true,@tempstr);
+                      l:=BuildExpression(true,@tempstr);
                       oper.opr.val :=aint(l);
                       if tempstr<>'' then
                         begin
@@ -1432,13 +1439,13 @@ const
                         end;
                  end;
    { // Constant memory offset .              // }
-   { // This must absolutely be followed by ( // }
      AS_HEXNUM,AS_INTNUM,
      AS_BINNUM,AS_OCTALNUM,AS_PLUS:
                    begin
                       Oper.InitRef;
                       oper.opr.ref.offset:=BuildRefExpression;
-                      BuildReference(oper);
+                      if actasmtoken = AS_LPAREN then
+                        BuildReference(oper);
                    end;
    { // A constant expression, or a Variable ref. // }
      AS_ID:  begin
@@ -1476,7 +1483,8 @@ const
                    begin
                      Oper.InitRef;
                      oper.opr.ref.offset:=BuildRefExpression;
-                     BuildReference(oper);
+                     if actasmtoken = AS_LPAREN then
+                       BuildReference(oper);
                    end
                  else { is it a label variable ? }
 

+ 3 - 2
compiler/msg/errore.msg

@@ -3419,7 +3419,7 @@ unit_u_ppu_llvm_mismatch=10067_U_Skipping unit, PPU and compiler have to be both
 #
 #  Options
 #
-# 11061 is the last used one
+# 11062 is the last used one
 #
 option_usage=11000_O_$1 [options] <inputfile> [options]
 # BeginOfTeX
@@ -3575,6 +3575,7 @@ option_features_only_for_system_unit=11060_E_Feature switches are only supported
 % To selected a certain feature, the system unit must be compiled with this feature enabled. All other units inherited the features set by the
 % system unit through the ppu of the system unit.
 option_debug_info_requires_external_linker=11061_N_The selected debug format is not supported by the internal linker, switching to external linking
+option_valgrind_heaptrc_mismatch=11062_E_You can not use both options ($1) ($2) at same time.
 %\end{description}
 # EndOfTeX
 
@@ -4151,7 +4152,7 @@ F*2P<x>_Set target CPU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel,powerpc,
 6*2Tnetbsd_NetBSD
 6*2Tmacosclassic_Classic Mac OS
 6*2Tpalmos_PalmOS
-6*2Tql_Sinclair QL
+6*2Tsinclairql_Sinclair QL
 # i8086 targets
 8*2Tembedded_Embedded
 8*2Tmsdos_MS-DOS (and compatible)

+ 3 - 2
compiler/msgidx.inc

@@ -1081,6 +1081,7 @@ const
   option_invalid_target_architecture=11059;
   option_features_only_for_system_unit=11060;
   option_debug_info_requires_external_linker=11061;
+  option_valgrind_heaptrc_mismatch=11062;
   wpo_cant_find_file=12000;
   wpo_begin_processing=12001;
   wpo_end_processing=12002;
@@ -1134,9 +1135,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 86477;
+  MsgTxtSize = 86546;
 
   MsgIdxMax : array[1..20] of longint=(
     28,107,360,130,99,63,145,36,223,68,
-    62,20,30,1,1,1,1,1,1,1
+    63,20,30,1,1,1,1,1,1,1
   );

+ 262 - 261
compiler/msgtxt.inc

@@ -1320,79 +1320,80 @@ const msgtxt : array[0..000360,1..240] of char=(
   ' unit.'#000+
   '11061_N_The selected debug format is not supported by the internal lin'+
   'ker, swit','ching to external linking'#000+
+  '11062_E_You can not use both options ($1) ($2) at same time.'#000+
   '12000_F_Cannot open whole program optimization feedback file "$1"'#000+
   '12001_D_Processing whole program optimization information in wpo feedb'+
   'ack file "$1"'#000+
-  '12002_D_Finished processing the whole program optimization infor','mati'+
+  '120','02_D_Finished processing the whole program optimization informati'+
   'on in wpo feedback file "$1"'#000+
   '12003_E_Expected section header, but got "$2" at line $1 of wpo feedba'+
   'ck file'#000+
-  '12004_W_No handler registered for whole program optimization section "'+
-  '$2" at line $1 of wpo feedback file, ignoring'#000+
-  '12005_D_Found',' whole program optimization section "$1" with informati'+
-  'on about "$2"'#000+
+  '12004_W_No handler registered for whole program optimization section',' '+
+  '"$2" at line $1 of wpo feedback file, ignoring'#000+
+  '12005_D_Found whole program optimization section "$1" with information'+
+  ' about "$2"'#000+
   '12006_F_The selected whole program optimizations require a previously '+
-  'generated feedback file (use -Fw to specify)'#000+
-  '12007_E_No collected information necessary to perform "$','1" whole pro'+
-  'gram optimization found'#000+
+  'generated feedback file (use -Fw to spec','ify)'#000+
+  '12007_E_No collected information necessary to perform "$1" whole progr'+
+  'am optimization found'#000+
   '12008_F_Specify a whole program optimization feedback file to store th'+
   'e generated info in (using -FW)'#000+
-  '12009_E_Not generating any whole program optimization information, yet'+
-  ' a feedback file was specified (','using -FW)'#000+
+  '12009_E_Not generating any whole program ','optimization information, y'+
+  'et a feedback file was specified (using -FW)'#000+
   '12010_E_Not performing any whole program optimizations, yet an input f'+
   'eedback file was specified (using -Fw)'#000+
-  '12011_D_Skipping whole program optimization section "$1", because not '+
-  'needed by the requested optimizations'#000+
-  '12012_W_Over','riding previously read information for "$1" from feedbac'+
-  'k input file using information in section "$2"'#000+
+  '12011_D_Skipping whole program optimization section "$1", b','ecause no'+
+  't needed by the requested optimizations'#000+
+  '12012_W_Overriding previously read information for "$1" from feedback '+
+  'input file using information in section "$2"'#000+
   '12013_E_Cannot extract symbol liveness information from program when s'+
-  'tripping symbols, use -Xs-'#000+
-  '12014_E_Cannot extract symbol liveness i','nformation from program when'+
-  ' when not linking'#000+
+  'trippi','ng symbols, use -Xs-'#000+
+  '12014_E_Cannot extract symbol liveness information from program when w'+
+  'hen not linking'#000+
   '12015_F_Cannot find "$1" or "$2" to extract symbol liveness informatio'+
   'n from linked program'#000+
-  '12016_E_Error during reading symbol liveness information produced by "'+
-  '$1"'#000+
-  '12017_F_Error executing "$1"',' (exitcode: $2) to extract symbol inform'+
-  'ation from linked program'#000+
+  '12016_E_Error during reading symbol liven','ess information produced by'+
+  ' "$1"'#000+
+  '12017_F_Error executing "$1" (exitcode: $2) to extract symbol informat'+
+  'ion from linked program'#000+
   '12018_E_Collection of symbol liveness information can only help when u'+
   'sing smart linking, use -CX -XX'#000+
-  '12019_E_Cannot create specified whole program optimisation feedback fi'+
-  'le',' "$1"'#000+
+  '12019_E_Can','not create specified whole program optimisation feedback '+
+  'file "$1"'#000+
   '13001_F_Can'#039't find package $1'#000+
   '13002_U_PCP file for package $1 found'#000+
   '13003_E_Duplicate package $1'#000+
   '13004_E_Unit $1 can not be part of a package'#000+
-  '13005_N_Unit $1 is implicitely imported into package $2'#000+
-  '13006_F_Failed to create PCP file $2',' for package $1'#000+
+  '13005_N_Unit $1 is implicitely ','imported into package $2'#000+
+  '13006_F_Failed to create PCP file $2 for package $1'#000+
   '13007_F_Failed to read PCP file for package $1'#000+
   '13008_T_PCP loading $1'#000+
   '13009_U_PCP Name: $1'#000+
   '13010_U_PCP Flags: $1'#000+
   '13011_U_PCP Crc: $1'#000+
   '13012_U_PCP Time: $1'#000+
-  '13013_U_PCP File too short'#000+
-  '13014_U_PCP Invalid Header (no PCP at the b','egin)'#000+
+  '13013_U_P','CP File too short'#000+
+  '13014_U_PCP Invalid Header (no PCP at the begin)'#000+
   '13015_U_PCP Invalid Version $1'#000+
   '13016_U_PCP is compiled for another processor'#000+
   '13017_U_PCP is compiled for another target'#000+
   '13018_U_Writing $1'#000+
   '13019_F_Can'#039't Write PCP-File'#000+
-  '13020_F_Error reading PCP-File'#000+
-  '13021_F_Unexpected end of PCP-File'#000,
+  '13020','_F_Error reading PCP-File'#000+
+  '13021_F_Unexpected end of PCP-File'#000+
   '13022_F_Invalid PCP-File entry: $1'#000+
   '13023_U_Trying to use a unit which was compiled with a different FPU m'+
   'ode'#000+
   '13024_T_Packagesearch: $1'#000+
   '13025_U_Required package $1'#000+
-  '13026_U_Contained unit $1'#000+
-  '13027_E_Unit $1 is already contained in package $2'#000,
+  '13026_U_Containe','d unit $1'#000+
+  '13027_E_Unit $1 is already contained in package $2'#000+
   '13028_W_Unit $1 is imported from indirectly required package $2'#000+
   '13029_U_PPL filename $1'#000+
   '11023_Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPC'+
   'CPU'#010+
-  'Copyright (c) 1993-2020 by Florian Klaempfl and others'#000+
-  '11024_Free Pascal Compi','ler version $FPCVERSION'#010+
+  'Copyright (c) 199','3-2020 by Florian Klaempfl and others'#000+
+  '11024_Free Pascal Compiler version $FPCVERSION'#010+
   #010+
   'Compiler date      : $FPCDATE'#010+
   'Compiler CPU target: $FPCCPU'#010+
@@ -1401,10 +1402,10 @@ const msgtxt : array[0..000360,1..240] of char=(
   'ment):'#010+
   '  $OSTARGETS'#010+
   #010+
-  'Supported CPU instruction sets:'#010+
+  'Supported C','PU instruction sets:'#010+
   '  $INSTRUCTIONSETS'#010+
   #010+
-  'Supported FPU instru','ction sets:'#010+
+  'Supported FPU instruction sets:'#010+
   '  $FPUINSTRUCTIONSETS'#010+
   #010+
   'Supported inline assembler modes:'#010+
@@ -1416,10 +1417,10 @@ const msgtxt : array[0..000360,1..240] of char=(
   'Recognized modeswitches:'#010+
   '  $MODESWITCHES'#010+
   #010+
-  'Supported ABI targets:'#010+
+  'S','upported ABI targets:'#010+
   '  $ABITARGETS'#010+
   #010+
-  'Supported Optimizations:',#010+
+  'Supported Optimizations:'#010+
   '  $OPTIMIZATIONS'#010+
   #010+
   'Supported Whole Program Optimizations:'#010+
@@ -1429,355 +1430,354 @@ const msgtxt : array[0..000360,1..240] of char=(
   'Code Generation Backend'#010+
   '  $CODEGENERATIONBACKEND'#010+
   #010+
-  'Supported Microcontroller types:$\n  $CONTROLLERTYPES$\n'#010+
-  'This program comes under the GNU General Public L','icence'#010+
+  'Supported Microcontroller types:$\n  $CONTROL','LERTYPES$\n'#010+
+  'This program comes under the GNU General Public Licence'#010+
   'For more information read COPYING.v2'#010+
   #010+
   'Please report bugs in our bug tracker on:'#010+
   '                 https://bugs.freepascal.org'#010+
   #010+
-  'More information may be found on our WWW pages (including directions'#010+
-  'for mailing lists useful for asking qu','estions or discussing potentia'+
-  'l'#010+
+  'More information may be found on our WWW pages',' (including directions'+
+  #010+
+  'for mailing lists useful for asking questions or discussing potential'#010+
   'new features, etc.):'#010+
   '                 https://www.freepascal.org'#000+
   '11025_F*0*_Only options valid for the default or selected platform are'+
   ' listed.'#010+
-  '**0*_Put + after a boolean switch option to enable it, - to disa','ble '+
+  '**0','*_Put + after a boolean switch option to enable it, - to disable '+
   'it.'#010+
   '**1@<x>_Read compiler options from <x> in addition to the default fpc.'+
   'cfg'#010+
   '**1a_The compiler does not delete the generated assembler file'#010+
-  '**2a5_Don'#039't generate Big Obj COFF files for GNU Binutils older tha'+
-  'n 2.25 (Windows, NativeNT)'#010+
-  '**','2al_List sourcecode lines in assembler file'#010+
+  '**2a5_Don'#039't generate Big Obj COFF ','files for GNU Binutils older t'+
+  'han 2.25 (Windows, NativeNT)'#010+
+  '**2al_List sourcecode lines in assembler file'#010+
   '**2an_List node info in assembler file (-dEXTDEBUG compiler)'#010+
   '**2ao_Add an extra option to external assembler call (ignored for inte'+
-  'rnal)'#010+
-  '*L2ap_Use pipes instead of creating temporary assembler fil','es'#010+
+  'rnal',')'#010+
+  '*L2ap_Use pipes instead of creating temporary assembler files'#010+
   '**2ar_List register allocation/release info in assembler file'#010+
   '**2at_List temp allocation/release info in assembler file'#010+
   '**1A<x>_Output format:'#010+
-  '**2Adefault_Use default assembler'#010+
+  '**2Adefault_Use default assembler',#010+
   '3*2Aas_Assemble using GNU AS'#010+
-  '3*2Aas-darwin_Assemble Darwin M','ach-O using GNU GAS'#010+
+  '3*2Aas-darwin_Assemble Darwin Mach-O using GNU GAS'#010+
   '3*2Amacho_Mach-O (Darwin, Intel 32 bit) using internal writer'#010+
   '8*2Anasm_Assemble using Nasm'#010+
   '8*2Anasmobj_Assemble using Nasm'#010+
   '3*2Anasm_Assemble using Nasm'#010+
-  '3*2Anasmcoff_COFF (Go32v2) file using Nasm'#010+
-  '3*2Anasmelf_ELF32 (Linux)',' file using Nasm'#010+
+  '3*2Anas','mcoff_COFF (Go32v2) file using Nasm'#010+
+  '3*2Anasmelf_ELF32 (Linux) file using Nasm'#010+
   '3*2Anasmwin32_Win32 object file using Nasm'#010+
   '3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+
   '3*2Anasmdarwin_macho32 object file using Nasm (experimental)'#010+
-  '3*2Awasm_Obj file using Wasm (Watcom)'#010+
-  '3*2Anasmobj_Obj file using Nasm'#010,
+  '3*2Awasm_','Obj file using Wasm (Watcom)'#010+
+  '3*2Anasmobj_Obj file using Nasm'#010+
   '3*2Amasm_Obj file using Masm (Microsoft)'#010+
   '3*2Atasm_Obj file using Tasm (Borland)'#010+
   '3*2Aelf_ELF (Linux) using internal writer'#010+
   '3*2Acoff_COFF (Go32v2) using internal writer'#010+
-  '3*2Apecoff_PE-COFF (Win32) using internal writer'#010+
-  '3*2Ayasm_Assemble using ','Yasm (experimental)'#010+
+  '3*2Apecoff_P','E-COFF (Win32) using internal writer'#010+
+  '3*2Ayasm_Assemble using Yasm (experimental)'#010+
   '4*2Aas_Assemble using GNU AS'#010+
   '4*2Agas_Assemble using GNU GAS'#010+
   '4*2Aas-darwin_Assemble Darwin Mach-O using GNU GAS'#010+
-  '4*2Amasm_Win64 object file using ml64 (Microsoft)'#010+
+  '4*2Amasm_Win64 object file using ml64 (Microsoft',')'#010+
   '4*2Apecoff_PE-COFF (Win64) using internal writer'#010+
-  '4*2Aelf_EL','F (Linux-64bit) using internal writer'#010+
+  '4*2Aelf_ELF (Linux-64bit) using internal writer'#010+
   '4*2Ayasm_Assemble using Yasm (experimental)'#010+
   '4*2Anasm_Assemble using Nasm (experimental)'#010+
-  '4*2Anasmwin64_Assemble Win64 object file using Nasm (experimental)'#010+
-  '4*2Anasmelf_Assemble Linux-64bit object file us','ing Nasm (experimenta'+
-  'l)'#010+
+  '4*2Anasmwin64_Assemble Win64 object file using Nasm (','experimental)'#010+
+  '4*2Anasmelf_Assemble Linux-64bit object file using Nasm (experimental)'+
+  #010+
   '4*2Anasmdarwin_Assemble darwin macho64 object file using Nasm (experim'+
   'ental)'#010+
   '6*2Aas_Unix o-file using GNU AS'#010+
   '6*2Agas_GNU Motorola assembler'#010+
-  '6*2Amit_MIT Syntax (old GAS)'#010+
+  '6*2Amit_MIT Syn','tax (old GAS)'#010+
   '6*2Amot_Standard Motorola assembler'#010+
-  '6*2Avasm_Us','e vasm to assemble'#010+
+  '6*2Avasm_Use vasm to assemble'#010+
   'A*2Aas_Assemble using GNU AS'#010+
   'P*2Aas_Assemble using GNU AS'#010+
   'S*2Aas_Assemble using GNU AS'#010+
   'Z*2Asdcc-sdasz80_Assemble using SDCC-SDASZ80'#010+
-  'Z*2Az80asm_Assemble using z80asm'#010+
+  'Z*2Az80asm_Assemble using z8','0asm'#010+
   '**1b_Generate browser info'#010+
-  '**2bl_Generate local symbol i','nfo'#010+
+  '**2bl_Generate local symbol info'#010+
   '**1B_Build all modules'#010+
   '**1C<x>_Code generation options:'#010+
   '**2C3_Turn on ieee error checking for constants'#010+
   '**2Ca<x>_Select ABI; see fpc -i or fpc -ia for possible values'#010+
-  '**2Cb_Generate code for a big-endian variant of the target architectu',
-  're'#010+
+  '**2Cb_Ge','nerate code for a big-endian variant of the target architect'+
+  'ure'#010+
   '**2Cc<x>_Set default calling convention to <x>'#010+
   '**2CD_Create also dynamic library (not supported)'#010+
   '**2Ce_Compilation with emulated floating point opcodes'#010+
-  '**2CE_Generate FPU code which can raise exceptions'#010+
-  '**2Cf<x>_Select fpu instruction se','t to use; see fpc -i or fpc -if fo'+
-  'r possible values'#010+
+  '**2CE_Generate FPU code ','which can raise exceptions'#010+
+  '**2Cf<x>_Select fpu instruction set to use; see fpc -i or fpc -if for '+
+  'possible values'#010+
   '**2CF<x>_Minimal floating point constant precision (default, 32, 64)'#010+
   '**2Cg_Generate PIC code'#010+
-  '**2Ch<n>[,m]_<n> bytes min heap size (between 1023 and 67107840) and o'+
-  'ptionally [m] max heap si','ze'#010+
+  '**2Ch<n>[,m]_<n> bytes min heap si','ze (between 1023 and 67107840) and'+
+  ' optionally [m] max heap size'#010+
   '**2Ci_IO-checking'#010+
   'A*2CI<x>_Select instruction set on ARM: ARM or THUMB'#010+
   'L*2Cl<x>_LLVM code generation options'#010+
-  'L*3Clflto_Enable Link-time optimisation (needed both when compiling un'+
-  'its and programs/libraries)'#010+
-  'L*3Clfltonosystem_Disable LTO ','for the system unit (needed with at le'+
-  'ast Xcode 10.2 and earlier due to linker bugs)'#010+
+  'L*3Clflto_Enable Link-time optimisation (needed both when compiling',' '+
+  'units and programs/libraries)'#010+
+  'L*3Clfltonosystem_Disable LTO for the system unit (needed with at leas'+
+  't Xcode 10.2 and earlier due to linker bugs)'#010+
   'L*3Clv<x>_LLVM target version: Xcode-10.1, 7.0, 8.0, .., 10.0'#010+
   '**2Cn_Omit linking stage'#010+
-  'P*2CN_Generate nil-pointer checks (AIX-only)'#010+
-  '**2Co_Check overflow of',' integer operations'#010+
+  'P*2CN_G','enerate nil-pointer checks (AIX-only)'#010+
+  '**2Co_Check overflow of integer operations'#010+
   '**2CO_Check for possible overflow of integer operations'#010+
   '**2Cp<x>_Select instruction set; see fpc -i or fpc -ic for possible va'+
   'lues'#010+
-  '**2CP<x>=<y>_ packing settings'#010+
-  '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or N','ORMAL, 2, '+
-  '4 and 8'#010+
+  '**2CP<x>=<y>_ packing settin','gs'#010+
+  '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 '+
+  'and 8'#010+
   '**3CPPACKENUM=<y>_ <y> enum packing: 0, 1, 2 and 4 or DEFAULT or NORMA'+
   'L'#010+
   '**3CPPACKRECORD=<y>_ <y> record packing: 0 or DEFAULT or NORMAL, 1, 2,'+
   ' 4, 8, 16 and 32'#010+
-  '**2Cr_Range checking'#010+
+  '**','2Cr_Range checking'#010+
   '**2CR_Verify object method call validity'#010+
-  '*','*2Cs<n>_Set stack checking size to <n>'#010+
+  '**2Cs<n>_Set stack checking size to <n>'#010+
   '**2Ct_Stack checking (for testing only, see manual)'#010+
   '8*2CT<x>_Target-specific code generation options'#010+
-  '3*2CT<x>_Target-specific code generation options'#010+
+  '3*2CT<x>_Target-specific code generatio','n options'#010+
   '4*2CT<x>_Target-specific code generation options'#010+
-  'p*','2CT<x>_Target-specific code generation options'#010+
+  'p*2CT<x>_Target-specific code generation options'#010+
   'P*2CT<x>_Target-specific code generation options'#010+
   'J*2CT<x>_Target-specific code generation options'#010+
-  'A*2CT<x>_Target-specific code generation options'#010+
-  'p*3CTsmalltoc_ Generate smaller TOCs at the ex','pense of execution spe'+
-  'ed (AIX)'#010+
+  'A*2CT<x>_Target-specific code gene','ration options'#010+
+  'p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+
+  ' (AIX)'#010+
   'P*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+
   ' (AIX)'#010+
   'J*3CTautogetterprefix=X_  Automatically create getters for properties '+
+  'w','ith prefix X (empty string disables)'#010+
+  'J*3CTautosetterprefix=X_  Automatically create setters for properties '+
   'with prefix X (empty string disables)'#010+
-  'J*3CTautosetterprefix=X_','  Automatically create setters for propertie'+
-  's with prefix X (empty string disables)'#010+
   '8*3CTcld_                 Emit a CLD instruction before using the x86 '+
   'string instructions'#010+
-  '3*3CTcld_                 Emit a CLD instruction before using the ','x8'+
+  '3*3CT','cld_                 Emit a CLD instruction before using the x8'+
   '6 string instructions'#010+
   '4*3CTcld_                 Emit a CLD instruction before using the x86 '+
   'string instructions'#010+
-  '8*3CTfarprocspushoddbp_       Increment BP before pushing it in the pr'+
-  'ologue of far functions'#010+
-  'J*3CTcompactintarrayinit_ Genera','te smaller (but potentially slower) '+
-  'code for initializing integer array constants'#010+
+  '8*3CTfarprocspushoddbp_       Increment BP before pushing it in t','he '+
+  'prologue of far functions'#010+
+  'J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) co'+
+  'de for initializing integer array constants'#010+
   'J*3CTenumfieldinit_       Initialize enumeration fields in constructor'+
-  's to enumtype(0), after calling inherited constructors'#010+
-  'J*3CTinitlocals_          Initial','ize local variables that trigger a '+
-  'JVM bytecode verification error if used uninitialized (slows down code'+
-  ')'#010+
+  's to enumtype(0), after cal','ling inherited constructors'#010+
+  'J*3CTinitlocals_          Initialize local variables that trigger a JV'+
+  'M bytecode verification error if used uninitialized (slows down code)'#010+
   'J*3CTlowercaseprocstart_  Lowercase the first character of procedure/f'+
-  'unction/method names'#010+
-  'A*3CTthumbinterworking_ Generate Thumb int','erworking-safe code if pos'+
-  'sible'#010+
+  'un','ction/method names'#010+
+  'A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possi'+
+  'ble'#010+
   'J*2Cv_Var/out parameter copy-out checking'#010+
   'A*2CV<x>_Set section threadvar model to <x>'#010+
   '**2CX_Create also smartlinked library'#010+
-  '**1d<x>_Defines the symbol <x>'#010+
+  '**1d<x>_Defines the sym','bol <x>'#010+
   '**1D_Generate a DEF file'#010+
-  '**2DD<x>_Set the date string',' returned by %DATE% to x, it is not chec'+
-  'ked for being a valid date string'#010+
+  '**2DD<x>_Set the date string returned by %DATE% to x, it is not checke'+
+  'd for being a valid date string'#010+
   '**2Dd<x>_Set description to <x>'#010+
   '**2DT<x>_Set the time string returned by %TIME% to x, it is not checke'+
-  'd for being a valid time string'#010+
-  '**2Dv<x>_Set DLL version to <x>'#010,
+  'd f','or being a valid time string'#010+
+  '**2Dv<x>_Set DLL version to <x>'#010+
   '*O2Dw_PM application'#010+
   '**1e<x>_Set path to executable'#010+
   '**1E_Same as -Cn'#010+
   '**1fPIC_Same as -Cg'#010+
   '**1F<x>_Set file names and paths:'#010+
-  '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+
-  'sed'#010+
+  '**2Fa<x>[,y]_(for a program) load units <x> and [y] befo','re uses is p'+
+  'arsed'#010+
   '**2Fc<x>_Set input codepage to <x>'#010+
-  '**2FC<x>','_Set RC compiler binary name to <x>'#010+
+  '**2FC<x>_Set RC compiler binary name to <x>'#010+
   '**2Fd_Disable the compiler'#039's internal directory cache'#010+
   '**2FD<x>_Set the directory where to search for compiler utilities'#010+
-  '**2Fe<x>_Redirect error output to <x>'#010+
+  '**2Fe<x>_Redirect error',' output to <x>'#010+
   '**2FE<x>_Set exe/unit output path to <x>'#010+
-  '**2Ff','<x>_Add <x> to framework path (Darwin only), or set IDF path to'+
-  ' <x> (Xtensa-FreeRTOS)'#010+
+  '**2Ff<x>_Add <x> to framework path (Darwin only), or set IDF path to <'+
+  'x> (Xtensa-FreeRTOS)'#010+
   '**2FF_Use fpcres as RC to RES compiler instead of windres or gorc'#010+
-  '**2Fi<x>_Add <x> to include path'#010+
+  '**2Fi<x>_Add <x> to include',' path'#010+
   '**2Fl<x>_Add <x> to library path'#010+
-  '**2FL<x>_Use <x> as dy','namic linker'#010+
+  '**2FL<x>_Use <x> as dynamic linker'#010+
   '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+
   'r'#010+
   '**2FM<x>_Set the directory where to search for unicode binary files'#010+
-  '**2FN<x>_Add <x> to list of default unit scopes (namespaces)'#010+
-  '**2Fo<x>_Add <x> to object',' path'#010+
+  '**2FN<x>_Add <x> to list o','f default unit scopes (namespaces)'#010+
+  '**2Fo<x>_Add <x> to object path'#010+
   '**2Fr<x>_Load error message file <x>'#010+
   '**2FR<x>_Set resource (.res) linker to <x>'#010+
   '**2Fu<x>_Add <x> to unit path'#010+
   '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+
-  '**2FW<x>_Store generated whole-program optimization feedback in <x>'#010+
-  '**2F','w<x>_Load previously stored whole-program optimization feedback '+
-  'from <x>'#010+
+  '**2FW<x>_St','ore generated whole-program optimization feedback in <x>'#010+
+  '**2Fw<x>_Load previously stored whole-program optimization feedback fr'+
+  'om <x>'#010+
   '*g1g_Generate debug information (default format for target)'#010+
-  '*g2gc_Generate checks for pointers (experimental, only available on so'+
-  'me targets, might generate false posi','tive)'#010+
+  '*g2gc_Generate checks for pointers (experiment','al, only available on '+
+  'some targets, might generate false positive)'#010+
   '*g2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+
   '*g2gl_Use line info unit (show more info with backtraces)'#010+
-  '*g2gm_Generate Microsoft CodeView debug information (experimental)'#010+
+  '*g2gm_Generate Microsoft CodeView debug information',' (experimental)'#010+
   '*g2go<x>_Set debug information options'#010+
-  '*g3god','warfsets_ Enable DWARF '#039'set'#039' type debug information (b'+
-  'reaks gdb < 6.5)'#010+
+  '*g3godwarfsets_ Enable DWARF '#039'set'#039' type debug information (bre'+
+  'aks gdb < 6.5)'#010+
   '*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs'+
   #010+
-  '*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class n'+
-  'ame'#010+
-  '*g3godwarfcpp_ Simulate ','C++ debug information in DWARF'#010+
+  '*g3godwarfmethodclassprefix_ Prefix m','ethod names in DWARF with class'+
+  ' name'#010+
+  '*g3godwarfcpp_ Simulate C++ debug information in DWARF'#010+
   '*g3godwarfomflinnum_ Generate line number information in OMF LINNUM re'+
   'cords in MS LINK format in addition to the DWARF debug information (Op'+
-  'en Watcom Debugger/Linker compatibility)'#010+
-  '*g2gp_Preserve case in stabs',' symbol names'#010+
+  'en Watco','m Debugger/Linker compatibility)'#010+
+  '*g2gp_Preserve case in stabs symbol names'#010+
   '*g2gs_Generate Stabs debug information'#010+
   '*g2gt_Trash local variables (to detect uninitialized uses; multiple '#039+
   't'#039' changes the trashing value)'#010+
-  '*g2gv_Generates programs traceable with Valgrind'#010+
-  '*g2gw_Generate DWARFv2 debug informati','on (same as -gw2)'#010+
+  '*g2gv_Generates programs t','raceable with Valgrind'#010+
+  '*g2gw_Generate DWARFv2 debug information (same as -gw2)'#010+
   '*g2gw2_Generate DWARFv2 debug information'#010+
   '*g2gw3_Generate DWARFv3 debug information'#010+
   '*g2gw4_Generate DWARFv4 debug information (experimental)'#010+
   '**1i_Information'#010+
-  '**2iD_Return compiler date'#010+
+  '**2','iD_Return compiler date'#010+
   '**2iSO_Return compiler OS'#010+
-  '**2iSP_Retu','rn compiler host processor'#010+
+  '**2iSP_Return compiler host processor'#010+
   '**2iTO_Return target OS'#010+
   '**2iTP_Return target processor'#010+
   '**2iV_Return short compiler version'#010+
   '**2iW_Return full compiler version'#010+
-  '**2ia_Return list of supported ABI targets'#010+
-  '**2ib_Return the used code generation backen','d type'#010+
+  '**2ia_Return list of suppo','rted ABI targets'#010+
+  '**2ib_Return the used code generation backend type'#010+
   '**2ic_Return list of supported CPU instruction sets'#010+
   '**2if_Return list of supported FPU instruction sets'#010+
   '**2ii_Return list of supported inline assembler modes'#010+
-  '**2im_Return list of supported modeswitches'#010+
-  '**2io_Return list of supported ','optimizations'#010+
+  '**2im_Return l','ist of supported modeswitches'#010+
+  '**2io_Return list of supported optimizations'#010+
   '**2ir_Return list of recognized compiler and RTL features'#010+
   '**2it_Return list of supported targets'#010+
   '**2iu_Return list of supported microcontroller types'#010+
-  '**2iw_Return list of supported whole program optimizations'#010+
-  '**1I<x>_Add <x> t','o include path'#010+
+  '**2iw_Return li','st of supported whole program optimizations'#010+
+  '**1I<x>_Add <x> to include path'#010+
   '**1k<x>_Pass <x> to the linker'#010+
   '**1l_Write logo'#010+
   '**1M<x>_Set language mode to <x> / enable modeswitch <x> (see option -'+
   'im)'#010+
   '**2Mfpc_Free Pascal dialect (default)'#010+
-  '**2Mobjfpc_FPC mode with Object Pascal support'#010+
-  '**2Mdelphi_Delphi 7',' compatibility mode'#010+
+  '**2Mo','bjfpc_FPC mode with Object Pascal support'#010+
+  '**2Mdelphi_Delphi 7 compatibility mode'#010+
   '**2Mtp_TP/BP 7.0 compatibility mode'#010+
   '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
   '**2Miso_ISO 7185 mode'#010+
   '**2Mextendedpascal_ISO 10206 mode'#010+
-  '**2Mdelphiunicode_Delphi 2009 and later compatibility mode'#010+
-  '**2*_Each mod','e (as listed above) enables its default set of modeswit'+
-  'ches.'#010+
+  '**2Mdelphiu','nicode_Delphi 2009 and later compatibility mode'#010+
+  '**2*_Each mode (as listed above) enables its default set of modeswitch'+
+  'es.'#010+
   '**2*_Other modeswitches are disabled and need to be enabled one by ano'+
   'ther.'#010+
-  '**1M<x>-_Disable modeswitch <x> (see option -im)'#010+
+  '**1M<x>-_Disable modeswitch <x> (see optio','n -im)'#010+
   '**1n_Do not read the default config files'#010+
-  '**1o<x>_Chan','ge the name of the executable produced to <x>'#010+
+  '**1o<x>_Change the name of the executable produced to <x>'#010+
   '**1O<x>_Optimizations:'#010+
   '**2O-_Disable optimizations'#010+
   '**2O1_Level 1 optimizations (quick and debugger friendly)'#010+
-  '**2O2_Level 2 optimizations (-O1 + quick optimizations)'#010+
-  '**2O3_Level 3 optimizations (','-O2 + slow optimizations)'#010+
+  '**2O2_Level 2 optimizati','ons (-O1 + quick optimizations)'#010+
+  '**2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+
   '**2O4_Level 4 optimizations (-O3 + optimizations which might have unex'+
   'pected side effects)'#010+
   '**2Oa<x>=<y>_Set alignment'#010+
-  '**2Oo[NO]<x>_Enable or disable optimizations; see fpc -i or fpc -io fo'+
-  'r possible values'#010+
-  '**2Op<x>','_Set target cpu for optimizing; see fpc -i or fpc -ic for po'+
-  'ssible values'#010+
+  '**2Oo[NO]<x>_Enable or disable opti','mizations; see fpc -i or fpc -io '+
+  'for possible values'#010+
+  '**2Op<x>_Set target cpu for optimizing; see fpc -i or fpc -ic for poss'+
+  'ible values'#010+
   '**2OW<x>_Generate whole-program optimization feedback for optimization'+
-  ' <x>; see fpc -i or fpc -iw for possible values'#010+
-  '**2Ow<x>_Perform whole-program optimization <x>;',' see fpc -i or fpc -'+
-  'iw for possible values'#010+
+  ' <x>; see fpc -i or fpc -iw for pos','sible values'#010+
+  '**2Ow<x>_Perform whole-program optimization <x>; see fpc -i or fpc -iw'+
+  ' for possible values'#010+
   '**2Os_Optimize for size rather than speed'#010+
   '**1pg_Generate profile code for gprof (defines FPC_PROFILE)'#010+
-  'F*1P<x>_Target CPU / compiler related options:'#010+
+  'F*1P<x>_Target CPU / compiler rela','ted options:'#010+
   'F*2PB_Show default compiler binary'#010+
-  'F*2PP_Show de','fault target cpu'#010+
+  'F*2PP_Show default target cpu'#010+
   'F*2P<x>_Set target CPU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipse'+
   'l,powerpc,powerpc64,sparc,x86_64)'#010+
   '**1R<x>_Assembler reading style:'#010+
-  '**2Rdefault_Use default assembler for target'#010+
+  '**2Rdefault_Use default a','ssembler for target'#010+
   '3*2Ratt_Read AT&T style assembler'#010+
-  '3*2Rint','el_Read Intel style assembler'#010+
+  '3*2Rintel_Read Intel style assembler'#010+
   '4*2Ratt_Read AT&T style assembler'#010+
   '4*2Rintel_Read Intel style assembler'#010+
   '8*2Ratt_Read AT&T style assembler'#010+
   '8*2Rintel_Read Intel style assembler'#010+
-  '6*2RMOT_Read Motorola style assembler'#010+
+  '6*2RMOT','_Read Motorola style assembler'#010+
   '**1S<x>_Syntax options:'#010+
-  '**2S2_','Same as -Mobjfpc'#010+
+  '**2S2_Same as -Mobjfpc'#010+
   '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+
   '**2Sa_Turn on assertions'#010+
   '**2Sd_Same as -Mdelphi'#010+
   '**2Se<x>_Error options. <x> is a combination of the following:'#010+
-  '**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
-  '*','*3*_w : Compiler also halts after warnings'#010+
+  '**','3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
+  '**3*_w : Compiler also halts after warnings'#010+
   '**3*_n : Compiler also halts after notes'#010+
   '**3*_h : Compiler also halts after hints'#010+
-  '**2Sf_Enable certain features in compiler and RTL; see fpc -i or fpc -'+
-  'ir for possible values)'#010+
-  '**2Sg_Enable LABEL an','d GOTO (default in -Mtp and -Mdelphi)'#010+
+  '**2Sf_Enable certain features in compiler and RTL; see',' fpc -i or fpc'+
+  ' -ir for possible values)'#010+
+  '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)'#010+
   '**2Sh_Use reference counted strings (ansistring by default) instead of'+
   ' shortstrings'#010+
-  '**2Si_Turn on inlining of procedures/functions declared as "inline"'#010+
-  '**2Sj_Allows typed constants to be writeable (defa','ult in all modes)'#010+
+  '**2Si_Turn on inlining of procedures/functions declared a','s "inline"'#010+
+  '**2Sj_Allows typed constants to be writeable (default in all modes)'#010+
   '**2Sk_Load fpcylix unit'#010+
   '**2SI<x>_Set interface style to <x>'#010+
   '**3SIcom_COM compatible interface (default)'#010+
   '**3SIcorba_CORBA compatible interface'#010+
-  '**2Sm_Support macros like C (global)'#010+
+  '**2Sm_Support macro','s like C (global)'#010+
   '**2So_Same as -Mtp'#010+
-  '**2Sr_Transparent file n','ames in ISO mode'#010+
+  '**2Sr_Transparent file names in ISO mode'#010+
   '**2Ss_Constructor name must be init (destructor must be done)'#010+
   '**2Sv_Support vector processing (use CPU vector extensions if availabl'+
   'e)'#010+
-  '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
-  '**2Sy_@<pointer> return','s a typed pointer, same as $T+'#010+
+  '**2Sx_Enable exception keyw','ords (default in Delphi/ObjFPC modes)'#010+
+  '**2Sy_@<pointer> returns a typed pointer, same as $T+'#010+
   '**1s_Do not call assembler and linker'#010+
   '**2sh_Generate script to link on host'#010+
   '**2st_Generate script to link on target'#010+
-  '**2sr_Skip register allocation phase (use with -alr)'#010+
+  '**2sr_Skip register allocation p','hase (use with -alr)'#010+
   '**1T<x>_Target operating system:'#010+
-  '3*2Tand','roid_Android'#010+
+  '3*2Tandroid_Android'#010+
   '3*2Taros_AROS'#010+
   '3*2Tbeos_BeOS'#010+
   '3*2Tdarwin_Darwin/Mac OS X'#010+
   '3*2Tembedded_Embedded'#010+
   '3*2Temx_OS/2 via EMX (including EMX/RSX extender)'#010+
   '3*2Tfreebsd_FreeBSD'#010+
-  '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+
+  '3*2Tgo32v2_Version ','2 of DJ Delorie DOS extender'#010+
   '3*2Thaiku_Haiku'#010+
-  '3*2Tiphonesim_iP','honeSimulator from iOS SDK 3.2+ (older versions: -Td'+
-  'arwin)'#010+
+  '3*2Tiphonesim_iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tdar'+
+  'win)'#010+
   '3*2Tlinux_Linux'#010+
   '3*2Tnativent_Native NT API (experimental)'#010+
   '3*2Tnetbsd_NetBSD'#010+
   '3*2Tnetware_Novell Netware Module (clib)'#010+
-  '3*2Tnetwlibc_Novell Netware Module (libc)'#010+
+  '3*2','Tnetwlibc_Novell Netware Module (libc)'#010+
   '3*2Topenbsd_OpenBSD'#010+
-  '3*','2Tos2_OS/2 / eComStation'#010+
+  '3*2Tos2_OS/2 / eComStation'#010+
   '3*2Tsymbian_Symbian OS'#010+
   '3*2Tsolaris_Solaris'#010+
   '3*2Twatcom_Watcom compatible DOS extender'#010+
   '3*2Twdosx_WDOSX DOS extender'#010+
   '3*2Twin32_Windows 32 Bit'#010+
-  '3*2Twince_Windows CE'#010+
+  '3*2Twince_Windo','ws CE'#010+
   '4*2Tandroid_Android'#010+
   '4*2Taros_AROS'#010+
-  '4*2Tdarwin_Darwin/Mac',' OS X'#010+
+  '4*2Tdarwin_Darwin/Mac OS X'#010+
   '4*2Tdragonfly_DragonFly BSD'#010+
   '4*2Tembedded_Embedded'#010+
   '4*2Tfreebsd_FreeBSD'#010+
@@ -1786,19 +1786,19 @@ const msgtxt : array[0..000360,1..240] of char=(
   '4*2Tlinux_Linux'#010+
   '4*2Tnetbsd_NetBSD'#010+
   '4*2Topenbsd_OpenBSD'#010+
-  '4*2Tsolaris_Solaris'#010+
+  '4*2','Tsolaris_Solaris'#010+
   '4*2Twin64_Win64 (64 bit Windows systems)'#010+
-  '6*2','Tamiga_Commodore Amiga'#010+
+  '6*2Tamiga_Commodore Amiga'#010+
   '6*2Tatari_Atari ST/STe/TT'#010+
   '6*2Tembedded_Embedded'#010+
   '6*2Tlinux_Linux'#010+
   '6*2Tnetbsd_NetBSD'#010+
   '6*2Tmacosclassic_Classic Mac OS'#010+
   '6*2Tpalmos_PalmOS'#010+
-  '6*2Tql_Sinclair QL'#010+
+  '6*2Tsinclairql_Sinclair ','QL'#010+
   '8*2Tembedded_Embedded'#010+
   '8*2Tmsdos_MS-DOS (and compatible)'#010+
-  '8*2Twin16_','Windows 16 Bit'#010+
+  '8*2Twin16_Windows 16 Bit'#010+
   'A*2Tandroid_Android'#010+
   'A*2Taros_AROS'#010+
   'A*2Tembedded_Embedded'#010+
@@ -1807,10 +1807,10 @@ const msgtxt : array[0..000360,1..240] of char=(
   'A*2Tios_iOS'#010+
   'A*2Tlinux_Linux'#010+
   'A*2Tnds_Nintendo DS'#010+
-  'A*2Tnetbsd_NetBSD'#010+
+  'A*2Tn','etbsd_NetBSD'#010+
   'A*2Tpalmos_PalmOS'#010+
   'A*2Tsymbian_Symbian'#010+
-  'A*2Twince_Windows ','CE'#010+
+  'A*2Twince_Windows CE'#010+
   'a*2Tandroid_Android'#010+
   'a*2Tdarwin_Darwin/Mac OS X'#010+
   'a*2Tios_iOS'#010+
@@ -1819,11 +1819,11 @@ const msgtxt : array[0..000360,1..240] of char=(
   'J*2Tandroid_Android'#010+
   'J*2Tjava_Java'#010+
   'm*2Tandroid_Android'#010+
-  'm*2Tembedded_Embedded'#010+
+  'm*2Tembedded_Embed','ded'#010+
   'm*2Tlinux_Linux'#010+
   'M*2Tembedded_Embedded'#010+
   'M*2Tlinux_Linux'#010+
-  'P*2Taix_AIX',#010+
+  'P*2Taix_AIX'#010+
   'P*2Tamiga_AmigaOS'#010+
   'P*2Tdarwin_Darwin/Mac OS X'#010+
   'P*2Tembedded_Embedded'#010+
@@ -1832,10 +1832,10 @@ const msgtxt : array[0..000360,1..240] of char=(
   'P*2Tmorphos_MorphOS'#010+
   'P*2Tnetbsd_NetBSD'#010+
   'P*2Twii_Wii'#010+
-  'p*2Taix_AIX'#010+
+  'p*2Ta','ix_AIX'#010+
   'p*2Tdarwin_Darwin/Mac OS X'#010+
   'p*2Tembedded_Embedded'#010+
-  'p*2Tlinux_Lin','ux'#010+
+  'p*2Tlinux_Linux'#010+
   'R*2Tlinux_Linux'#010+
   'R*2Tembedded_Embedded'#010+
   'r*2Tlinux_Linux'#010+
@@ -1844,158 +1844,159 @@ const msgtxt : array[0..000360,1..240] of char=(
   'S*2Tsolaris_Solaris'#010+
   's*2Tlinux_Linux'#010+
   'V*2Tembedded_Embedded'#010+
-  'x*2Tembedded_Embedded'#010+
+  'x*2Tembedded_Embed','ded'#010+
   'x*2Tfreertos_FreeRTOS'#010+
   'x*2Tlinux_Linux'#010+
   'Z*2Tembedded_Embedded'#010+
-  'Z*2Tz','xspectrum_ZX Spectrum'#010+
+  'Z*2Tzxspectrum_ZX Spectrum'#010+
   'Z*2Tmsxdos_MSX-DOS'#010+
   '**1u<x>_Undefines the symbol <x>'#010+
   '**1U_Unit options:'#010+
   '**2Un_Do not check where the unit name matches the file name'#010+
-  '**2Ur_Generate release unit files (never automatically recompiled)'#010+
-  '**2Us_Compile a sys','tem unit'#010+
+  '**2Ur_Generate re','lease unit files (never automatically recompiled)'#010+
+  '**2Us_Compile a system unit'#010+
   '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
   '**2*_e : Show errors (default)       0 : Show nothing (except errors)'#010+
-  '**2*_w : Show warnings               u : Show unit info'#010+
-  '**2*_n : Show notes                  t',' : Show tried/used files'#010+
+  '**2*_w : Show warnings   ','            u : Show unit info'#010+
+  '**2*_n : Show notes                  t : Show tried/used files'#010+
   '**2*_h : Show hints                  c : Show conditionals'#010+
   '**2*_i : Show general info           d : Show debug info'#010+
-  '**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode'#010+
-  '**2*_s : Show time stamps    ','        q : Show message numbers'#010+
+  '**2*_l : Show linenumbers     ','       r : Rhide/GCC compatibility mod'+
+  'e'#010+
+  '**2*_s : Show time stamps            q : Show message numbers'#010+
   '**2*_a : Show everything             x : Show info about invoked tools'+
   #010+
-  '**2*_b : Write file names messages   p : Write tree.log with parse tre'+
-  'e'#010+
-  '**2*_    with full path              v : Write fpcdebug.txt with',#010+
+  '**2*_b : Write file names messages   p : Write tree.log with parse ','t'+
+  'ree'#010+
+  '**2*_    with full path              v : Write fpcdebug.txt with'#010+
   '**2*_z : Write output to stderr          lots of debugging info'#010+
   '**2*_m<x>,<y> : Do not show messages numbered <x> and <y>'#010+
-  'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g. f'+
-  'or version)'#010+
+  'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binar','y name (e.g.'+
+  ' for version)'#010+
   '**1W<x>_Target-specific options (targets)'#010+
-  '3','*2WA_Specify native type application (Windows)'#010+
+  '3*2WA_Specify native type application (Windows)'#010+
   '4*2WA_Specify native type application (Windows)'#010+
   'A*2WA_Specify native type application (Windows)'#010+
-  '3*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'P*2Wb_Create a bundle instead of a library (D','arwin)'#010+
+  '3*2Wb_Create a bundle instea','d of a library (Darwin)'#010+
+  'P*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'p*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'a*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'A*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  '4*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  '3*2WB_Create a relocatabl','e image (Windows, Symbian)'#010+
+  '4*2Wb_Cr','eate a bundle instead of a library (Darwin)'#010+
+  '3*2WB_Create a relocatable image (Windows, Symbian)'#010+
   '3*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+
   '4*2WB_Create a relocatable image (Windows)'#010+
   '4*2WB<x>_Set image base to <x> (Windows)'#010+
-  'A*2WB_Create a relocatable image (Windows, Symbian)'#010+
-  'A*2WB<x>_Set image base to ','<x> (Windows, Symbian)'#010+
+  'A*2WB_Crea','te a relocatable image (Windows, Symbian)'#010+
+  'A*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+
   'Z*2WB<x>_Set image base to <x> (ZX Spectrum)'#010+
   '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
-  '4*2WC_Specify console type application (Windows)'#010+
+  '4*2WC_Specify console type application (Win','dows)'#010+
   'A*2WC_Specify console type application (Windows)'#010+
-  'P*2WC_Specify ','console type application (Classic Mac OS)'#010+
+  'P*2WC_Specify console type application (Classic Mac OS)'#010+
   '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   '4*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
-  'A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
-  '3*2We_Use ex','ternal resources (Darwin)'#010+
+  'A*2WD','_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
+  '3*2We_Use external resources (Darwin)'#010+
   '4*2We_Use external resources (Darwin)'#010+
   'a*2We_Use external resources (Darwin)'#010+
   'A*2We_Use external resources (Darwin)'#010+
-  'P*2We_Use external resources (Darwin)'#010+
+  'P*2We_Use external resources (D','arwin)'#010+
   'p*2We_Use external resources (Darwin)'#010+
-  '3*2WF_Specify full-scree','n type application (EMX, OS/2)'#010+
+  '3*2WF_Specify full-screen type application (EMX, OS/2)'#010+
   '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
   '4*2WG_Specify graphic type application (Windows)'#010+
-  'A*2WG_Specify graphic type application (Windows)'#010+
-  'P*2WG_Specify graphic type application (Classic Mac',' OS)'#010+
+  'A*2WG_Specify graphic type appl','ication (Windows)'#010+
+  'P*2WG_Specify graphic type application (Classic Mac OS)'#010+
   '3*2Wi_Use internal resources (Darwin)'#010+
   '4*2Wi_Use internal resources (Darwin)'#010+
   'a*2Wi_Use internal resources (Darwin)'#010+
   'A*2Wi_Use internal resources (Darwin)'#010+
-  'P*2Wi_Use internal resources (Darwin)'#010+
+  'P*2Wi_Use inte','rnal resources (Darwin)'#010+
   'p*2Wi_Use internal resources (Darwin)'#010+
-  '3*2WI_T','urn on/off the usage of import sections (Windows)'#010+
+  '3*2WI_Turn on/off the usage of import sections (Windows)'#010+
   '4*2WI_Turn on/off the usage of import sections (Windows)'#010+
   'A*2WI_Turn on/off the usage of import sections (Windows)'#010+
-  '8*2Wh_Use huge code for units (ignored for models with CODE in a uniqu'+
-  'e segm','ent)'#010+
+  '8*2Wh_U','se huge code for units (ignored for models with CODE in a uni'+
+  'que segment)'#010+
   '8*2Wm<x>_Set memory model'#010+
   '8*3WmTiny_Tiny memory model'#010+
   '8*3WmSmall_Small memory model (default)'#010+
   '8*3WmMedium_Medium memory model'#010+
   '8*3WmCompact_Compact memory model'#010+
-  '8*3WmLarge_Large memory model'#010+
+  '8*3WmL','arge_Large memory model'#010+
   '8*3WmHuge_Huge memory model'#010+
-  '3*2WM<x>_Minimum ','Mac OS X deployment version: 10.4, 10.5.1, ... (Dar'+
-  'win)'#010+
-  '4*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
+  '3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'n)'#010+
-  'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
+  '4*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'n)'#010+
-  'P*2WM<x>_Minimum Mac OS X deployment v','ersion: 10.4, 10.5.1, ... (Dar'+
+  'p*2WM<x>_Minimum Mac OS X deployment versi','on: 10.4, 10.5.1, ... (Dar'+
   'win)'#010+
+  'P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
+  'n)'#010+
   '3*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  '4*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  'A*2WN_Do not generate relocation code, needed for debugging (Wind','ows'+
+  '4*2WN_Do not generate relocation code, needed for debugging (Windo','ws'+
   ')'#010+
+  'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   'A*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
   'le values'#010+
   'm*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
   'le values'#010+
-  'R*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
-  'le va','lues'#010+
+  'R*2Wp<','x>_Specify the controller type; see fpc -i or fpc -iu for poss'+
+  'ible values'#010+
   'V*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
   'le values'#010+
   'x*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
   'le values'#010+
-  '3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'#010+
-  '4*2WP<','x>_Minimum iOS deployment version: 8.0, 8.0.2, ... (iphonesim)'+
+  '3*2WP<','x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'+
   #010+
+  '4*2WP<x>_Minimum iOS deployment version: 8.0, 8.0.2, ... (iphonesim)'#010+
   'a*2WP<x>_Minimum iOS deployment version: 7.0, 7.1.2, ... (Darwin)'#010+
-  'A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)'#010+
+  'A*2WP<x>_Minimum iOS deployment version: 3','.0, 5.0.1, ... (Darwin)'#010+
   '3*2WR_Generate relocation code (Windows)'#010+
-  '4*2W','R_Generate relocation code (Windows)'#010+
+  '4*2WR_Generate relocation code (Windows)'#010+
   'A*2WR_Generate relocation code (Windows)'#010+
   '8*2Wt<x>_Set the target executable format'#010+
   '8*3Wtexe_Create a DOS .EXE file (default)'#010+
-  '8*3Wtcom_Create a DOS .COM file (requires tiny memory model)'#010+
-  'P*2WT_Specify MPW',' tool type application (Classic Mac OS)'#010+
+  '8*3Wtcom_','Create a DOS .COM file (requires tiny memory model)'#010+
+  'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**1X_Executable options:'#010+
-  '**2X9_Generate linkerscript for GNU Binutils ld older than version 2.1'+
-  '9.1 (Linux)'#010+
-  '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwi','n, FreeBSD, L'+
-  'inux)'#010+
+  '**2X9_Generate linkerscript for GNU Binutils ld older than version 2','.'+
+  '19.1 (Linux)'#010+
+  '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
+  'ux)'#010+
   '**2Xd_Do not search default library path (sometimes required for cross'+
   '-compiling when not using -XR)'#010+
   '**2Xe_Use external linker'#010+
-  '**2Xf_Substitute pthread library name for linking (BSD)'#010+
-  '**2Xg_Create debuginfo in a separate f','ile and add a debuglink sectio'+
-  'n to executable'#010+
+  '**2Xf_Substitute pthread ','library name for linking (BSD)'#010+
+  '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
+  'to executable'#010+
   '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
   '**2Xi_Use internal linker'#010+
-  'L*2XlS<x>_LLVM utilties suffix (e.g. -7 in case clang is called clang-'+
-  '7)'#010+
-  '**2XLA_Define library subst','itutions for linking'#010+
+  'L*2XlS<x>_LLVM utilties suffix ','(e.g. -7 in case clang is called clan'+
+  'g-7)'#010+
+  '**2XLA_Define library substitutions for linking'#010+
   '**2XLO_Define order of library linking'#010+
   '**2XLD_Exclude default order of standard libraries'#010+
   '**2Xm_Generate link map'#010+
-  '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
-  's '#039'main'#039')'#010+
-  '**2Xn_Use target system native li','nker instead of GNU ld (Solaris, AI'+
-  'X)'#010+
+  '**2XM<x>_Set the name of the '#039'main'#039' ','program routine (default'+
+  ' is '#039'main'#039')'#010+
+  '**2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)'+
+  #010+
   'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+
   '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
-  '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+
-  'ile, see the ','ld manual for more information) (BeOS, Linux)'#010+
+  '**2Xr<x>_S','et the linker'#039's rlink-path to <x> (needed for cross co'+
+  'mpile, see the ld manual for more information) (BeOS, Linux)'#010+
   '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
   ', Linux, Mac OS, Solaris)'#010+
-  '**2Xs_Strip all symbols from executable'#010+
-  '**2XS_Try to link units statically (default, defines FPC_L','INK_STATIC'+
-  ')'#010+
+  '**2Xs_Strip all symbols from ','executable'#010+
+  '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
   '**2Xv_Generate table for Virtual Entry calls'#010+
-  '**2XV_Use VLink as external linker       (default on Amiga, MorphOS)'#010+
-  '**2XX_Try to smartlink units             (defines F','PC_LINK_SMART)'#010+
+  '**2XV_Use VLink as external linker       (default o','n Amiga, MorphOS)'+
+  #010+
+  '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
   '**1*_'#010+
   '**1?_Show this help'#010+
   '**1h_Shows this help without waiting'

+ 27 - 33
compiler/nadd.pas

@@ -490,7 +490,7 @@ implementation
 
 
       var
-        t,vl,hp,lefttarget,righttarget: tnode;
+        t,vl,hp,lefttarget,righttarget, hp2: tnode;
         lt,rt   : tnodetype;
         hdef,
         rd,ld   , inttype: tdef;
@@ -793,7 +793,11 @@ implementation
                           { keep the order of val+const else pointer operations might cause an error }
                           hp:=taddnode(left).left;
                           taddnode(left).left:=right;
-                          left:=left.simplify(forinline);
+                          left.resultdef:=nil;
+                          do_typecheckpass(left);
+                          hp2:=left.simplify(forinline);
+                          if assigned(hp2) then
+                            left:=hp2;
                           if resultdef.typ<>pointerdef then
                             begin
                               { ensure that the constant is not expanded to a larger type due to overflow,
@@ -1427,37 +1431,27 @@ implementation
                        end;
                      if v1p^.resultdef.size=v2p^.resultdef.size then
                        begin
-                         if not(is_integer(v1p^.resultdef)) or not(is_integer(v2p^.resultdef)) then
-                           begin
-                             case v1p^.resultdef.size of
-                               1:
-                                 inttype:=u8inttype;
-                               2:
-                                 inttype:=u16inttype;
-                               4:
-                                 inttype:=u32inttype;
-                               8:
-                                 inttype:=u64inttype;
-                               else
-                                 Internalerror(2020060101);
-                             end;
-
-                             result:=caddnode.create_internal(equaln,
-                               caddnode.create_internal(orn,
-                                 caddnode.create_internal(xorn,ctypeconvnode.create_internal(v1p^.getcopy,inttype),
-                                   ctypeconvnode.create_internal(c1p^.getcopy,inttype)),
-                                 caddnode.create_internal(xorn,ctypeconvnode.create_internal(v2p^.getcopy,inttype),
-                                   ctypeconvnode.create_internal(c2p^.getcopy,inttype))
-                               ),
-                               cordconstnode.create(0,inttype,false));
-                           end
-                         else
-                           result:=caddnode.create_internal(equaln,
-                             caddnode.create_internal(orn,
-                               caddnode.create_internal(xorn,v1p^.getcopy,c1p^.getcopy),
-                               caddnode.create_internal(xorn,v2p^.getcopy,c2p^.getcopy)
-                             ),
-                             cordconstnode.create(0,v1p^.resultdef,false));
+                         case v1p^.resultdef.size of
+                           1:
+                             inttype:=u8inttype;
+                           2:
+                             inttype:=u16inttype;
+                           4:
+                             inttype:=u32inttype;
+                           8:
+                             inttype:=u64inttype;
+                           else
+                             Internalerror(2020060101);
+                         end;
+
+                         result:=caddnode.create_internal(equaln,
+                           caddnode.create_internal(orn,
+                             caddnode.create_internal(xorn,ctypeconvnode.create_internal(v1p^.getcopy,inttype),
+                               ctypeconvnode.create_internal(c1p^.getcopy,inttype)),
+                             caddnode.create_internal(xorn,ctypeconvnode.create_internal(v2p^.getcopy,inttype),
+                               ctypeconvnode.create_internal(c2p^.getcopy,inttype))
+                           ),
+                           cordconstnode.create(0,inttype,false));
                        end;
                    end;
                 { even when short circuit boolean evaluation is active, this

+ 6 - 0
compiler/nbas.pas

@@ -1381,6 +1381,12 @@ implementation
         if assigned(tempinfo^.tempinitcode) then
           firstpass(tempinfo^.tempinitcode);
         inc(current_procinfo.estimatedtempsize,size);
+        { if a temp. create node is loaded from a ppu, it could be that the unit was compiled with other settings which
+          enabled a certain type to be stored in a register while the current settings do not support this, so correct this here
+          if needed
+        }
+        if not(tstoreddef(tempinfo^.typedef).is_fpuregable) and not(tstoreddef(tempinfo^.typedef).is_intregable) and (ti_may_be_in_reg in tempflags) then
+          excludetempflag(ti_may_be_in_reg);
       end;
 
 

+ 5 - 2
compiler/ncnv.pas

@@ -4117,7 +4117,9 @@ implementation
 
     function ttypeconvnode.retains_value_location:boolean;
       begin
-        result:=(convtype=tc_equal) or
+        result:=assigned(left.resultdef) and
+                (
+                (convtype=tc_equal) or
                 { typecasting from void is always allowed }
                 is_void(left.resultdef) or
                 (left.resultdef.typ=formaldef) or
@@ -4139,7 +4141,8 @@ implementation
                 { on managed platforms, converting an element to an open array
                   involves creating an actual array -> value location changes }
                 ((convtype=tc_elem_2_openarray) and
-                 not(target_info.system in systems_managed_vm));
+                 not(target_info.system in systems_managed_vm))
+                );
       end;
 
 

+ 2 - 1
compiler/ncon.pas

@@ -674,9 +674,10 @@ implementation
       end;
 
 
-        procedure tordconstnode.printnodedata(var t: text);
+    procedure tordconstnode.printnodedata(var t: text);
       begin
         inherited printnodedata(t);
+        writeln(t,printnodeindention,'typedef = "',typedef.GetTypeName,'"');
         writeln(t,printnodeindention,'value = ',tostr(value));
       end;
 

+ 8 - 3
compiler/nflw.pas

@@ -985,9 +985,14 @@ implementation
                         typecheckpass(expr);
                       end;
                     case expr.resultdef.typ of
-                      stringdef: result:=create_string_for_in_loop(hloopvar, hloopbody, expr);
-                      arraydef: result:=create_array_for_in_loop(hloopvar, hloopbody, expr);
-                      setdef: result:=create_set_for_in_loop(hloopvar, hloopbody, expr);
+                      stringdef:
+                        result:=create_string_for_in_loop(hloopvar, hloopbody, expr);
+                      arraydef:
+                        result:=create_array_for_in_loop(hloopvar, hloopbody, expr);
+                      setdef:
+                        result:=create_set_for_in_loop(hloopvar, hloopbody, expr);
+                      undefineddef:
+                        result:=cnothingnode.create;
                     else
                       begin
                         result:=cerrornode.create;

+ 25 - 5
compiler/options.pas

@@ -1863,7 +1863,11 @@ begin
                          if UnsetBool(More, j, opt, false) then
                            exclude(init_settings.globalswitches,cs_use_heaptrc)
                          else
-                           include(init_settings.globalswitches,cs_use_heaptrc);
+                           begin
+                             if cs_gdb_valgrind in init_settings.globalswitches then
+                               Message2(option_valgrind_heaptrc_mismatch,'-gh', '-gv');
+                             include(init_settings.globalswitches,cs_use_heaptrc);
+                           end;
                        end;
                      'l' :
                        begin
@@ -1905,7 +1909,11 @@ begin
                          if UnsetBool(More, j, opt, false) then
                            exclude(init_settings.globalswitches,cs_gdb_valgrind)
                          else
-                           include(init_settings.globalswitches,cs_gdb_valgrind);
+                           begin
+                             if cs_use_heaptrc in init_settings.globalswitches then
+                               Message2(option_valgrind_heaptrc_mismatch,'-gh', '-gv');
+                             include(init_settings.globalswitches,cs_gdb_valgrind);
+                           end;
                        end;
                      'w' :
                        begin
@@ -3402,9 +3410,8 @@ begin
     features:=features+target_unsup_features;
 
 {$if defined(atari) or defined(hasamiga)}
-   { enable vlink as default linker on Atari, Amiga, and MorphOS, but not for cross compilers (for now) }
-   if (target_info.system in [system_m68k_amiga,system_m68k_atari,
-                              system_powerpc_amiga]) and
+   { enable vlink as default linker on Atari and Amiga but not for cross compilers (for now) }
+   if (target_info.system in [system_m68k_amiga,system_m68k_atari,system_powerpc_amiga]) and
       not LinkerSetExplicitly then
      include(init_settings.globalswitches,cs_link_vlink);
 {$endif}
@@ -4309,6 +4316,14 @@ begin
 {$endif cpufpemu}
 
 {$ifdef i386}
+  if target_info.system in systems_i386_default_486 then
+    begin
+      { Avoid use of MMX/CMOVcc instructions on older systems.
+        Some systems might not handle these instructions correctly,
+        Used emulators might also be problematic. PM }
+      if not option.CPUSetExplicitly then
+        init_settings.cputype:=cpu_486;
+    end;
   case target_info.system of
     system_i386_android:
       begin
@@ -4516,6 +4531,11 @@ begin
             init_settings.fputype:=fpu_68881;
           end;
       end;
+    system_m68k_sinclairql:
+      begin
+        if not option.CPUSetExplicitly then
+          init_settings.cputype:=cpu_mc68000;
+      end;
     system_m68k_palmos:
       begin
         if not option.CPUSetExplicitly then

+ 5 - 0
compiler/pdecsub.pas

@@ -535,6 +535,7 @@ implementation
         procstartfilepos : tfileposinfo;
         i,
         index : longint;
+        addgendummy,
         hadspecialize,
         firstpart,
         found,
@@ -867,6 +868,7 @@ implementation
         srsym:=nil;
         genericparams:=nil;
         hadspecialize:=false;
+        addgendummy:=false;
 
         if not assigned(genericdef) then
           begin
@@ -1071,6 +1073,7 @@ implementation
                                as if nothing happened }
                              hidesym(srsym);
                              searchagain:=true;
+                             addgendummy:=true;
                            end
                          else
                           begin
@@ -1106,6 +1109,8 @@ implementation
                   aprocsym:=cprocsym.create('$'+lower(sp))
                 else
                   aprocsym:=cprocsym.create(orgsp);
+                if addgendummy then
+                  include(aprocsym.symoptions,sp_generic_dummy);
                 symtablestack.top.insert(aprocsym);
               end;
           end;

+ 3 - 3
compiler/pmodules.pas

@@ -327,6 +327,9 @@ implementation
            { Heaptrc unit, load heaptrace before any other units especially objpas }
            if (cs_use_heaptrc in current_settings.globalswitches) then
              AddUnit('heaptrc');
+           { Valgrind requires c memory manager }
+           if (cs_gdb_valgrind in current_settings.globalswitches) then
+             AddUnit('cmem');
            { Lineinfo unit }
            if (cs_use_lineinfo in current_settings.globalswitches) then begin
              case target_dbg.id of
@@ -338,9 +341,6 @@ implementation
                  AddUnit('lnfodwrf');
              end;
            end;
-           { Valgrind requires c memory manager }
-           if (cs_gdb_valgrind in current_settings.globalswitches) then
-             AddUnit('cmem');
 {$ifdef cpufpemu}
            { Floating point emulation unit?
              softfpu must be in the system unit anyways (FK)

+ 7 - 7
compiler/systems.pas

@@ -347,13 +347,13 @@ interface
        { all native nt systems }
        systems_nativent = [system_i386_nativent];
 
-       { all i386 systems for which cmov instructions for alignment should not be used.
-         This is a problem for several emulators }
-       systems_i386_no_cmov_align = [system_i386_go32v2,
-                                     system_i386_watcom, system_i386_wdosx,
-                                     system_i386_os2, system_i386_emx,
-                                     system_i386_beos, system_i386_haiku,
-                                     system_i386_solaris];
+       { Default to i80846 instead of pentium2 for all old i386 systems for which
+         some newer instructions (like CMOVcc or PREFECTXXX) lead to troubles,
+         related to OS or emulator lack of support. }
+       systems_i386_default_486 = [system_i386_go32v2, system_i386_watcom,
+                                   system_i386_emx, system_i386_wdosx, 
+                                   system_i386_beos, system_i386_netware,
+                                   system_i386_netwlibc, system_i386_symbian];
 
        { systems supporting Objective-C }
        systems_objc_supported = systems_darwin;

+ 3 - 3
compiler/systems/i_macos.pas

@@ -129,9 +129,9 @@ unit i_macos;
             dirsep       : ':';
             assem        : as_gas;
             assemextern  : as_gas;
-            link         : ld_none;
-            linkextern   : ld_none;
-            ar           : ar_gnu_ar;
+            link         : ld_mpw;
+            linkextern   : ld_mpw;
+            ar           : ar_mpw_ar;
             res          : res_none;
             dbg          : dbg_stabs;
             script       : script_mpw;

+ 5 - 5
compiler/systems/i_sinclairql.pas

@@ -33,7 +33,7 @@ unit i_sinclairql;
           (
             system       : system_m68k_sinclairql;
             name         : 'Sinclair QL';
-            shortname    : 'ql';
+            shortname    : 'sinclairql';
             flags        : [tf_use_8_3,tf_requires_proper_alignment,
                             tf_smartlink_sections,tf_under_development];
             cpu          : cpu_m68k;
@@ -60,10 +60,10 @@ unit i_sinclairql;
             importlibprefix : 'libimp';
             importlibext : '.a';
             Cprefix      : '_';
-            newline      : #13#10;
+            newline      : #10;
             dirsep       : '/'; { ... the underlying tools (binutils/vlink/vasm) prefer Unix paths }
-            assem        : as_m68k_as_aout;
-            assemextern  : as_m68k_as_aout;
+            assem        : as_m68k_vasm;
+            assemextern  : as_m68k_vasm;
             link         : ld_none;
             linkextern   : ld_sinclairql;
             ar           : ar_gnu_ar;
@@ -90,7 +90,7 @@ unit i_sinclairql;
                 maxCrecordalign : 4
               );
             first_parm_offset : 8;
-            stacksize    : 16384;
+            stacksize    : 8192;
             stackalign   : 2;
             abi : abi_default;
             llvmdatalayout : 'todo';

+ 16 - 761
compiler/systems/t_linux.pas

@@ -686,768 +686,23 @@ begin
         else
           info.ExeCmd[1]:=info.ExeCmd[1]+' -e _start';
 
-      { If we are using the default sysroot, use the default linker script and
-        just augment it with the FPC-specific parts.
-      }
-      if sysrootpath='' then
-        begin
-          add('SECTIONS');
-          add('{');
-          if not(cs_link_pre_binutils_2_19 in current_settings.globalswitches) then
-            { we can't use ".data", as that would hide the .data from the
-              original linker script in combination with the INSERT at the end }
-            add('  .fpcdata           :')
-          else
-            add('  .data           :');
-          add('  {');
-          add('    KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
-          add('  }');
-          add('  .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
-          add('}');
-          { this "INSERT" means "merge into the original linker script, even if
-            -T is used" }
-          if not(cs_link_pre_binutils_2_19 in current_settings.globalswitches) then
-            add('INSERT AFTER .data;');
-        end
+      add('SECTIONS');
+      add('{');
+      if not(cs_link_pre_binutils_2_19 in current_settings.globalswitches) then
+        { we can't use ".data", as that would hide the .data from the
+          original linker script in combination with the INSERT at the end }
+        add('  .fpcdata           :')
       else
-        begin
-{$ifdef x86_64}
-{$define LINKERSCRIPT_INCLUDED}
-          add('SECTIONS');
-          add('{');
-          {Read-only sections, merged into text segment:}
-          if current_module.islibrary  then
-            add('  . = 0 +  SIZEOF_HEADERS;')
-          else
-            add('  PROVIDE (__executable_start = 0x0400000); . = 0x0400000 +  SIZEOF_HEADERS;');
-          add('  .interp         : { *(.interp) }');
-          add('  .hash           : { *(.hash) }');
-          add('  .dynsym         : { *(.dynsym) }');
-          add('  .dynstr         : { *(.dynstr) }');
-          add('  .gnu.version    : { *(.gnu.version) }');
-          add('  .gnu.version_d  : { *(.gnu.version_d) }');
-          add('  .gnu.version_r  : { *(.gnu.version_r) }');
-          add('  .rel.dyn        :');
-          add('    {');
-          add('      *(.rel.init)');
-          add('      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)');
-          add('      *(.rel.fini)');
-          add('      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)');
-          add('      *(.rel.data.rel.ro*)');
-          add('      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)');
-          add('      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)');
-          add('      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)');
-          add('      *(.rel.got)');
-          add('      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)');
-          add('    }');
-          add('  .rela.dyn       :');
-          add('    {');
-          add('      *(.rela.init)');
-          add('      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)');
-          add('      *(.rela.fini)');
-          add('      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)');
-          add('      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)');
-          add('      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)');
-          add('      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)');
-          add('      *(.rela.got)');
-          add('      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)');
-          add('    }');
-          add('  .rel.plt        : { *(.rel.plt) }');
-          add('  .rela.plt       : { *(.rela.plt) }');
-          add('  .init           :');
-          add('  {');
-          add('    KEEP (*(.init))');
-          add('  } =0x90909090');
-          add('  .plt            : { *(.plt) }');
-          add('  .text           :');
-          add('  {');
-          add('    *(.text .stub .text.* .gnu.linkonce.t.*)');
-          add('    KEEP (*(.text.*personality*))');
-          {.gnu.warning sections are handled specially by elf32.em.}
-          add('    *(.gnu.warning)');
-          add('  } =0x90909090');
-          add('  .fini           :');
-          add('  {');
-          add('    KEEP (*(.fini))');
-          add('  } =0x90909090');
-          add('  PROVIDE (_etext = .);');
-          add('  .rodata         :');
-          add('  {');
-          add('    *(.rodata .rodata.* .gnu.linkonce.r.*)');
-          add('  }');
-          {Adjust the address for the data segment.  We want to adjust up to
-           the same address within the page on the next page up.}
-          add('  . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1));');
-          add('  .dynamic        : { *(.dynamic) }');
-          add('  .got            : { *(.got .toc) }');
-          add('  .got.plt        : { *(.got.plt .toc.plt) }');
-          add('  .data           :');
-          add('  {');
-          add('    *(.data .data.* .gnu.linkonce.d.*)');
-          add('    KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
-          add('    KEEP (*(.gnu.linkonce.d.*personality*))');
-          add('  }');
-          add('  PROVIDE (_edata = .);');
-          add('  PROVIDE (edata = .);');
-        {$ifdef zsegment_threadvars}
-          add('  _z = .;');
-          add('  .threadvar 0 : AT (_z) { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
-          add('  PROVIDE (_threadvar_size = SIZEOF(.threadvar));');
-          add('  . = _z + SIZEOF (.threadvar);');
-        {$else}
-          add('  .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
-        {$endif}
-          add('  __bss_start = .;');
-          add('  .bss            :');
-          add('  {');
-          add('   *(.dynbss)');
-          add('   *(.bss .bss.* .gnu.linkonce.b.*)');
-          add('   *(COMMON)');
-          {Align here to ensure that the .bss section occupies space up to
-           _end.  Align after .bss to ensure correct alignment even if the
-           .bss section disappears because there are no input sections.}
-          add('   . = ALIGN(32 / 8);');
-          add('}');
-          add('  . = ALIGN(32 / 8);');
-          add('  PROVIDE (_end = .);');
-          add('  PROVIDE (end = .);');
-          {Stabs debugging sections.}
-          add('  .stab          0 : { *(.stab) }');
-          add('  .stabstr       0 : { *(.stabstr) }');
-          add('  /* DWARF debug sections.');
-          add('     Symbols in the DWARF debugging sections are relative to the beginning');
-          add('     of the section so we begin them at 0.  */');
-          add('  /* DWARF 1 */');
-          add('  .debug          0 : { *(.debug) }');
-          add('  .line           0 : { *(.line) }');
-          add('  /* GNU DWARF 1 extensions */');
-          add('  .debug_srcinfo  0 : { *(.debug_srcinfo) }');
-          add('  .debug_sfnames  0 : { *(.debug_sfnames) }');
-          add('  /* DWARF 1.1 and DWARF 2 */');
-          add('  .debug_aranges  0 : { *(.debug_aranges) }');
-          add('  .debug_pubnames 0 : { *(.debug_pubnames) }');
-          add('  /* DWARF 2 */');
-          add('  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }');
-          add('  .debug_abbrev   0 : { *(.debug_abbrev) }');
-          add('  .debug_line     0 : { *(.debug_line) }');
-          add('  .debug_frame    0 : { *(.debug_frame) }');
-          add('  .debug_str      0 : { *(.debug_str) }');
-          add('  .debug_loc      0 : { *(.debug_loc) }');
-          add('  .debug_macinfo  0 : { *(.debug_macinfo) }');
-          add('  /* SGI/MIPS DWARF 2 extensions */');
-          add('  .debug_weaknames 0 : { *(.debug_weaknames) }');
-          add('  .debug_funcnames 0 : { *(.debug_funcnames) }');
-          add('  .debug_typenames 0 : { *(.debug_typenames) }');
-          add('  .debug_varnames  0 : { *(.debug_varnames) }');
-          add('  /DISCARD/ : { *(.note.GNU-stack) }');
-          add('}');
-{$endif x86_64}
-
-{$ifdef AArch64}
-{$define LINKERSCRIPT_INCLUDED}
-          { Complete linker script for aarch64-linux: }
-          add('SECTIONS');
-          add('{');
-          add('  /* Read-only sections, merged into text segment: */');
-          add('  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;');
-          add('  .interp         : { *(.interp) }');
-          add('  .note.gnu.build-id : { *(.note.gnu.build-id) }');
-          add('  .hash           : { *(.hash) }');
-          add('  .gnu.hash       : { *(.gnu.hash) }');
-          add('  .dynsym         : { *(.dynsym) }');
-          add('  .dynstr         : { *(.dynstr) }');
-          add('  .gnu.version    : { *(.gnu.version) }');
-          add('  .gnu.version_d  : { *(.gnu.version_d) }');
-          add('  .gnu.version_r  : { *(.gnu.version_r) }');
-          add('  .rela.dyn       :');
-          add('    {');
-          add('      *(.rela.init)');
-          add('        *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)');
-          add('      *(.rela.fini)');
-          add('      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)');
-          add('      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)');
-          add('      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)');
-          add('      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)');
-          add('      *(.rela.ctors)');
-          add('      *(.rela.dtors)');
-          add('      *(.rela.got)');
-          add('      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)');
-          add('      *(.rela.ifunc)');
-          add('    }');
-          add('  .rela.plt       :');
-          add('    {');
-          add('      *(.rela.plt)');
-          add('      PROVIDE_HIDDEN (__rela_iplt_start = .);');
-          add('      *(.rela.iplt)');
-          add('      PROVIDE_HIDDEN (__rela_iplt_end = .);');
-          add('    }');
-          add('  .init           :');
-          add('  {');
-          add('    KEEP (*(SORT_NONE(.init)))');
-          add('  } =0');
-          add('  .plt            : ALIGN(16) { *(.plt) *(.iplt) }');
-          add('  .text           :');
-          add('  {');
-          add('    *(.text.unlikely .text.*_unlikely .text.unlikely.*)');
-          add('    *(.text.exit .text.exit.*)');
-          add('    *(.text.startup .text.startup.*)');
-          add('    *(.text.hot .text.hot.*)');
-          add('    *(.text .stub .text.* .gnu.linkonce.t.*)');
-          add('    /* .gnu.warning sections are handled specially by elf32.em.  */');
-          add('    *(.gnu.warning)');
-          add('  } =0');
-          add('  .fini           :');
-          add('  {');
-          add('    KEEP (*(SORT_NONE(.fini)))');
-          add('  } =0');
-          add('  PROVIDE (__etext = .);');
-          add('  PROVIDE (_etext = .);');
-          add('  PROVIDE (etext = .);');
-          add('  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }');
-          add('  .rodata1        : { *(.rodata1) }');
-          add('  .eh_frame_hdr : { *(.eh_frame_hdr) }');
-          add('  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }');
-          add('  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table');
-          add('  .gcc_except_table.*) }');
-          add('  /* These sections are generated by the Sun/Oracle C++ compiler.  */');
-          add('  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges');
-          add('  .exception_ranges*) }');
-          add('  /* Adjust the address for the data segment.  We want to adjust up to');
-          add('     the same address within the page on the next page up.  */');
-          add('  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));');
-          add('  /* Exception handling  */');
-          add('  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }');
-          add('  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }');
-          add('  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }');
-          add('  /* Thread Local Storage sections  */');
-          add('  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }');
-          add('  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }');
-          add('  .preinit_array     :');
-          add('  {');
-          add('    PROVIDE_HIDDEN (__preinit_array_start = .);');
-          add('    KEEP (*(.preinit_array))');
-          add('    PROVIDE_HIDDEN (__preinit_array_end = .);');
-          add('  }');
-          add('  .init_array     :');
-          add('  {');
-          add('    PROVIDE_HIDDEN (__init_array_start = .);');
-          add('    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))');
-          add('    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))');
-          add('    PROVIDE_HIDDEN (__init_array_end = .);');
-          add('  }');
-          add('  .fini_array     :');
-          add('  {');
-          add('    PROVIDE_HIDDEN (__fini_array_start = .);');
-          add('    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))');
-          add('    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))');
-          add('    PROVIDE_HIDDEN (__fini_array_end = .);');
-          add('  }');
-          add('  .ctors          :');
-          add('  {');
-          add('    /* gcc uses crtbegin.o to find the start of');
-          add('       the constructors, so we make sure it is');
-          add('       first.  Because this is a wildcard, it');
-          add('       doesn''t matter if the user does not');
-          add('       actually link against crtbegin.o; the');
-          add('       linker won''t look for a file to match a');
-          add('       wildcard.  The wildcard also means that it');
-          add('       doesn''t matter which directory crtbegin.o');
-          add('       is in.  */');
-          add('    KEEP (*crtbegin.o(.ctors))');
-          add('    KEEP (*crtbegin?.o(.ctors))');
-          add('    /* We don''t want to include the .ctor section from');
-          add('       the crtend.o file until after the sorted ctors.');
-          add('       The .ctor section from the crtend file contains the');
-          add('       end of ctors marker and it must be last */');
-          add('    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))');
-          add('    KEEP (*(SORT(.ctors.*)))');
-          add('    KEEP (*(.ctors))');
-          add('  }');
-          add('  .dtors          :');
-          add('  {');
-          add('    KEEP (*crtbegin.o(.dtors))');
-          add('    KEEP (*crtbegin?.o(.dtors))');
-          add('    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))');
-          add('    KEEP (*(SORT(.dtors.*)))');
-          add('    KEEP (*(.dtors))');
-          add('  }');
-          add('  .jcr            : { KEEP (*(.jcr)) }');
-          add('  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }');
-          add('  .dynamic        : { *(.dynamic) }');
-          add('  .got            : { *(.got) *(.igot) }');
-          add('  . = DATA_SEGMENT_RELRO_END (24, .);');
-          add('  .got.plt        : { *(.got.plt)  *(.igot.plt) }');
-          add('  .data           :');
-          add('  {');
-          add('    PROVIDE (__data_start = .);');
-
-          { extra by FPC }
-          add('    KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
-
-          add('    *(.data .data.* .gnu.linkonce.d.*)');
-          add('    SORT(CONSTRUCTORS)');
-          add('  }');
-          add('  .data1          : { *(.data1) }');
-          add('  _edata = .; PROVIDE (edata = .);');
-          add('  . = .;');
-          add('  __bss_start = .;');
-          add('  __bss_start__ = .;');
-          add('  .bss            :');
-          add('  {');
-          add('   *(.dynbss)');
-          add('   *(.bss .bss.* .gnu.linkonce.b.*)');
-          add('   *(COMMON)');
-          add('   /* Align here to ensure that the .bss section occupies space up to');
-          add('      _end.  Align after .bss to ensure correct alignment even if the');
-          add('      .bss section disappears because there are no input sections.');
-          add('      FIXME: Why do we need it? When there is no .bss section, we don''t');
-          add('      pad the .data section.  */');
-          add('   . = ALIGN(. != 0 ? 64 / 8 : 1);');
-          add('  }');
-          add('  _bss_end__ = . ; __bss_end__ = . ;');
-          add('  . = ALIGN(64 / 8);');
-          add('  . = SEGMENT_START("ldata-segment", .);');
-          add('  . = ALIGN(64 / 8);');
-          add('  __end__ = . ;');
-          add('  _end = .; PROVIDE (end = .);');
-          add('  . = DATA_SEGMENT_END (.);');
-          add('  /* Stabs debugging sections.  */');
-          add('  .stab          0 : { *(.stab) }');
-          add('  .stabstr       0 : { *(.stabstr) }');
-          add('  .stab.excl     0 : { *(.stab.excl) }');
-          add('  .stab.exclstr  0 : { *(.stab.exclstr) }');
-          add('  .stab.index    0 : { *(.stab.index) }');
-          add('  .stab.indexstr 0 : { *(.stab.indexstr) }');
-          add('  .comment       0 : { *(.comment) }');
-          add('  /* DWARF debug sections.');
-          add('     Symbols in the DWARF debugging sections are relative to the beginning');
-          add('     of the section so we begin them at 0.  */');
-          add('  /* DWARF 1 */');
-          add('  .debug          0 : { *(.debug) }');
-          add('  .line           0 : { *(.line) }');
-          add('  /* GNU DWARF 1 extensions */');
-          add('  .debug_srcinfo  0 : { *(.debug_srcinfo) }');
-          add('  .debug_sfnames  0 : { *(.debug_sfnames) }');
-          add('  /* DWARF 1.1 and DWARF 2 */');
-          add('  .debug_aranges  0 : { *(.debug_aranges) }');
-          add('  .debug_pubnames 0 : { *(.debug_pubnames) }');
-          add('  /* DWARF 2 */');
-          add('  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }');
-          add('  .debug_abbrev   0 : { *(.debug_abbrev) }');
-          add('  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }');
-          add('  .debug_frame    0 : { *(.debug_frame) }');
-          add('  .debug_str      0 : { *(.debug_str) }');
-          add('  .debug_loc      0 : { *(.debug_loc) }');
-          add('  .debug_macinfo  0 : { *(.debug_macinfo) }');
-          add('  /* SGI/MIPS DWARF 2 extensions */');
-          add('  .debug_weaknames 0 : { *(.debug_weaknames) }');
-          add('  .debug_funcnames 0 : { *(.debug_funcnames) }');
-          add('  .debug_typenames 0 : { *(.debug_typenames) }');
-          add('  .debug_varnames  0 : { *(.debug_varnames) }');
-          add('  /* DWARF 3 */');
-          add('  .debug_pubtypes 0 : { *(.debug_pubtypes) }');
-          add('  .debug_ranges   0 : { *(.debug_ranges) }');
-          add('  /* DWARF Extension.  */');
-          add('  .debug_macro    0 : { *(.debug_macro) }');
-          add('  .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }');
-          add('  .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }');
-          add('  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }');
-          add('}');
-{$endif AArch64}
-
-{$ifdef ARM}
-          if target_info.abi in [abi_eabi,abi_eabihf] then
-            begin
-              { from GNU ld (CodeSourcery Sourcery G++ Lite 2007q3-53) 2.18.50.20070820 }
-              add('/* Script for -z combreloc: combine and sort reloc sections */');
-              add('OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",');
-              add('	      "elf32-littlearm")');
-              add('OUTPUT_ARCH(arm)');
-              add('SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");');
-              add('SECTIONS');
-              add('{');
-              add('  /* Read-only sections, merged into text segment: */');
-              add('  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000)); . = SEGMENT_START("text-segment", 0x10000) + SIZEOF_HEADERS;');
-              add('  .interp         : { *(.interp) }');
-              add('  .note.gnu.build-id : { *(.note.gnu.build-id) }');
-              add('  .hash           : { *(.hash) }');
-              add('  .gnu.hash       : { *(.gnu.hash) }');
-              add('  .dynsym         : { *(.dynsym) }');
-              add('  .dynstr         : { *(.dynstr) }');
-              add('  .gnu.version    : { *(.gnu.version) }');
-              add('  .gnu.version_d  : { *(.gnu.version_d) }');
-              add('  .gnu.version_r  : { *(.gnu.version_r) }');
-              add('  .rel.dyn        :');
-              add('    {');
-              add('      *(.rel.init)');
-              add('      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)');
-              add('      *(.rel.fini)');
-              add('      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)');
-              add('      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)');
-              add('      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)');
-              add('      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)');
-              add('      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)');
-              add('      *(.rel.ctors)');
-              add('      *(.rel.dtors)');
-              add('      *(.rel.got)');
-              add('      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)');
-              add('    }');
-              add('  .rela.dyn       :');
-              add('    {');
-              add('      *(.rela.init)');
-              add('      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)');
-              add('      *(.rela.fini)');
-              add('      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)');
-              add('      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)');
-              add('      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)');
-              add('      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)');
-              add('      *(.rela.ctors)');
-              add('      *(.rela.dtors)');
-              add('      *(.rela.got)');
-              add('      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)');
-              add('    }');
-              add('  .rel.plt        : { *(.rel.plt) }');
-              add('  .rela.plt       : { *(.rela.plt) }');
-              add('  .init           :');
-              add('  {');
-              add('    KEEP (*(.init))');
-              add('  } =0');
-              add('  .plt            : { *(.plt) }');
-              add('  .text           :');
-              add('  {');
-              add('    *(.text .stub .text.* .gnu.linkonce.t.*)');
-              add('    KEEP (*(.text.*personality*))');
-              add('    /* .gnu.warning sections are handled specially by elf32.em.  */');
-              add('    *(.gnu.warning)');
-              add('    *(.glue_7t) *(.glue_7) *(.vfp11_veneer)');
-              add('  } =0');
-              add('  .fini           :');
-              add('  {');
-              add('    KEEP (*(.fini))');
-              add('  } =0');
-              add('  PROVIDE (__etext = .);');
-              add('  PROVIDE (_etext = .);');
-              add('  PROVIDE (etext = .);');
-              add('  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }');
-              add('  .rodata1        : { *(.rodata1) }');
-              add('  .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) }');
-              add('   __exidx_start = .;');
-              add('  .ARM.exidx   : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }');
-              add('   __exidx_end = .;');
-              add('  .eh_frame_hdr : { *(.eh_frame_hdr) }');
-              add('  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }');
-              add('  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }');
-              add('  /* Adjust the address for the data segment.  We want to adjust up to');
-              add('     the same address within the page on the next page up.  */');
-              add('  . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1));');
-              add('  /* Exception handling  */');
-              add('  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }');
-              add('  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }');
-              add('  /* Thread Local Storage sections  */');
-              add('  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }');
-              add('  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }');
-              add('  .preinit_array     :');
-              add('  {');
-              add('    PROVIDE_HIDDEN (__preinit_array_start = .);');
-              add('    KEEP (*(.preinit_array))');
-              add('    PROVIDE_HIDDEN (__preinit_array_end = .);');
-              add('  }');
-              add('  .init_array     :');
-              add('  {');
-              add('     PROVIDE_HIDDEN (__init_array_start = .);');
-              add('     KEEP (*(SORT(.init_array.*)))');
-              add('     KEEP (*(.init_array))');
-              add('     PROVIDE_HIDDEN (__init_array_end = .);');
-              add('  }');
-              add('  .fini_array     :');
-              add('  {');
-              add('    PROVIDE_HIDDEN (__fini_array_start = .);');
-              add('    KEEP (*(.fini_array))');
-              add('    KEEP (*(SORT(.fini_array.*)))');
-              add('    PROVIDE_HIDDEN (__fini_array_end = .);');
-              add('  }');
-              add('  .ctors          :');
-              add('  {');
-              add('    /* gcc uses crtbegin.o to find the start of');
-              add('       the constructors, so we make sure it is');
-              add('       first.  Because this is a wildcard, it');
-              add('       doesn''t matter if the user does not');
-              add('       actually link against crtbegin.o; the');
-              add('       linker won''t look for a file to match a');
-              add('       wildcard.  The wildcard also means that it');
-              add('       doesn''t matter which directory crtbegin.o');
-              add('       is in.  */');
-              add('    KEEP (*crtbegin.o(.ctors))');
-              add('    KEEP (*crtbegin?.o(.ctors))');
-              add('    /* We don''t want to include the .ctor section from');
-              add('       the crtend.o file until after the sorted ctors.');
-              add('       The .ctor section from the crtend file contains the');
-              add('       end of ctors marker and it must be last */');
-              add('    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))');
-              add('    KEEP (*(SORT(.ctors.*)))');
-              add('    KEEP (*(.ctors))');
-              add('  }');
-              add('  .dtors          :');
-              add('  {');
-              add('    KEEP (*crtbegin.o(.dtors))');
-              add('    KEEP (*crtbegin?.o(.dtors))');
-              add('    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))');
-              add('    KEEP (*(SORT(.dtors.*)))');
-              add('    KEEP (*(.dtors))');
-              add('  }');
-              add('  .jcr            : { KEEP (*(.jcr)) }');
-              add('  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }');
-              add('  .dynamic        : { *(.dynamic) }');
-              add('  .got            : { *(.got.plt) *(.got) }');
-              add('  .data           :');
-              add('  {');
-              add('    __data_start = . ;');
-              add('    *(.data .data.* .gnu.linkonce.d.*)');
-
-              { extra by FPC }
-              add('    KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
-
-              add('    KEEP (*(.gnu.linkonce.d.*personality*))');
-              add('    SORT(CONSTRUCTORS)');
-              add('  }');
-              add('  .data1          : { *(.data1) }');
-              add('  _edata = .; PROVIDE (edata = .);');
-              add('  __bss_start = .;');
-              add('  __bss_start__ = .;');
-              add('  .bss            :');
-              add('  {');
-              add('   *(.dynbss)');
-              add('   *(.bss .bss.* .gnu.linkonce.b.*)');
-              add('   *(COMMON)');
-              add('   /* Align here to ensure that the .bss section occupies space up to');
-              add('      _end.  Align after .bss to ensure correct alignment even if the');
-              add('      .bss section disappears because there are no input sections.');
-              add('      FIXME: Why do we need it? When there is no .bss section, we don''t');
-              add('      pad the .data section.  */');
-              add('   . = ALIGN(. != 0 ? 32 / 8 : 1);');
-              add('  }');
-              add('  _bss_end__ = . ; __bss_end__ = . ;');
-              add('  . = ALIGN(32 / 8);');
-              add('  . = ALIGN(32 / 8);');
-              add('  __end__ = . ;');
-              add('  _end = .; PROVIDE (end = .);');
-              add('  /* Stabs debugging sections.  */');
-              add('  .stab          0 : { *(.stab) }');
-              add('  .stabstr       0 : { *(.stabstr) }');
-              add('  .stab.excl     0 : { *(.stab.excl) }');
-              add('  .stab.exclstr  0 : { *(.stab.exclstr) }');
-              add('  .stab.index    0 : { *(.stab.index) }');
-              add('  .stab.indexstr 0 : { *(.stab.indexstr) }');
-              add('  .comment       0 : { *(.comment) }');
-              add('  /* DWARF debug sections.');
-              add('     Symbols in the DWARF debugging sections are relative to the beginning');
-              add('     of the section so we begin them at 0.  */');
-              add('  /* DWARF 1 */');
-              add('  .debug          0 : { *(.debug) }');
-              add('  .line           0 : { *(.line) }');
-              add('  /* GNU DWARF 1 extensions */');
-              add('  .debug_srcinfo  0 : { *(.debug_srcinfo) }');
-              add('  .debug_sfnames  0 : { *(.debug_sfnames) }');
-              add('  /* DWARF 1.1 and DWARF 2 */');
-              add('  .debug_aranges  0 : { *(.debug_aranges) }');
-              add('  .debug_pubnames 0 : { *(.debug_pubnames) }');
-              add('  /* DWARF 2 */');
-              add('  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }');
-              add('  .debug_abbrev   0 : { *(.debug_abbrev) }');
-              add('  .debug_line     0 : { *(.debug_line) }');
-              add('  .debug_frame    0 : { *(.debug_frame) }');
-              add('  .debug_str      0 : { *(.debug_str) }');
-              add('  .debug_loc      0 : { *(.debug_loc) }');
-              add('  .debug_macinfo  0 : { *(.debug_macinfo) }');
-              add('  /* SGI/MIPS DWARF 2 extensions */');
-              add('  .debug_weaknames 0 : { *(.debug_weaknames) }');
-              add('  .debug_funcnames 0 : { *(.debug_funcnames) }');
-              add('  .debug_typenames 0 : { *(.debug_typenames) }');
-              add('  .debug_varnames  0 : { *(.debug_varnames) }');
-              add('  /* DWARF 3 */');
-              add('  .debug_pubtypes 0 : { *(.debug_pubtypes) }');
-              add('  .debug_ranges   0 : { *(.debug_ranges) }');
-              add('    .stack         0x80000 :');
-              add('  {');
-              add('    _stack = .;');
-              add('    *(.stack)');
-              add('  }');
-              add('  .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }');
-              add('  .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }');
-              add('  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }');
-              add('}');
-            end
-          else
-{$endif ARM}
-
-{$ifndef LINKERSCRIPT_INCLUDED}
-          begin
-            {Sections.}
-            add('SECTIONS');
-            add('{');
-            {Read-only sections, merged into text segment:}
-            add('  PROVIDE (__executable_start = 0x010000); . = 0x010000 + SIZEOF_HEADERS;');
-            add('  .interp         : { *(.interp) }');
-            add('  .hash           : { *(.hash) }');
-            add('  .dynsym         : { *(.dynsym) }');
-            add('  .dynstr         : { *(.dynstr) }');
-            add('  .gnu.version    : { *(.gnu.version) }');
-            add('  .gnu.version_d  : { *(.gnu.version_d) }');
-            add('  .gnu.version_r  : { *(.gnu.version_r) }');
-            add('  .rel.dyn        :');
-            add('    {');
-            add('      *(.rel.init)');
-            add('      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)');
-            add('      *(.rel.fini)');
-            add('      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)');
-            add('      *(.rel.data.rel.ro*)');
-            add('      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)');
-            add('      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)');
-            add('      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)');
-            add('      *(.rel.got)');
-            add('      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)');
-            add('    }');
-            add('  .rela.dyn       :');
-            add('    {');
-            add('      *(.rela.init)');
-            add('      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)');
-            add('      *(.rela.fini)');
-            add('      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)');
-            add('      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)');
-            add('      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)');
-            add('      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)');
-            add('      *(.rela.got)');
-            add('      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)');
-            add('    }');
-            add('  .rel.plt        : { *(.rel.plt) }');
-            add('  .rela.plt       : { *(.rela.plt) }');
-            add('  .init           :');
-            add('  {');
-            add('    KEEP (*(.init))');
-            add('  } =0x90909090');
-            add('  .plt            : { *(.plt) }');
-            add('  .text           :');
-            add('  {');
-            add('    *(.text .stub .text.* .gnu.linkonce.t.*)');
-            add('    KEEP (*(.text.*personality*))');
-            {.gnu.warning sections are handled specially by elf32.em.}
-            add('    *(.gnu.warning)');
-            add('  } =0x90909090');
-            add('  .fini           :');
-            add('  {');
-            add('    KEEP (*(.fini))');
-            add('  } =0x90909090');
-            add('  PROVIDE (_etext = .);');
-            add('  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }');
-            add('  .rodata1        : { *(.rodata1) }');
-            add('  .eh_frame_hdr : { *(.eh_frame_hdr) }');
-            add('  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }');
-            add('  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table');
-            add('  .gcc_except_table.*) }');
-            add('  /* These sections are generated by the Sun/Oracle C++ compiler.  */');
-            add('  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges');
-            add('  .exception_ranges*) }');
-            add('  /* Adjust the address for the data segment.  We want to adjust up to');
-            add('     the same address within the page on the next page up.  */');
-            add('  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));');
-            add('  /* Exception handling  */');
-            add('  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }');
-            add('  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }');
-            add('  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }');
-            add('  /* Thread Local Storage sections  */');
-            add('  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }');
-            add('  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }');
-            add('  .preinit_array     :');
-            add('  {');
-            add('    PROVIDE_HIDDEN (__preinit_array_start = .);');
-            add('    KEEP (*(.preinit_array))');
-            add('    PROVIDE_HIDDEN (__preinit_array_end = .);');
-            add('  }');
-            add('  .init_array     :');
-            add('  {');
-            add('    PROVIDE_HIDDEN (__init_array_start = .);');
-            add('    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))');
-            add('    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))');
-            add('    PROVIDE_HIDDEN (__init_array_end = .);');
-            add('  }');
-            add('  .fini_array     :');
-            add('  {');
-            add('    PROVIDE_HIDDEN (__fini_array_start = .);');
-            add('    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))');
-            add('    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))');
-            add('    PROVIDE_HIDDEN (__fini_array_end = .);');
-            add('  }');
-            add('  .ctors          :');
-            add('  {');
-            add('    /* gcc uses crtbegin.o to find the start of');
-            add('       the constructors, so we make sure it is');
-            add('       first.  Because this is a wildcard, it');
-            add('       doesn''t matter if the user does not');
-            add('       actually link against crtbegin.o; the');
-            add('       linker won''t look for a file to match a');
-            add('       wildcard.  The wildcard also means that it');
-            add('       doesn''t matter which directory crtbegin.o');
-            add('       is in.  */');
-            add('    KEEP (*crtbegin.o(.ctors))');
-            add('    KEEP (*crtbegin?.o(.ctors))');
-            add('    /* We don''t want to include the .ctor section from');
-            add('       the crtend.o file until after the sorted ctors.');
-            add('       The .ctor section from the crtend file contains the');
-            add('       end of ctors marker and it must be last */');
-            add('    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))');
-            add('    KEEP (*(SORT(.ctors.*)))');
-            add('    KEEP (*(.ctors))');
-            add('  }');
-            add('  .dtors          :');
-            add('  {');
-            add('    KEEP (*crtbegin.o(.dtors))');
-            add('    KEEP (*crtbegin?.o(.dtors))');
-            add('    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))');
-            add('    KEEP (*(SORT(.dtors.*)))');
-            add('    KEEP (*(.dtors))');
-            add('  }');
-            add('  .jcr            : { KEEP (*(.jcr)) }');
-            add('  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }');
-            add('  .dynamic        : { *(.dynamic) }');
-            add('  .got            : { *(.got) }');
-            add('  .got.plt        : { *(.got.plt) }');
-            add('  .data           :');
-            add('  {');
-            add('    *(.data .data.* .gnu.linkonce.d.*)');
-            add('    KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
-            add('    KEEP (*(.gnu.linkonce.d.*personality*))');
-            add('  }');
-            add('  PROVIDE (_edata = .);');
-            add('  PROVIDE (edata = .);');
-          {$ifdef zsegment_threadvars}
-            add('  _z = .;');
-            add('  .threadvar 0 : AT (_z) { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
-            add('  PROVIDE (_threadvar_size = SIZEOF(.threadvar));');
-            add('  . = _z + SIZEOF (.threadvar);');
-          {$else}
-            add('  .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
-          {$endif}
-            add('  __bss_start = .;');
-            add('  .bss            :');
-            add('  {');
-            add('   *(.dynbss)');
-            add('   *(.bss .bss.* .gnu.linkonce.b.*)');
-            add('   *(COMMON)');
-            {Align here to ensure that the .bss section occupies space up to
-             _end.  Align after .bss to ensure correct alignment even if the
-             .bss section disappears because there are no input sections.}
-            add('   . = ALIGN(32 / 8);');
-            add('  }');
-            add('  . = ALIGN(32 / 8);');
-            add('  PROVIDE (_end = .);');
-            add('  PROVIDE (end = .);');
-            {Stabs debugging sections.}
-            add('  .stab          0 : { *(.stab) }');
-            add('  .stabstr       0 : { *(.stabstr) }');
-            add('}');
-          end;
-{$endif LINKERSCRIPT_INCLUDED}
-        end;
+        add('  .data           :');
+      add('  {');
+      add('    KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
+      add('  }');
+      add('  .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
+      add('}');
+      { this "INSERT" means "merge into the original linker script, even if
+        -T is used" }
+      if not(cs_link_pre_binutils_2_19 in current_settings.globalswitches) then
+        add('INSERT AFTER .data;');
       { Write and Close response }
       writetodisk;
       Free;

+ 5 - 5
compiler/systems/t_msdos.pas

@@ -117,12 +117,12 @@ implementation
         exit;
       if tcalo_vectorized_dead_strip_start in options then
         secname:='1_START'
+      else if tcalo_vectorized_dead_strip_item in options then
+        secname:='2_ITEM'
+      else if tcalo_vectorized_dead_strip_end in options then
+        secname:='3_END'
       else
-        if tcalo_vectorized_dead_strip_end in options then
-          secname:='3_END'
-        else
-          if tcalo_vectorized_dead_strip_item in options then
-            secname:='2_ITEM';
+	secname:='4_INV';
       secname:=make_mangledname(basename,st,secname);
     end;
 

+ 41 - 14
compiler/systems/t_sinclairql.pas

@@ -56,6 +56,7 @@ implementation
 
     const
        DefaultOrigin = $0;
+       ProgramHeaderName = 'main';
 
 
 constructor TLinkerSinclairQL.Create;
@@ -173,16 +174,26 @@ begin
   with LinkRes do
     begin
       Add('');
+      Add('PHDRS {');
+      Add('  '+ProgramHeaderName+' PT_LOAD;');
+      Add('}');
       Add('SECTIONS');
       Add('{');
       Add('  . = 0x'+hexstr(Origin,8)+';');
       Add('  .text : {');
       Add('      _stext = .;');
-      Add('      *(.text .text.* _CODE _CODE.* ) ');
-      Add('      *(.data .data.* .rodata .rodata.* .fpc.* ) ');
-      Add('      *(_BSS _BSS.*) *(.bss .bss.*) *(_BSSEND _BSSEND.*) *(_HEAP _HEAP.*) *(.stack .stack.*) *(_STACK _STACK.*) ');
+      Add('      *(.text .text.* )');
+      Add('      *(.data .data.* .rodata .rodata.* .fpc.* )');
+      Add('      *(.stack .stack.*)');
+      { force the end of section to be word aligned }
+      Add('      . = ALIGN(2); SHORT(0x514C);');
       Add('      _etext = .;');
-      Add('  }');
+      Add('  } :'+ProgramHeaderName);
+      Add('  .bss (NOLOAD): {');
+      Add('      _sbss = .;');
+      Add('      *(.bss .bss.*)');
+      Add('      _ebss = .;');
+      Add('  } :'+ProgramHeaderName);
       Add('}');
     end;
 
@@ -204,8 +215,13 @@ var
   FlagsStr : string;
   ExeName: string;
   fd,fs: file;
+  fhdr: text;
   buf: pointer;
   bufread,bufsize: longint;
+  HdrName: string;
+  HeaderLine: string;
+  HeaderSize: longint;
+  code: word;
 begin
   StripStr:='';
   GCSectionsStr:='';
@@ -223,6 +239,7 @@ begin
     end;
 
   ExeName:=current_module.exefilename;
+  HdrName:=ExeName+'.hdr';
 
   { Call linker }
   SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
@@ -238,22 +255,29 @@ begin
   MakeSinclairQLExe:=DoExec(BinStr,CmdStr,true,false);
 
   { Kludge:
-      With the above linker script, vlink will produce two files,
-      "exename. text" and "exename. text.rel text". The former is the
-      binary itself, the second is the relocation info. Here we copy
-      the two together. I'll try to get vlink to do this for me in the
-      future. (KB) }
+      With the above linker script, vlink will produce two files. The main binary 
+      and the relocation info. Here we copy the two together. (KB) }
   if MakeSinclairQLExe then
     begin
       ExeLength:=0;
       bufsize:=16384;
 {$push}
 {$i-}
+      { Rename vlink's output file into the header file it is, then parse the 
+        expected length from it. Later we use either this size or the final binary
+        size in the BASIC loader, depending on which one is bigger. (KB) }
+      RenameFile(ExeName,HdrName);
+      assign(fhdr,HdrName);
+      reset(fhdr);
+      readln(fhdr,HeaderLine);
+      Val(Copy(HeaderLine,RPos('0x',HeaderLine),Length(HeaderLine)),HeaderSize,code);
+      close(fhdr);
+
       buf:=GetMem(bufsize);
-      assign(fd,exename);
+      assign(fd,ExeName);
       rewrite(fd,1);
 
-      assign(fs,exename+'. text');
+      assign(fs,ExeName+'.'+ProgramHeaderName);
       reset(fs,1);
       repeat
         blockread(fs,buf^,bufsize,bufread);
@@ -262,7 +286,7 @@ begin
       close(fs);
       // erase(fs);
 
-      assign(fs,exename+'. text.rel text');
+      assign(fs,ExeName+'.'+ProgramHeaderName+'.rel'+ProgramHeaderName);
       reset(fs,1);
       repeat
         blockread(fs,buf^,bufsize,bufread);
@@ -274,7 +298,10 @@ begin
       ExeLength:=FileSize(fd);
       close(fd);
 {$pop}
-      MakeSinclairQLExe:=not (ExeLength = 0);
+      FreeMem(buf);
+      if HeaderSize > ExeLength then
+        ExeLength:=HeaderSize;
+      MakeSinclairQLExe:=(code = 0) and not (ExeLength = 0);
     end;
 end;
 
@@ -305,7 +332,7 @@ begin
       ExeName:=current_module.exefilename;
       BootStr:=DefaultBootString;
 
-      Replace(BootStr,'$BINSIZE',tostr(ExeLength)); { FIX ME }
+      Replace(BootStr,'$BINSIZE',tostr(ExeLength));
       Replace(BootStr,'$EXENAME',ExeName);
 
       Replace(ExeName,target_info.exeext,'');

+ 1 - 1
compiler/utils/Makefile

@@ -3270,7 +3270,7 @@ else
 ppu$(PPUEXT): ../ppu.pas
 	$(COMPILER) ../ppu.pas -Fu../generic -dGENERIC_CPU -Fi..
 ppudump$(EXEEXT): ppuutils/ppudump.pp ppu$(PPUEXT)
-	$(COMPILER) ppuutils/ppudump.pp -Fu../generic -dGENERIC_CPU -Fi..
+	$(COMPILER) ppuutils/ppudump.pp -Fu../llvm -Fu../generic -dGENERIC_CPU -Fi..
 ppufiles$(EXEEXT): ppufiles.pp ppu$(PPUEXT)
 	$(COMPILER) ppufiles.pp -Fu../generic -dGENERIC_CPU -Fi..
 ppumove$(EXEEXT): ppumove.pp ppu$(PPUEXT)

+ 1 - 1
compiler/utils/Makefile.fpc

@@ -60,7 +60,7 @@ ppu$(PPUEXT): ../ppu.pas
         $(COMPILER) ../ppu.pas -Fu../generic -dGENERIC_CPU -Fi..
 
 ppudump$(EXEEXT): ppuutils/ppudump.pp ppu$(PPUEXT)
-        $(COMPILER) ppuutils/ppudump.pp -Fu../generic -dGENERIC_CPU -Fi..
+        $(COMPILER) ppuutils/ppudump.pp -Fu../llvm -Fu../generic -dGENERIC_CPU -Fi..
 
 ppufiles$(EXEEXT): ppufiles.pp ppu$(PPUEXT)
         $(COMPILER) ppufiles.pp -Fu../generic -dGENERIC_CPU -Fi..

+ 5 - 0
compiler/utils/mkx86ins.pp

@@ -320,6 +320,11 @@ begin
                     dec(attopcode[0]);
                     attsuffix:='attsufMM';
                   end;
+                'N' :
+                  begin
+                    dec(attopcode[0]);
+                    attsuffix:='attsufMMX';
+                  end;
                 'X' :
                   begin
                     dec(attopcode[0]);

+ 14 - 8
compiler/x86/aasmcpu.pas

@@ -505,6 +505,8 @@ interface
         IF_T4,                  { disp8 - tuple - 4 }
         IF_T8,                  { disp8 - tuple - 8 }
         IF_T1S,                 { disp8 - tuple - 1 scalar }
+        IF_T1S8,                { disp8 - tuple - 1 scalar byte }
+        IF_T1S16,               { disp8 - tuple - 1 scalar word }
         IF_T1F32,
         IF_T1F64,
         IF_TMDDUP,
@@ -963,8 +965,7 @@ implementation
            while (localsize>0) do
             begin
 {$ifndef i8086}
-              if (CPUX86_HAS_CMOV in cpu_capabilities[current_settings.cputype])
-                 {$ifdef i386} and not (target_info.system in systems_i386_no_cmov_align) {$endif} then
+              if (CPUX86_HAS_CMOV in cpu_capabilities[current_settings.cputype]) then
                 begin
                   for j:=low(alignarray_cmovcpus) to high(alignarray_cmovcpus) do
                    if (localsize>=length(alignarray_cmovcpus[j])) then
@@ -2128,6 +2129,8 @@ implementation
                       else tuplesize := 4;
               end;
             end
+            else if IF_T1S8 in aInsEntry^.Flags then tuplesize := 1
+            else if IF_T1S16 in aInsEntry^.Flags then tuplesize := 2
             else if IF_T1F32 in aInsEntry^.Flags then tuplesize := 4
             else if IF_T1F64 in aInsEntry^.Flags then tuplesize := 8
             else if IF_T2 in aInsEntry^.Flags then
@@ -2183,12 +2186,15 @@ implementation
           begin
             if aInput.typ = top_ref then
             begin
-              if (aInput.ref^.offset <> 0) and
-                 ((aInput.ref^.offset mod tuplesize) = 0) and
-                 (abs(aInput.ref^.offset) div tuplesize <= 127) then
-              begin
-                aInput.ref^.offset := aInput.ref^.offset div tuplesize;
-                EVEXTupleState := etsIsTuple;
+	      if aInput.ref^.base <> NR_NO then
+	      begin	      
+	        if (aInput.ref^.offset <> 0) and
+                   ((aInput.ref^.offset mod tuplesize) = 0) and
+                   (abs(aInput.ref^.offset) div tuplesize <= 127) then
+                begin
+                  aInput.ref^.offset := aInput.ref^.offset div tuplesize;
+                  EVEXTupleState := etsIsTuple;
+    	        end;  
               end;
             end;
           end;

+ 2 - 0
compiler/x86/agx86att.pas

@@ -395,6 +395,8 @@ interface
                (getregtype(taicpu(hp).oper[0]^.reg)=R_FPUREGISTER)
               ) then
         begin
+          if (gas_needsuffix[op]<>AttSufMMX) or
+	     (taicpu(hp).opsize in [S_XMM,S_YMM]) then
           owner.writer.AsmWrite(gas_opsize2str[taicpu(hp).opsize]);
         end;
 

+ 11 - 4
compiler/x86/agx86nsm.pas

@@ -390,7 +390,7 @@ interface
             begin
               if (ops=1) and (opcode<>A_RET) then
                writer.AsmWrite(sizestr(s,dest));
-              writer.AsmWrite(tostr(longint(o.val)));
+              writer.AsmWrite(tostr(o.val));
             end;
           top_ref :
             begin
@@ -634,8 +634,14 @@ interface
         if target_info.system in systems_darwin then
           writer.AsmWrite(':private_extern')
         else
-          { no colon }
-          writer.AsmWrite(' hidden')
+          case sym.typ of
+            AT_FUNCTION:
+              writer.AsmWrite(':function hidden');
+            AT_DATA:
+              writer.AsmWrite(':data hidden');
+            else
+              Internalerror(2020111301);
+          end;
       end;
 
     procedure TX86NasmAssembler.ResetSectionsList;
@@ -1000,9 +1006,10 @@ interface
                if tai_symbol(hp).is_global or SmartAsm then
                 begin
                   writer.AsmWrite(#9'GLOBAL ');
-                  writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name));
+                  writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name));
                   if tai_symbol(hp).sym.bind=AB_PRIVATE_EXTERN then
                     WriteHiddenSymbolAttribute(tai_symbol(hp).sym);
+                  writer.AsmLn;
                 end;
                writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name));
                if SmartAsm then

+ 5 - 0
compiler/x86/cgx86.pas

@@ -1891,6 +1891,11 @@ unit cgx86;
             if UseAVX then
               begin
                 asmop:=opmm2asmop_full_avx[op];
+{$ifdef x86_64}
+                { A_VPXOR does not support the upper 16 registers }
+                if (asmop=A_VPXOR) and (FPUX86_HAS_32MMREGS in fpu_capabilities[current_settings.fputype]) then
+                  asmop:=A_VPXORD;
+{$endif x86_64}
                 if size in [OS_M256,OS_M512] then
                   Include(current_procinfo.flags,pi_uses_ymm);
               end

+ 1 - 1
compiler/x86/cpubase.pas

@@ -509,7 +509,7 @@ implementation
             end;
           R_ADDRESSREGISTER:
             case reg of
-              NR_K0..NR_K7: reg_cgsize:=OS_64;
+              NR_K0..NR_K7: reg_cgsize:=OS_NO;
               else internalerror(2003031801);
             end;
           else

+ 9 - 1
compiler/x86/itcpugas.pas

@@ -29,7 +29,7 @@ interface
       cgbase,cpubase;
 
     type
-      TAttSuffix = (AttSufNONE,AttSufINT,AttSufFPU,AttSufFPUint,AttSufINTdual,AttSufMM);
+      TAttSuffix = (AttSufNONE,AttSufINT,AttSufFPU,AttSufFPUint,AttSufINTdual,AttSufMM,AttSufMMX);
 
     const
       { include mnemonic strings }
@@ -75,6 +75,10 @@ interface
      att_sizemmsuffix : array[0..14] of topsize = (
        S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,{S_NO,}S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_XMM,S_YMM,S_ZMM
      );
+     att_sizemmxsuffix : array[0..14] of topsize = (
+       S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,{S_NO,}S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_XMM,S_NO,S_NO
+     );
+
 {$else x86_64}
      gas_opsize2str : array[topsize] of string[2] = ('',
        'b','w','l','q','bw','bl','wl',
@@ -103,6 +107,10 @@ interface
      att_sizemmsuffix : array[0..12] of topsize = (
        S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_XMM,S_YMM,S_ZMM
      );
+     att_sizemmxsuffix : array[0..12] of topsize = (
+       S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_XMM,S_NO,S_NO
+     );
+
 
 {$endif x86_64}
 

+ 158 - 60
compiler/x86/rax86.pas

@@ -239,7 +239,7 @@ begin
           ;
       end;
     end
-  else if gas_needsuffix[opcode]=AttSufMM then
+  else if gas_needsuffix[opcode] in [AttSufMM, AttSufMMX] then
   begin
     if (opr.typ=OPR_Reference) then
     begin
@@ -544,6 +544,21 @@ begin
                   end;
                 end;
               end;
+            msiMemRegx16y32z64:
+              begin
+                for j := 1 to ops do
+                begin
+                  if operands[j].Opr.Typ = OPR_REGISTER then
+                  begin
+                    case getsubreg(operands[j].opr.reg) of
+                      R_SUBMMX: memrefsize := 16;
+                      R_SUBMMY: memrefsize := 32;
+                      R_SUBMMZ: memrefsize := 64;
+                      else Message(asmr_e_unable_to_determine_reference_size);
+                    end;
+                  end;
+                end;
+              end;
             msiMemRegx32y64:
               begin
                 for j := 1 to ops do
@@ -558,6 +573,21 @@ begin
                   end;
                 end;
               end;
+            msiMemRegx32y64z128:
+              begin
+                for j := 1 to ops do
+                begin
+                  if operands[j].Opr.Typ = OPR_REGISTER then
+                  begin
+                    case getsubreg(operands[j].opr.reg) of
+                      R_SUBMMX: memrefsize := 32;
+                      R_SUBMMY: memrefsize := 64;
+                      R_SUBMMZ: memrefsize := 128;
+                      else Message(asmr_e_unable_to_determine_reference_size);
+                    end;
+                  end;
+                end;
+              end;
            msiMemRegx64y128:
               begin
                 for j := 1 to ops do
@@ -712,7 +742,7 @@ begin
             msiMultiple:
               ;
             else
-              Internalerror(2019081016);
+              Internalerror(2020111001);
           end;
 
           if memrefsize > -1 then
@@ -1402,6 +1432,51 @@ end;
 
 
 procedure Tx86Instruction.SetInstructionOpsize;
+
+  function CheckSSEAVX: Boolean;
+  var
+    i: integer;
+    bBroadcastMemRef: boolean;
+  begin
+    Result := False;
+
+    with MemRefInfo(opcode) do
+    begin
+      if (ExistsSSEAVX) then
+      begin
+        bBroadcastMemRef := false;
+        for i := 1 to ops do
+         bBroadcastMemRef := bBroadcastMemRef or ((tx86operand(operands[i]).vopext and OTVE_VECTOR_BCST) = OTVE_VECTOR_BCST);
+
+        if bBroadcastMemRef then
+        begin
+          opsize := S_NO;
+          result := true;
+        end
+        else
+        begin
+          if MemRefSize in MemRefMultiples - [msiVMemMultiple] then
+          begin
+            case ops of
+              2: begin
+                   opsize:=tx86operand(operands[1]).opsize;
+                   result := true;
+                 end;
+              3: begin
+                   if (tx86operand(operands[1]).opr.typ <> OPR_CONSTANT) then
+                    opsize:=tx86operand(operands[1]).opsize
+                     else opsize:=tx86operand(operands[2]).opsize;
+                   result := true;
+                 end;
+            end;
+          end;
+        end;
+      end;
+    end;
+  end;
+
+var
+  isBCastMemRef: boolean;
 begin
   if opsize<>S_NO then
    exit;
@@ -1422,78 +1497,91 @@ begin
         else
           opsize:=tx86operand(operands[1]).opsize;
       end;
-    2 :
-      begin
-        case opcode of
-          A_MOVZX,A_MOVSX :
-            begin
-              if tx86operand(operands[1]).opsize=S_NO then
-                begin
-                  tx86operand(operands[1]).opsize:=S_B;
-                  if (m_delphi in current_settings.modeswitches) then
-                    Message(asmr_w_unable_to_determine_reference_size_using_byte)
-                  else
-                    Message(asmr_e_unable_to_determine_reference_size);
-                end;
-              case tx86operand(operands[1]).opsize of
-                S_W :
-                  case tx86operand(operands[2]).opsize of
-                    S_L :
-                      opsize:=S_WL;
-{$ifdef x86_64}
-                    S_Q :
-                      opsize:=S_WQ;
-{$endif}
+    2 : begin
+          case opcode of
+            A_MOVZX,A_MOVSX :
+              begin
+                if tx86operand(operands[1]).opsize=S_NO then
+                  begin
+                    tx86operand(operands[1]).opsize:=S_B;
+                    if (m_delphi in current_settings.modeswitches) then
+                      Message(asmr_w_unable_to_determine_reference_size_using_byte)
                     else
-                      ;
+                      Message(asmr_e_unable_to_determine_reference_size);
                   end;
-                S_B :
-                  begin
+                case tx86operand(operands[1]).opsize of
+                  S_W :
                     case tx86operand(operands[2]).opsize of
-                      S_W :
-                        opsize:=S_BW;
                       S_L :
-                        opsize:=S_BL;
-{$ifdef x86_64}
+                        opsize:=S_WL;
+  {$ifdef x86_64}
                       S_Q :
-                        opsize:=S_BQ;
-{$endif}
+                        opsize:=S_WQ;
+  {$endif}
                       else
                         ;
                     end;
-                  end;
-                else
-                  ;
+                  S_B :
+                    begin
+                      case tx86operand(operands[2]).opsize of
+                        S_W :
+                          opsize:=S_BW;
+                        S_L :
+                          opsize:=S_BL;
+  {$ifdef x86_64}
+                        S_Q :
+                          opsize:=S_BQ;
+  {$endif}
+                        else
+                          ;
+                      end;
+                    end;
+                  else
+                    ;
+                end;
               end;
-            end;
-          A_MOVSS,
-          A_VMOVSS,
-          A_MOVD : { movd is a move from a mmx register to a
-                     32 bit register or memory, so no opsize is correct here PM }
-            exit;
-          A_MOVQ :
-            opsize:=S_IQ;
-          A_CVTSI2SS,
-          A_CVTSI2SD,
-          A_OUT :
-            opsize:=tx86operand(operands[1]).opsize;
-          else
-            opsize:=tx86operand(operands[2]).opsize;
+            A_MOVSS,
+            A_VMOVSS,
+            A_MOVD : { movd is a move from a mmx register to a
+                       32 bit register or memory, so no opsize is correct here PM }
+              exit;
+            A_MOVQ :
+              opsize:=S_IQ;
+            //A_VCVTPD2DQ,
+            //A_VCVTPD2PS,
+            //A_VCVTTPD2DQ,
+            //A_VCVTPD2UDQ,
+            //A_VCVTQQ2PS,
+            //A_VCVTTPD2UDQ,
+            //A_VCVTUQQ2PS,
+
+            A_OUT :
+              opsize:=tx86operand(operands[1]).opsize;
+            else
+             if not CheckSSEAVX then
+              opsize:=tx86operand(operands[2]).opsize;
+          end;
         end;
-      end;
     3 :
-      begin
-        case opcode of
-          A_VCVTSI2SS,
-          A_VCVTSI2SD:
-            opsize:=tx86operand(operands[1]).opsize;
-        else
-          opsize:=tx86operand(operands[ops]).opsize;
+        begin
+          //case opcode of
+            //A_VCVTSI2SS,
+            //A_VCVTSI2SD,
+            //A_VCVTUSI2SS,
+            //A_VCVTUSI2SD:
+            //  iops:=tx86operand(operands[1]).opsize;
+            //A_VFPCLASSPD,
+            //A_VFPCLASSPS:
+            //  iops:=tx86operand(operands[2]).opsize;
+            //else
+            begin
+              if not CheckSSEAVX then
+               opsize:=tx86operand(operands[ops]).opsize;
+            end;
+          //end;
         end;
-      end;
     4 :
         opsize:=tx86operand(operands[ops]).opsize;
-
   end;
 end;
 
@@ -1988,7 +2076,17 @@ begin
                                begin
                                  s:=s+'reg';
                                  addsize:=true;
+                               end
+                             else
+                               if getregtype(opr.reg)=R_ADDRESSREGISTER then
+                               begin
+                                 // 14102020 TG TODO CHECK
+                                 if (opr.reg >= NR_K0) and (opr.reg >= NR_K7) then
+                                 begin
+                                   s:=s+'k' + regnr;
+                                 end;
                                end;
+
                            end;
                OPR_LOCAL,
             OPR_REFERENCE: begin

+ 2 - 0
compiler/x86/rax86att.pas

@@ -1041,6 +1041,8 @@ Implementation
                        actopsize:=att_sizefpuintsuffix[sufidx]
                       else if gas_needsuffix[actopcode]=attsufMM then
                        actopsize:=att_sizemmsuffix[sufidx]
+                      else if gas_needsuffix[actopcode]=attsufMMX then
+                       actopsize:=att_sizemmXsuffix[sufidx]
                       else
                        actopsize:=att_sizesuffix[sufidx];
                       { only accept suffix from the same category that the opcode belongs to }

+ 86 - 58
compiler/x86/x86ins.dat

@@ -4158,7 +4158,7 @@ ymmreg_mz,mem128                          \333\350\362\364\370\1\xE6\110
 ymmreg_mz,xmmreg                          \333\350\362\364\370\1\xE6\110            AVX,SANDYBRIDGE
 ymmreg_mz,bmem32                          \333\350\364\370\1\xE6\110                AVX512,BCST4,THV
 zmmreg_mz,mem256                          \333\350\351\370\1\xE6\110                AVX512,THV
-zmmreg_mz,ymmreg_er                       \333\350\351\370\1\xE6\110                AVX512
+zmmreg_mz,ymmreg                          \333\350\351\370\1\xE6\110                AVX512
 zmmreg_mz,bmem32                          \333\350\351\370\1\xE6\110                AVX512,BCST8,THV
 
 
@@ -4174,10 +4174,13 @@ zmmreg_mz,bmem32                          \350\351\370\1\x5B\110
 zmmreg_mz,zmmreg_er                       \350\351\370\1\x5B\110                    AVX512
 
 
-[VCVTPD2DQ,vcvtpd2dqM]
+; VCVTPD2DQ xmmreg_mz,mem256 must come first - map MemRefSize 256bits correct
+;                                              map all other MemrefSize (without broasdcast MemRef) to xmmreg, xmmrm
+[VCVTPD2DQ,vcvtpd2dqN]
 (Ch_Wop2, Ch_Rop1)
+xmmreg_mz,mem256                          \334\350\352\362\364\370\1\xE6\110        AVX,SANDYBRIDGE,TFV
 xmmreg_mz,xmmrm                           \334\350\352\362\370\1\xE6\110            AVX,SANDYBRIDGE,TFV
-xmmreg_mz,ymmrm                           \334\350\352\362\364\370\1\xE6\110        AVX,SANDYBRIDGE,TFV
+xmmreg_mz,ymmreg                           \334\350\352\362\364\370\1\xE6\110       AVX,SANDYBRIDGE
 xmmreg_mz,bmem64                          \334\350\352\370\1\xE6\110                AVX512,BCST2,TFV
 xmmreg_mz,bmem64                          \334\350\352\364\370\1\xE6\110            AVX512,BCST4,TFV
 
@@ -4188,7 +4191,7 @@ ymmreg_mz,zmmreg_er                       \334\350\351\352\370\1\xE6\110
 
 ; VCVTPD2PS xmmreg_mz,mem256 must come first - map MemRefSize 256bits correct
 ;                                              map all other MemrefSize (without broasdcast MemRef) to xmmreg, xmmrm
-[VCVTPD2PS,vcvtpd2psM]
+[VCVTPD2PS,vcvtpd2psN]
 (Ch_Wop2, Ch_Rop1)
 xmmreg_mz,mem256                          \350\352\361\362\364\370\1\x5A\110        AVX,SANDYBRIDGE,TFV
 xmmreg_mz,ymmreg                          \350\352\361\362\364\370\1\x5A\110        AVX,SANDYBRIDGE
@@ -4258,15 +4261,15 @@ xmmreg_mz,xmmreg,xmmreg_er                \334\350\352\362\370\1\x5A\75\120
 
 [VCVTSI2SD,vcvtsi2sdX]
 (Ch_Wop3, Ch_Rop2, Ch_Rop1)
-xmmreg,xmmreg_er,reg32                    \334\350\362\370\1\x2A\75\120             AVX,SANDYBRIDGE,SD
+xmmreg,xmmreg,reg32                       \334\350\362\370\1\x2A\75\120             AVX,SANDYBRIDGE,SD
 xmmreg,xmmreg,mem32                       \334\350\362\370\1\x2A\75\120             AVX,SANDYBRIDGE,SD,T1S
 xmmreg,xmmreg_er,reg64                    \334\350\352\362\363\370\1\x2A\75\120     AVX,SANDYBRIDGE,X86_64
-xmmreg,xmmreg,mem64                       \334\350\352\362\363\370\1\x2A\75\120     AVX,SANDYBRIDGE,X86_64,T1S
+xmmreg,xmmreg_er,mem64                    \334\350\352\362\363\370\1\x2A\75\120     AVX,SANDYBRIDGE,X86_64,T1S
 
 
 [VCVTSI2SS,vcvtsi2ssX]
 (Ch_Wop3, Ch_Rop2, Ch_Rop1)
-xmmreg,xmmreg_er,reg32                    \333\350\362\370\1\x2A\75\120             AVX,SANDYBRIDGE,SD
+xmmreg,xmmreg,reg32                       \333\350\362\370\1\x2A\75\120             AVX,SANDYBRIDGE,SD
 xmmreg,xmmreg,mem32                       \333\350\362\370\1\x2A\75\120             AVX,SANDYBRIDGE,SD,T1S
 xmmreg,xmmreg_er,reg64                    \333\350\352\362\363\370\1\x2A\75\120     AVX,SANDYBRIDGE,X86_64
 xmmreg,xmmreg_er,mem64                    \333\350\352\362\363\370\1\x2A\75\120     AVX,SANDYBRIDGE,X86_64,T1S
@@ -4287,7 +4290,7 @@ reg64,xmmreg_er                           \333\350\352\362\363\370\1\x2D\110
 
 ; VCVTTPD2DQ xmmreg_mz,mem256 must come first - map MemRefSize 256bits correct
 ;                                               map all other MemrefSize (without broasdcast MemRef) to xmmreg, xmmrm
-[VCVTTPD2DQ,vcvttpd2dqM]
+[VCVTTPD2DQ,vcvttpd2dqN]
 (Ch_Wop2, Ch_Rop1)
 xmmreg_mz,mem256                          \350\352\361\362\364\370\1\xE6\110        AVX,SANDYBRIDGE,AVX512,TFV
 xmmreg_mz,ymmreg                          \350\352\361\362\364\370\1\xE6\110        AVX,SANDYBRIDGE
@@ -4376,7 +4379,7 @@ xmmrm,ymmreg,imm8                    \361\362\364\372\1\x19\101\26        AVX,SA
 (Ch_All)
 mem32,xmmreg,imm8                         \350\361\362\372\1\x17\101\26             AVX,SANDYBRIDGE,T1S
 reg32,xmmreg,imm8                         \350\361\362\372\1\x17\101\26             AVX,SANDYBRIDGE
-reg64,xmmreg,imm8                         \350\361\372\1\x17\101\26                 AVX512
+reg64,xmmreg,imm8                         \350\361\362\372\1\x17\101\26             AVX512
 
 
 
@@ -5479,10 +5482,12 @@ ymmreg,ymmreg,ymmrm                  \361\362\364\371\1\x09\75\120        AVX2
 
 [VPSLLD]
 (Ch_Rop1, Ch_Rop2, Ch_Wop3)
-xmmreg_mz,xmmrm,imm8                      \350\361\362\370\1\x72\74\216\26          AVX,SANDYBRIDGE,TFV
+xmmreg_mz,xmmreg,imm8                     \350\361\362\370\1\x72\74\216\26          AVX,SANDYBRIDGE
+xmmreg_mz,mem128,imm8                     \350\361\370\1\x72\74\216\26              AVX512,TFV
 xmmreg_mz,bmem32,imm8                     \350\361\370\1\x72\74\216\26              AVX512,TFV
 xmmreg_mz,xmmreg,xmmrm                    \350\361\362\370\1\xF2\75\120             AVX,SANDYBRIDGE,TMEM128
-ymmreg_mz,ymmrm,imm8                      \350\361\362\364\370\1\x72\74\216\26      AVX2,TFV
+ymmreg_mz,ymmreg,imm8                     \350\361\362\364\370\1\x72\74\216\26      AVX2
+ymmreg_mz,mem256,imm8                     \350\361\364\370\1\x72\74\216\26          AVX512,TFV
 ymmreg_mz,bmem32,imm8                     \350\361\364\370\1\x72\74\216\26          AVX512,TFV
 ymmreg_mz,ymmreg,xmmrm                    \350\361\362\364\370\1\xF2\75\120         AVX2,TMEM128
 zmmreg_mz,zmmreg,xmmrm                    \350\351\361\370\1\xF2\75\120             AVX512,TMEM128
@@ -5503,10 +5508,12 @@ zmmreg,zmmreg,imm8                        \350\351\361\370\1\x73\74\217\26
 [VPSLLQ]
 (Ch_Rop1, Ch_Rop2, Ch_Wop3)
 xmmreg_mz,xmmreg,xmmrm                    \350\352\361\362\370\1\xF3\75\120         AVX,SANDYBRIDGE,TMEM128
-xmmreg_mz,xmmrm,imm8                      \350\352\361\362\370\1\x73\74\216\26      AVX,SANDYBRIDGE,TFV
+xmmreg_mz,xmmreg,imm8                     \350\352\361\362\370\1\x73\74\216\26      AVX,SANDYBRIDGE,TFV
+xmmreg_mz,mem128,imm8                     \350\352\361\370\1\x73\74\216\26          AVX512,TFV
 xmmreg_mz,bmem64,imm8                     \350\352\361\370\1\x73\74\216\26          AVX512,TFV
 ymmreg_mz,ymmreg,xmmrm                    \350\352\361\362\364\370\1\xF3\75\120     AVX2,TMEM128
-ymmreg_mz,ymmrm,imm8                      \350\352\361\362\364\370\1\x73\74\216\26  AVX2,TFV
+ymmreg_mz,ymmreg,imm8                     \350\352\361\362\364\370\1\x73\74\216\26  AVX2
+ymmreg_mz,mem256,imm8                     \350\352\361\364\370\1\x73\74\216\26      AVX512,TFV
 ymmreg_mz,bmem64,imm8                     \350\352\361\364\370\1\x73\74\216\26      AVX512,TFV
 zmmreg_mz,zmmreg,xmmrm                    \350\351\352\361\370\1\xF3\75\120         AVX512,TMEM128
 zmmreg_mz,zmmrm,imm8                      \350\351\352\361\370\1\x73\74\216\26      AVX512,TFV
@@ -5516,19 +5523,23 @@ zmmreg_mz,bmem64,imm8                     \350\351\352\361\370\1\x73\74\216\26
 [VPSLLW]
 (Ch_Rop1, Ch_Rop2, Ch_Wop3)
 xmmreg_mz,xmmreg,xmmrm                    \350\361\362\370\1\xF1\75\120             AVX,SANDYBRIDGE,TMEM128
-xmmreg_mz,xmmrm,imm8                      \350\361\362\370\1\x71\74\216\26          AVX,SANDYBRIDGE,TFVM
+xmmreg_mz,xmmreg,imm8                     \350\361\362\370\1\x71\74\216\26          AVX,SANDYBRIDGE
+xmmreg_mz,mem128,imm8                     \350\361\370\1\x71\74\216\26              AVX512,TFVM
 ymmreg_mz,ymmreg,xmmrm                    \350\361\362\364\370\1\xF1\75\120         AVX2,TMEM128
-ymmreg_mz,ymmrm,imm8                      \350\361\362\364\370\1\x71\74\216\26      AVX2,TFVM
+ymmreg_mz,ymmreg,imm8                     \350\361\362\364\370\1\x71\74\216\26      AVX2
+ymmreg_mz,mem256,imm8                     \350\361\364\370\1\x71\74\216\26          AVX512,TFVM
 zmmreg_mz,zmmreg,xmmrm                    \350\351\361\370\1\xF1\75\120             AVX512,TMEM128
 zmmreg_mz,zmmrm,imm8                      \350\351\361\370\1\x71\74\216\26          AVX512,TFVM
 
 
 [VPSRAD]
 (Ch_Rop1, Ch_Rop2, Ch_Wop3)
-xmmreg_mz,xmmrm,imm8                      \350\361\362\370\1\x72\74\214\26          AVX,SANDYBRIDGE,TFV
+xmmreg_mz,xmmreg,imm8                     \350\361\362\370\1\x72\74\214\26          AVX,SANDYBRIDGE
+xmmreg_mz,mem128,imm8                     \350\361\370\1\x72\74\214\26              AVX512,TFV
 xmmreg_mz,bmem32,imm8                     \350\361\370\1\x72\74\214\26              AVX512,TFV
 xmmreg_mz,xmmreg,xmmrm                    \350\361\362\370\1\xE2\75\120             AVX,SANDYBRIDGE,TMEM128
-ymmreg_mz,ymmrm,imm8                      \350\361\362\364\370\1\x72\74\214\26      AVX2,TFV
+ymmreg_mz,ymmreg,imm8                     \350\361\362\364\370\1\x72\74\214\26      AVX2
+ymmreg_mz,mem256,imm8                     \350\361\364\370\1\x72\74\214\26          AVX512,TFV
 ymmreg_mz,bmem32,imm8                     \350\361\364\370\1\x72\74\214\26          AVX512,TFV
 ymmreg_mz,ymmreg,xmmrm                    \350\361\362\364\370\1\xE2\75\120         AVX2,TMEM128
 zmmreg_mz,zmmreg,xmmrm                    \350\351\361\370\1\xE2\75\120             AVX512,TMEM128
@@ -5538,9 +5549,11 @@ zmmreg_mz,bmem32,imm8                     \350\351\361\370\1\x72\74\214\26
 
 [VPSRAW]
 (Ch_Rop1, Ch_Rop2, Ch_Wop3)
-xmmreg_mz,xmmrm,imm8                      \350\361\362\370\1\x71\74\214\26          AVX,SANDYBRIDGE,TFVM
+xmmreg_mz,xmmreg,imm8                     \350\361\362\370\1\x71\74\214\26          AVX,SANDYBRIDGE
+xmmreg_mz,mem128,imm8                     \350\361\370\1\x71\74\214\26              AVX512,TFVM
 xmmreg_mz,xmmreg,xmmrm                    \350\361\362\370\1\xE1\75\120             AVX,SANDYBRIDGE,TMEM128
-ymmreg_mz,ymmrm,imm8                      \350\361\362\364\370\1\x71\74\214\26      AVX2,TFVM
+ymmreg_mz,ymmreg,imm8                     \350\361\362\364\370\1\x71\74\214\26      AVX2
+ymmreg_mz,mem256,imm8                     \350\361\364\370\1\x71\74\214\26          AVX512,TFVM
 ymmreg_mz,ymmreg,xmmrm                    \350\361\362\364\370\1\xE1\75\120         AVX2,TMEM128
 zmmreg_mz,zmmreg,xmmrm                    \350\351\361\370\1\xE1\75\120             AVX512,TMEM128
 zmmreg_mz,zmmrm,imm8                      \350\351\361\370\1\x71\74\214\26          AVX512,TFVM
@@ -5548,11 +5561,13 @@ zmmreg_mz,zmmrm,imm8                      \350\351\361\370\1\x71\74\214\26
 
 [VPSRLD]
 (Ch_Rop1, Ch_Rop2, Ch_Wop3)
-xmmreg_mz,xmmrm,imm8                      \350\361\362\370\1\x72\74\212\26          AVX,SANDYBRIDGE,TFV
+xmmreg_mz,xmmreg,imm8                     \350\361\362\370\1\x72\74\212\26          AVX,SANDYBRIDGE
+xmmreg_mz,mem128,imm8                     \350\361\370\1\x72\74\212\26              AVX512,TFV
 xmmreg_mz,bmem32,imm8                     \350\361\370\1\x72\74\212\26              AVX512,TFV
 xmmreg_mz,xmmreg,xmmrm                    \350\361\362\370\1\xD2\75\120             AVX,SANDYBRIDGE,TMEM128
 ymmreg_mz,ymmreg,xmmrm                    \350\361\362\364\370\1\xD2\75\120         AVX2,TMEM128
-ymmreg_mz,ymmrm,imm8                      \350\361\362\364\370\1\x72\74\212\26      AVX2,TFV
+ymmreg_mz,ymmreg,imm8                     \350\361\362\364\370\1\x72\74\212\26      AVX2,TFV
+ymmreg_mz,mem256,imm8                     \350\361\364\370\1\x72\74\212\26      AVX2,TFV
 ymmreg_mz,bmem32,imm8                     \350\361\364\370\1\x72\74\212\26          AVX512,TFV
 zmmreg_mz,zmmreg,xmmrm                    \350\351\361\370\1\xD2\75\120             AVX512,TMEM128
 zmmreg_mz,zmmrm,imm8                      \350\351\361\370\1\x72\74\212\26          AVX512,TFV
@@ -5572,9 +5587,11 @@ zmmreg,zmmrm,imm8                         \350\351\361\370\1\x73\74\213\26
 [VPSRLQ]
 (Ch_Rop1, Ch_Rop2, Ch_Wop3)
 xmmreg_mz,xmmreg,xmmrm                    \350\352\361\362\370\1\xD3\75\120         AVX,SANDYBRIDGE,TMEM128
-xmmreg_mz,xmmrm,imm8                      \350\352\361\362\370\1\x73\74\212\26      AVX,SANDYBRIDGE,TFV
+xmmreg_mz,xmmreg,imm8                     \350\352\361\362\370\1\x73\74\212\26      AVX,SANDYBRIDGE
+xmmreg_mz,mem128,imm8                     \350\352\361\370\1\x73\74\212\26          AVX512,TFV
 xmmreg_mz,bmem64,imm8                     \350\352\361\370\1\x73\74\212\26          AVX512,TFV
-ymmreg_mz,ymmrm,imm8                      \350\352\361\362\364\370\1\x73\74\212\26  AVX2,TFV
+ymmreg_mz,ymmreg,imm8                     \350\352\361\362\364\370\1\x73\74\212\26  AVX2
+ymmreg_mz,mem256,imm8                     \350\352\361\364\370\1\x73\74\212\26      AVX512,TFV
 ymmreg_mz,bmem64,imm8                     \350\352\361\364\370\1\x73\74\212\26      AVX512,TFV
 ymmreg_mz,ymmreg,xmmrm                    \350\352\361\362\364\370\1\xD3\75\120     AVX2,TMEM128
 zmmreg_mz,zmmreg,xmmrm                    \350\351\352\361\370\1\xD3\75\120         AVX512,TMEM128
@@ -5584,9 +5601,11 @@ zmmreg_mz,bmem64,imm8                     \350\351\352\361\370\1\x73\74\212\26
 
 [VPSRLW]
 (Ch_Rop1, Ch_Rop2, Ch_Wop3)
-xmmreg_mz,xmmrm,imm8                      \350\361\362\370\1\x71\74\212\26          AVX,SANDYBRIDGE,TFVM
+xmmreg_mz,xmmreg,imm8                     \350\361\362\370\1\x71\74\212\26          AVX,SANDYBRIDGE
+xmmreg_mz,mem128,imm8                     \350\361\370\1\x71\74\212\26              AVX512,TFVM
 xmmreg_mz,xmmreg,xmmrm                    \350\361\362\370\1\xD1\75\120             AVX,SANDYBRIDGE,TMEM128
-ymmreg_mz,ymmrm,imm8                      \350\361\362\364\370\1\x71\74\212\26      AVX2,TFVM
+ymmreg_mz,ymmreg,imm8                     \350\361\362\364\370\1\x71\74\212\26      AVX2
+ymmreg_mz,mem256,imm8                     \350\361\364\370\1\x71\74\212\26          AVX512,TFVM
 ymmreg_mz,ymmreg,xmmrm                    \350\361\362\364\370\1\xD1\75\120         AVX2,TMEM128
 zmmreg_mz,zmmreg,xmmrm                    \350\351\361\370\1\xD1\75\120             AVX512,TMEM128
 zmmreg_mz,zmmrm,imm8                      \350\351\361\370\1\x71\74\212\26          AVX512,TFVM
@@ -6779,7 +6798,7 @@ zmmreg_mz,zmmreg,bmem32                   \350\351\361\371\1\xBC\75\120
 
 [VFNMADD231SD]
 (Ch_Mop3, Ch_Rop2, Ch_Rop1)
-xmmreg,xmmreg,xmmrm                       \337\361\362\363\371\1\xBD\75\120         FMA,T1S
+xmmreg,xmmreg,xmmrm                       \337\350\352\361\362\363\371\1\xBD\75\120 FMA,T1S
 xmmreg_mz,xmmreg,xmmreg_er                \350\352\361\362\363\371\1\xBD\75\120     FMA
 
 [VFNMADD231SS]
@@ -7305,7 +7324,7 @@ zmmreg_mz,mem512                          \350\351\352\361\370\1\x7B\110
 zmmreg_mz,bmem64                          \350\351\352\361\370\1\x7B\110            AVX512,TFV
 zmmreg_mz,zmmreg_er                       \350\351\352\361\370\1\x7B\110            AVX512
 
-[VCVTPD2UDQ]
+[VCVTPD2UDQ, vcvtpd2udqN]
 (Ch_Wop2, Ch_Rop1)
 xmmreg_mz,mem128                          \350\352\370\1\x79\110                    AVX512,TFV
 xmmreg_mz,mem256                          \350\352\364\370\1\x79\110                AVX512,TFV
@@ -7369,7 +7388,7 @@ zmmreg_mz,mem512                          \333\350\351\352\370\1\xE6\110
 zmmreg_mz,bmem64                          \333\350\351\352\370\1\xE6\110            AVX512,TFV
 zmmreg_mz,zmmreg_er                       \333\350\351\352\370\1\xE6\110            AVX512
 
-[VCVTQQ2PS]
+[VCVTQQ2PS,vcvtqq2psN]
 (Ch_Wop2, Ch_Rop1)
 xmmreg_mz,mem128                          \350\352\370\1\x5B\110                    AVX512,TFV
 xmmreg_mz,mem256                          \350\352\364\370\1\x5B\110                AVX512,TFV
@@ -7405,7 +7424,7 @@ zmmreg_mz,mem512                          \350\351\352\361\370\1\x7A\110
 zmmreg_mz,bmem64                          \350\351\352\361\370\1\x7A\110            AVX512,TFV
 zmmreg_mz,zmmreg_sae                      \350\351\352\361\370\1\x7A\110            AVX512
 
-[VCVTTPD2UDQ]
+[VCVTTPD2UDQ,vcvttpd2udqN]
 (Ch_Wop2, Ch_Rop1)
 xmmreg_mz,mem128                          \350\352\370\1\x78\110                    AVX512,TFV
 xmmreg_mz,mem256                          \350\352\364\370\1\x78\110                AVX512,TFV
@@ -7482,7 +7501,7 @@ ymmreg_mz,xmmrm                           \333\350\364\370\1\x7A\110
 ymmreg_mz,bmem32                          \333\350\364\370\1\x7A\110                AVX512,BCST4,THV
 zmmreg_mz,mem256                          \333\350\351\370\1\x7A\110                AVX512,THV
 zmmreg_mz,bmem32                          \333\350\351\370\1\x7A\110                AVX512,BCST8,THV
-zmmreg_mz,ymmreg_er                       \333\350\351\370\1\x7A\110                AVX512
+zmmreg_mz,ymmreg                          \333\350\351\370\1\x7A\110                AVX512
 
 [VCVTUDQ2PS]
 (Ch_Wop2, Ch_Rop1)
@@ -7504,7 +7523,7 @@ zmmreg_mz,mem512                          \333\350\351\352\370\1\x7A\110
 zmmreg_mz,bmem64                          \333\350\351\352\370\1\x7A\110            AVX512,TFV
 zmmreg_mz,zmmreg_er                       \333\350\351\352\370\1\x7A\110            AVX512
 
-[VCVTUQQ2PS]
+[VCVTUQQ2PS,vcvtuqq2psN]
 (Ch_Wop2, Ch_Rop1)
 xmmreg_mz,mem128                          \334\350\352\370\1\x7A\110                AVX512,TFV
 xmmreg_mz,mem256                          \334\350\352\364\370\1\x7A\110            AVX512,TFV
@@ -7516,12 +7535,13 @@ ymmreg_mz,mem512                          \334\350\351\352\370\1\x7A\110
 ymmreg_mz,bmem64                          \334\350\351\352\370\1\x7A\110            AVX512,BCST8,TFV
 ymmreg_mz,zmmreg_er                       \334\350\351\352\370\1\x7A\110            AVX512
 
-[VCVTUSI2SD]
+[VCVTUSI2SD,vcvtusi2sdX]
 (Ch_Wop2, Ch_Rop1)
-xmmreg,xmmreg_er,rm64                     \334\350\352\370\1\x7B\75\120                AVX512,T1S
+xmmreg,xmmreg_er,mem64                     \334\350\352\370\1\x7B\75\120               AVX512,T1S
+xmmreg,xmmreg_er,reg64                     \334\350\352\370\1\x7B\75\120               AVX512
 xmmreg,xmmreg_er,rm32                     \334\350\370\1\x7B\75\120                    AVX512,T1S
 
-[VCVTUSI2SS]
+[VCVTUSI2SS,vcvtusi2ssX]
 (Ch_Wop2, Ch_Rop1)
 xmmreg,xmmreg_er,rm64                     \333\350\352\370\1\x7B\75\120                AVX512,T1S
 xmmreg,xmmreg_er,rm32                     \333\350\370\1\x7B\75\120                    AVX512,T1S
@@ -7641,22 +7661,30 @@ xmmreg_mz,xmmreg,mem32,imm8               \350\361\372\1\x55\75\120\27
 xmmreg_mz,xmmreg,xmmreg_sae,imm8          \350\361\372\1\x55\75\120\27              AVX512
 
 
-[VFPCLASSPD]
+; VFPCLASSPD kreg_m,mem256 and mem512 must come first - map MemRefSize 256,512bits correct
+;                                              map all other MemrefSize (without broasdcast MemRef) to kreg_m, xmmrm
+[VFPCLASSPD,vfpclasspdX]
 (Ch_All)
+kreg_m,mem256,imm8                        \350\352\361\364\372\1\x66\110\26         AVX512,TFV
+kreg_m,mem512,imm8                        \350\351\352\361\372\1\x66\110\26         AVX512,TFV
 kreg_m,xmmrm,imm8                         \350\352\361\372\1\x66\110\26             AVX512,TFV
 kreg_m,bmem64,imm8                        \350\352\361\372\1\x66\110\26             AVX512,BCST2,TFV
-kreg_m,ymmrm,imm8                         \350\352\361\364\372\1\x66\110\26         AVX512,TFV
+kreg_m,ymmreg,imm8                        \350\352\361\364\372\1\x66\110\26         AVX512
 kreg_m,bmem64,imm8                        \350\352\361\364\372\1\x66\110\26         AVX512,BCST4,TFV
-kreg_m,zmmrm,imm8                         \350\351\352\361\372\1\x66\110\26         AVX512,TFV
+kreg_m,zmmreg,imm8                        \350\351\352\361\372\1\x66\110\26         AVX512
 kreg_m,bmem64,imm8                        \350\351\352\361\372\1\x66\110\26         AVX512,BCST8,TFV
 
-[VFPCLASSPS]
+; VFPCLASSPS kreg_m,mem256 and mem512 must come first - map MemRefSize 256,512bits correct
+;                                              map all other MemrefSize (without broasdcast MemRef) to kreg_m, xmmrm
+[VFPCLASSPS,vfpclasspsX]
 (Ch_All)
+kreg_m,mem256,imm8                        \350\361\364\372\1\x66\110\26             AVX512,TFV
+kreg_m,mem512,imm8                        \350\351\361\372\1\x66\110\26             AVX512,TFV
 kreg_m,xmmrm,imm8                         \350\361\372\1\x66\110\26                 AVX512,TFV
 kreg_m,bmem32,imm8                        \350\361\372\1\x66\110\26                 AVX512,BCST4,TFV
-kreg_m,ymmrm,imm8                         \350\361\364\372\1\x66\110\26             AVX512,TFV
+kreg_m,ymmreg,imm8                        \350\361\364\372\1\x66\110\26             AVX512
 kreg_m,bmem32,imm8                        \350\361\364\372\1\x66\110\26             AVX512,BCST8,TFV
-kreg_m,zmmrm,imm8                         \350\351\361\372\1\x66\110\26             AVX512,TFV
+kreg_m,zmmreg,imm8                        \350\351\361\372\1\x66\110\26             AVX512
 kreg_m,bmem32,imm8                        \350\351\361\372\1\x66\110\26             AVX512,BCST16,TFV
 
 [VFPCLASSSD]
@@ -8946,18 +8974,18 @@ zmmreg_mz,zmmreg,bmem64,imm8              \350\351\352\361\372\1\x43\75\120\27
 
 [VPCOMPRESSB]
 (Ch_All)
-mem128_m,xmmreg                           \350\361\371\1\x63\101                    AVX512,T1S
-mem256_m,ymmreg                           \350\361\364\371\1\x63\101                AVX512,T1S
-mem512_m,zmmreg                           \350\351\361\371\1\x63\101                AVX512,T1S
+mem128_m,xmmreg                           \350\361\371\1\x63\101                    AVX512,T1S8
+mem256_m,ymmreg                           \350\361\364\371\1\x63\101                AVX512,T1S8
+mem512_m,zmmreg                           \350\351\361\371\1\x63\101                AVX512,T1S8
 xmmreg_mz,xmmreg                          \350\361\371\1\x63\101                    AVX512
 ymmreg_mz,ymmreg                          \350\361\364\371\1\x63\101                AVX512
 zmmreg_mz,zmmreg                          \350\351\361\371\1\x63\101                AVX512
 
 [VPCOMPRESSW]
 (Ch_All)
-mem128_m,xmmreg                           \350\352\361\371\1\x63\101                AVX512,T1S
-mem256_m,ymmreg                           \350\352\361\364\371\1\x63\101            AVX512,T1S
-mem512_m,zmmreg                           \350\351\352\361\371\1\x63\101            AVX512,T1S
+mem128_m,xmmreg                           \350\352\361\371\1\x63\101                AVX512,T1S16
+mem256_m,ymmreg                           \350\352\361\364\371\1\x63\101            AVX512,T1S16
+mem512_m,zmmreg                           \350\351\352\361\371\1\x63\101            AVX512,T1S16
 xmmreg_mz,xmmreg                          \350\352\361\371\1\x63\101                AVX512
 ymmreg_mz,ymmreg                          \350\352\361\364\371\1\x63\101            AVX512
 zmmreg_mz,zmmreg                          \350\351\352\361\371\1\x63\101            AVX512
@@ -9000,21 +9028,21 @@ zmmreg_mz,zmmreg,bmem32                   \350\351\361\371\1\x53\75\120
 
 [VPEXPANDB]
 (Ch_All)
-mem128_m,xmmreg                           \350\361\371\1\x62\101                    AVX512,T1S
-mem256_m,ymmreg                           \350\361\364\371\1\x62\101                AVX512,T1S
-mem512_m,zmmreg                           \350\351\361\371\1\x62\101                AVX512,T1S
-xmmreg_mz,xmmreg                          \350\361\371\1\x62\101                    AVX512
-ymmreg_mz,ymmreg                          \350\361\364\371\1\x62\101                AVX512
-zmmreg_mz,zmmreg                          \350\351\361\371\1\x62\101                AVX512
+xmmreg_mz,mem128                          \350\361\371\1\x62\110                    AVX512,T1S8
+ymmreg_mz,mem256                          \350\361\364\371\1\x62\110                AVX512,T1S8
+zmmreg_mz,mem512                          \350\351\361\371\1\x62\110                AVX512,T1S8
+xmmreg_mz,xmmreg                          \350\361\371\1\x62\110                    AVX512
+ymmreg_mz,ymmreg                          \350\361\364\371\1\x62\110                AVX512
+zmmreg_mz,zmmreg                          \350\351\361\371\1\x62\110                AVX512
 
 [VPEXPANDW]
 (Ch_All)
-mem128_m,xmmreg                           \350\352\361\371\1\x62\101                AVX512,T1S
-mem256_m,ymmreg                           \350\352\361\364\371\1\x62\101            AVX512,T1S
-mem512_m,zmmreg                           \350\351\352\361\371\1\x62\101            AVX512,T1S
-xmmreg_mz,xmmreg                          \350\352\361\371\1\x62\101                AVX512
-ymmreg_mz,ymmreg                          \350\352\361\364\371\1\x62\101            AVX512
-zmmreg_mz,zmmreg                          \350\351\352\361\371\1\x62\101            AVX512
+xmmreg_mz,mem128                          \350\352\361\371\1\x62\110                AVX512,T1S16
+ymmreg_mz,mem256                          \350\352\361\364\371\1\x62\110            AVX512,T1S16
+zmmreg_mz,mem512                          \350\351\352\361\371\1\x62\110            AVX512,T1S16
+xmmreg_mz,xmmreg                          \350\352\361\371\1\x62\110                AVX512
+ymmreg_mz,ymmreg                          \350\352\361\364\371\1\x62\110            AVX512
+zmmreg_mz,zmmreg                          \350\351\352\361\371\1\x62\110            AVX512
 
 [VPOPCNTB]
 (Ch_All)

+ 2 - 0
compiler/x86_64/aoptcpu.pas

@@ -129,6 +129,8 @@ uses
                   result:=OptPass1FLD(p);
                 A_CMP:
                   result:=OptPass1Cmp(p);
+                A_VPXORD,
+                A_VPXORQ,
                 A_VXORPS,
                 A_VXORPD,
                 A_VPXOR:

+ 11 - 11
compiler/x86_64/x8664ats.inc

@@ -777,8 +777,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufMM,
-attsufMM,
+attsufMMX,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -789,7 +789,7 @@ attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
-attsufMM,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1197,14 +1197,17 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1214,6 +1217,9 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufMMX,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1231,14 +1237,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,

+ 1 - 1
compiler/x86_64/x8664att.inc

@@ -1197,7 +1197,7 @@
 'vcompresspd',
 'vcompressps',
 'vcvtpd2qq',
-'vcvtpd2udq',
+' vcvtpd2udq',
 'vcvtpd2uqq',
 'vcvtps2qq',
 'vcvtps2udq',

+ 1 - 1
compiler/x86_64/x8664nop.inc

@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-4214;
+4236;

+ 232 - 78
compiler/x86_64/x8664tab.inc

@@ -10734,7 +10734,7 @@
   (
     opcode  : A_VCVTDQ2PD;
     ops     : 2;
-    optypes : (ot_zmmreg_mz,ot_ymmreg_er,ot_none,ot_none);
+    optypes : (ot_zmmreg_mz,ot_ymmreg,ot_none,ot_none);
     code    : #219#232#233#248#1#230#72;
     flags   : [if_avx512]
   ),
@@ -10794,6 +10794,13 @@
     code    : #232#233#248#1#91#72;
     flags   : [if_avx512]
   ),
+  (
+    opcode  : A_VCVTPD2DQ;
+    ops     : 2;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits256,ot_none,ot_none);
+    code    : #220#232#234#242#244#248#1#230#72;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
   (
     opcode  : A_VCVTPD2DQ;
     ops     : 2;
@@ -10804,9 +10811,9 @@
   (
     opcode  : A_VCVTPD2DQ;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_ymmrm,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_ymmreg,ot_none,ot_none);
     code    : #220#232#234#242#244#248#1#230#72;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
   ),
   (
     opcode  : A_VCVTPD2DQ;
@@ -11133,7 +11140,7 @@
   (
     opcode  : A_VCVTSI2SD;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
     code    : #220#232#242#248#1#42#61#80;
     flags   : [if_avx,if_sandybridge,if_sd]
   ),
@@ -11154,14 +11161,14 @@
   (
     opcode  : A_VCVTSI2SD;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg,ot_memory or ot_bits64,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
     code    : #220#232#234#242#243#248#1#42#61#80;
     flags   : [if_avx,if_sandybridge,if_x86_64,if_t1s]
   ),
   (
     opcode  : A_VCVTSI2SS;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
     code    : #219#232#242#248#1#42#61#80;
     flags   : [if_avx,if_sandybridge,if_sd]
   ),
@@ -11561,7 +11568,7 @@
     opcode  : A_VEXTRACTPS;
     ops     : 3;
     optypes : (ot_reg64,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
-    code    : #232#241#250#1#23#65#22;
+    code    : #232#241#242#250#1#23#65#22;
     flags   : [if_avx512]
   ),
   (
@@ -15382,9 +15389,16 @@
   (
     opcode  : A_VPSLLD;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#114#60#142#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSLLD;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#114#60#142#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSLLD;
@@ -15403,9 +15417,16 @@
   (
     opcode  : A_VPSLLD;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#114#60#142#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSLLD;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#114#60#142#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSLLD;
@@ -15494,10 +15515,17 @@
   (
     opcode  : A_VPSLLQ;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#248#1#115#60#142#22;
     flags   : [if_avx,if_sandybridge,if_tfv]
   ),
+  (
+    opcode  : A_VPSLLQ;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#248#1#115#60#142#22;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
     opcode  : A_VPSLLQ;
     ops     : 3;
@@ -15515,9 +15543,16 @@
   (
     opcode  : A_VPSLLQ;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#244#248#1#115#60#142#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSLLQ;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#244#248#1#115#60#142#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSLLQ;
@@ -15557,9 +15592,16 @@
   (
     opcode  : A_VPSLLW;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#113#60#142#22;
-    flags   : [if_avx,if_sandybridge,if_tfvm]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSLLW;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#113#60#142#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSLLW;
@@ -15571,9 +15613,16 @@
   (
     opcode  : A_VPSLLW;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#113#60#142#22;
-    flags   : [if_avx2,if_tfvm]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSLLW;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#113#60#142#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSLLW;
@@ -15592,9 +15641,16 @@
   (
     opcode  : A_VPSRAD;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#114#60#140#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRAD;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#114#60#140#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRAD;
@@ -15613,9 +15669,16 @@
   (
     opcode  : A_VPSRAD;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#114#60#140#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRAD;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#114#60#140#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRAD;
@@ -15655,9 +15718,16 @@
   (
     opcode  : A_VPSRAW;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#113#60#140#22;
-    flags   : [if_avx,if_sandybridge,if_tfvm]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRAW;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#113#60#140#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRAW;
@@ -15669,9 +15739,16 @@
   (
     opcode  : A_VPSRAW;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#113#60#140#22;
-    flags   : [if_avx2,if_tfvm]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRAW;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#113#60#140#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRAW;
@@ -15697,9 +15774,16 @@
   (
     opcode  : A_VPSRLD;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#114#60#138#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRLD;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#114#60#138#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRLD;
@@ -15725,10 +15809,17 @@
   (
     opcode  : A_VPSRLD;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#114#60#138#22;
     flags   : [if_avx2,if_tfv]
   ),
+  (
+    opcode  : A_VPSRLD;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#114#60#138#22;
+    flags   : [if_avx2,if_tfv]
+  ),
   (
     opcode  : A_VPSRLD;
     ops     : 3;
@@ -15802,9 +15893,16 @@
   (
     opcode  : A_VPSRLQ;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#248#1#115#60#138#22;
-    flags   : [if_avx,if_sandybridge,if_tfv]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRLQ;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#248#1#115#60#138#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRLQ;
@@ -15816,9 +15914,16 @@
   (
     opcode  : A_VPSRLQ;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#242#244#248#1#115#60#138#22;
-    flags   : [if_avx2,if_tfv]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRLQ;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#244#248#1#115#60#138#22;
+    flags   : [if_avx512,if_tfv]
   ),
   (
     opcode  : A_VPSRLQ;
@@ -15858,9 +15963,16 @@
   (
     opcode  : A_VPSRLW;
     ops     : 3;
-    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#248#1#113#60#138#22;
-    flags   : [if_avx,if_sandybridge,if_tfvm]
+    flags   : [if_avx,if_sandybridge]
+  ),
+  (
+    opcode  : A_VPSRLW;
+    ops     : 3;
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#248#1#113#60#138#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRLW;
@@ -15872,9 +15984,16 @@
   (
     opcode  : A_VPSRLW;
     ops     : 3;
-    optypes : (ot_ymmreg_mz,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_ymmreg_mz,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#242#244#248#1#113#60#138#22;
-    flags   : [if_avx2,if_tfvm]
+    flags   : [if_avx2]
+  ),
+  (
+    opcode  : A_VPSRLW;
+    ops     : 3;
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#248#1#113#60#138#22;
+    flags   : [if_avx512,if_tfvm]
   ),
   (
     opcode  : A_VPSRLW;
@@ -20206,7 +20325,7 @@
     opcode  : A_VFNMADD231SD;
     ops     : 3;
     optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
-    code    : #223#241#242#243#249#1#189#61#80;
+    code    : #223#232#234#241#242#243#249#1#189#61#80;
     flags   : [if_fma,if_t1s]
   ),
   (
@@ -22501,7 +22620,7 @@
   (
     opcode  : A_VCVTUDQ2PD;
     ops     : 2;
-    optypes : (ot_zmmreg_mz,ot_ymmreg_er,ot_none,ot_none);
+    optypes : (ot_zmmreg_mz,ot_ymmreg,ot_none,ot_none);
     code    : #219#232#233#248#1#122#72;
     flags   : [if_avx512]
   ),
@@ -22669,10 +22788,17 @@
   (
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_rm_gpr or ot_bits64,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
     code    : #220#232#234#248#1#123#61#80;
     flags   : [if_avx512,if_t1s]
   ),
+  (
+    opcode  : A_VCVTUSI2SD;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg64,ot_none);
+    code    : #220#232#234#248#1#123#61#80;
+    flags   : [if_avx512]
+  ),
   (
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
@@ -23135,6 +23261,20 @@
     code    : #232#241#250#1#85#61#80#23;
     flags   : [if_avx512]
   ),
+  (
+    opcode  : A_VFPCLASSPD;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#234#241#244#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VFPCLASSPD;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits512,ot_immediate or ot_bits8,ot_none);
+    code    : #232#233#234#241#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
     opcode  : A_VFPCLASSPD;
     ops     : 3;
@@ -23152,9 +23292,9 @@
   (
     opcode  : A_VFPCLASSPD;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#234#241#244#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPD;
@@ -23166,9 +23306,9 @@
   (
     opcode  : A_VFPCLASSPD;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_zmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_zmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#233#234#241#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPD;
@@ -23177,6 +23317,20 @@
     code    : #232#233#234#241#250#1#102#72#22;
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
+  (
+    opcode  : A_VFPCLASSPS;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits256,ot_immediate or ot_bits8,ot_none);
+    code    : #232#241#244#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VFPCLASSPS;
+    ops     : 3;
+    optypes : (ot_kreg_m,ot_memory or ot_bits512,ot_immediate or ot_bits8,ot_none);
+    code    : #232#233#241#250#1#102#72#22;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
     opcode  : A_VFPCLASSPS;
     ops     : 3;
@@ -23194,9 +23348,9 @@
   (
     opcode  : A_VFPCLASSPS;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_ymmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_ymmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#241#244#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPS;
@@ -23208,9 +23362,9 @@
   (
     opcode  : A_VFPCLASSPS;
     ops     : 3;
-    optypes : (ot_kreg_m,ot_zmmrm,ot_immediate or ot_bits8,ot_none);
+    optypes : (ot_kreg_m,ot_zmmreg,ot_immediate or ot_bits8,ot_none);
     code    : #232#233#241#250#1#102#72#22;
-    flags   : [if_avx512,if_tfv]
+    flags   : [if_avx512]
   ),
   (
     opcode  : A_VFPCLASSPS;
@@ -28642,21 +28796,21 @@
     ops     : 2;
     optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
     code    : #232#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPCOMPRESSB;
     ops     : 2;
     optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
     code    : #232#241#244#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPCOMPRESSB;
     ops     : 2;
     optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
     code    : #232#233#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPCOMPRESSB;
@@ -28684,21 +28838,21 @@
     ops     : 2;
     optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
     code    : #232#234#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPCOMPRESSW;
     ops     : 2;
     optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
     code    : #232#234#241#244#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPCOMPRESSW;
     ops     : 2;
     optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
     code    : #232#233#234#241#249#1#99#65;
-    flags   : [if_avx512,if_t1s]
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPCOMPRESSW;
@@ -28892,85 +29046,85 @@
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
-    optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
-    code    : #232#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
+    code    : #232#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
-    optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
-    code    : #232#241#244#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_none,ot_none);
+    code    : #232#241#244#249#1#98#72;
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
-    optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_zmmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    code    : #232#233#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s8]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
     optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
-    code    : #232#241#249#1#98#65;
+    code    : #232#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
     optypes : (ot_ymmreg_mz,ot_ymmreg,ot_none,ot_none);
-    code    : #232#241#244#249#1#98#65;
+    code    : #232#241#244#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDB;
     ops     : 2;
     optypes : (ot_zmmreg_mz,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#241#249#1#98#65;
+    code    : #232#233#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
-    optypes : (ot_mem128_m,ot_xmmreg,ot_none,ot_none);
-    code    : #232#234#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
+    code    : #232#234#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
-    optypes : (ot_mem256_m,ot_ymmreg,ot_none,ot_none);
-    code    : #232#234#241#244#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_ymmreg_mz,ot_memory or ot_bits256,ot_none,ot_none);
+    code    : #232#234#241#244#249#1#98#72;
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
-    optypes : (ot_mem512_m,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#234#241#249#1#98#65;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_zmmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    code    : #232#233#234#241#249#1#98#72;
+    flags   : [if_avx512,if_t1s16]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
     optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
-    code    : #232#234#241#249#1#98#65;
+    code    : #232#234#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
     optypes : (ot_ymmreg_mz,ot_ymmreg,ot_none,ot_none);
-    code    : #232#234#241#244#249#1#98#65;
+    code    : #232#234#241#244#249#1#98#72;
     flags   : [if_avx512]
   ),
   (
     opcode  : A_VPEXPANDW;
     ops     : 2;
     optypes : (ot_zmmreg_mz,ot_zmmreg,ot_none,ot_none);
-    code    : #232#233#234#241#249#1#98#65;
+    code    : #232#233#234#241#249#1#98#72;
     flags   : [if_avx512]
   ),
   (

+ 1 - 1
packages/bzip2/fpmake.pp

@@ -28,7 +28,7 @@ begin
     P.Email := '';
     P.Description := 'BZip2 decompression unit.';
     P.NeedLibC:= true;
-    P.OSes := P.OSes - [embedded,nativent,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes := P.OSes - [embedded,nativent,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/chm/fpmake.pp

@@ -25,7 +25,7 @@ begin
     P.Email := '';
     P.Description := 'Standalone CHM reader and writer library';
     P.NeedLibC:= false;
-    P.OSes := P.OSes - [embedded,nativent,msdos,win16,macosclassic,palmos,atari,zxspectrum,msxdos,amstradcpc,watcom];
+    P.OSes := P.OSes - [embedded,nativent,msdos,win16,macosclassic,palmos,atari,zxspectrum,msxdos,amstradcpc,watcom,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-base/fpmake.pp

@@ -26,7 +26,7 @@ begin
     P.Email := '';
     P.Description := 'Base library of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-db/fpmake.pp

@@ -32,7 +32,7 @@ begin
     P.Email := '';
     P.Description := 'Database library of Free Component Libraries(FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 6 - 6
packages/fcl-db/src/base/sqlscript.pp

@@ -92,12 +92,12 @@ type
   protected
     property Aborted: Boolean read FAborted;
     property Line: Integer read GetLine;
-    Property AutoCommit : Boolean Read FAutoCommit Write FAutoCommit;
-    property CommentsInSQL: Boolean read FCommentsInSQL write FCommentsInSQL;
-    property UseSetTerm: Boolean read FUseSetTerm write FUseSetTerm;
-    property UseCommit: Boolean read FUseCommit write FUseCommit;
-    property UseDefines: Boolean read FUseDefines write FUseDefines;
-    Property UseDollarString : Boolean Read FUseDollarString Write SetUseDollarString;
+    Property AutoCommit : Boolean Read FAutoCommit Write FAutoCommit default false;
+    property CommentsInSQL: Boolean read FCommentsInSQL write FCommentsInSQL default true;
+    property UseSetTerm: Boolean read FUseSetTerm write FUseSetTerm default true;
+    property UseCommit: Boolean read FUseCommit write FUseCommit Default true;
+    property UseDefines: Boolean read FUseDefines write FUseDefines default true;
+    Property UseDollarString : Boolean Read FUseDollarString Write SetUseDollarString default false;
     Property DollarStrings : TStrings Read FDollarStrings Write SetDollarStrings;
     property Defines : TStrings Read FDefines Write SetDefines;
     property Directives: TStrings read FDirectives write SetDirectives;

+ 12 - 4
packages/fcl-db/src/sqldb/interbase/ibconnection.pp

@@ -41,7 +41,7 @@ type
   { TIBCursor }
 
   TIBCursor = Class(TSQLCursor)
-    protected
+  protected
     Status               : TStatusVector;
     TransactionHandle    : pointer;
     StatementHandle      : pointer;
@@ -784,6 +784,7 @@ begin
     begin
     AllocSQLDA(SQLDA,-1);
     AllocSQLDA(in_SQLDA,-1);
+    SetLength(FieldBinding,0);
     end;
   FreeAndNil(cursor);
 end;
@@ -900,6 +901,7 @@ procedure TIBConnection.UnPrepareStatement(cursor : TSQLCursor);
 
 begin
   with cursor as TIBcursor do
+  begin
     if assigned(StatementHandle) Then
       begin
         if isc_dsql_free_statement(@Status[0], @StatementHandle, DSQL_Drop) <> 0 then
@@ -907,6 +909,9 @@ begin
         StatementHandle := nil;
         FPrepared := False;
       end;
+    FreeSQLDABuffer(SQLDA);
+    FreeSQLDABuffer(in_SQLDA);
+  end;
 end;
 
 procedure TIBConnection.FreeSQLDABuffer(var aSQLDA : PXSQLDA);
@@ -917,6 +922,7 @@ begin
 {$push}
 {$R-}
   if assigned(aSQLDA) then
+    begin
     for x := 0 to aSQLDA^.SQLN - 1 do
       begin
       reAllocMem(aSQLDA^.SQLVar[x].SQLData,0);
@@ -926,6 +932,7 @@ begin
         aSQLDA^.SQLVar[x].sqlind := nil;
         end
       end;
+    end;
 {$pop}
 end;
 
@@ -950,9 +957,8 @@ procedure TIBConnection.FreeFldBuffers(cursor : TSQLCursor);
 begin
   with cursor as TIBCursor do
     begin
-    FreeSQLDABuffer(SQLDA);
-    FreeSQLDABuffer(in_SQLDA);
-    SetLength(FieldBinding,0);
+    if isc_dsql_free_statement(@Status, @StatementHandle, DSQL_close)<>0 then
+      CheckError('Close Cursor', Status);
     end;
 end;
 
@@ -972,6 +978,8 @@ begin
       out_SQLDA := nil;
     if isc_dsql_execute2(@Status[0], @TransactionHandle, @StatementHandle, 1, in_SQLDA, out_SQLDA) <> 0 then
       CheckError('Execute', Status);
+    if isc_dsql_set_cursor_name(@Status[0], @StatementHandle, 'sqldbcursor', 0) <> 0 then
+      CheckError('Open Cursor', Status);
   end;
 end;
 

+ 1 - 1
packages/fcl-fpcunit/fpmake.pp

@@ -30,7 +30,7 @@ begin
     P.Email := '';
     P.Description := 'Unit testing system inspired by JUnit of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes := P.OSes - [embedded,nativent,msdos,win16,macosclassic,palmos,symbian,zxspectrum,msxdos,amstradcpc];
+    P.OSes := P.OSes - [embedded,nativent,msdos,win16,macosclassic,palmos,symbian,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-image/fpmake.pp

@@ -28,7 +28,7 @@ begin
     P.Email := '';
     P.Description := 'Image loading and conversion parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes := P.OSes - [embedded,nativent,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes := P.OSes - [embedded,nativent,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-js/fpmake.pp

@@ -23,7 +23,7 @@ begin
     P.HomepageURL := 'www.freepascal.org';
     P.Email := '[email protected]';
     P.Description := 'Javascript scanner/parser/syntax tree units';
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-json/fpmake.pp

@@ -26,7 +26,7 @@ begin
     P.Email := '';
     P.Description := 'Json interfacing, part of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-net/fpmake.pp

@@ -30,7 +30,7 @@ begin
     P.Email := '';
     P.Description := 'Network related parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=P.OSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=P.OSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-passrc/fpmake.pp

@@ -25,7 +25,7 @@ begin
     P.Email := '';
     P.Description := 'Pascal parsing parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 2 - 0
packages/fcl-passrc/src/pasresolveeval.pas

@@ -207,6 +207,7 @@ const
   nParamOfThisTypeCannotHaveDefVal = 3141;
   nClassTypesAreNotRelatedXY = 3142;
   nDirectiveXNotAllowedHere = 3143;
+  nAwaitWithoutPromise = 3144;
 
   // using same IDs as FPC
   nVirtualMethodXHasLowerVisibility = 3250; // was 3050
@@ -361,6 +362,7 @@ resourcestring
   sParamOfThisTypeCannotHaveDefVal = 'Parameters of this type cannot have default values';
   sClassTypesAreNotRelatedXY = 'Class types "%s" and "%s" are not related';
   sDirectiveXNotAllowedHere = 'Directive "%s" not allowed here';
+  sAwaitWithoutPromise = 'Await without promise';
 
 type
   { TResolveData - base class for data stored in TPasElement.CustomData }

+ 11 - 3
packages/fcl-passrc/src/pasresolver.pp

@@ -4849,7 +4849,9 @@ begin
     begin
     Bin:=TBinaryExpr(El);
     if Bin.OpCode=eopSubIdent then
-      El:=Bin.right;
+      El:=Bin.right
+    else
+      exit(nil);
     end;
   if (El is TPrimitiveExpr) and (TPrimitiveExpr(El).Kind=pekIdent) then
     Result:=El;
@@ -25829,7 +25831,7 @@ begin
       end;
     if (Param.ArgType=nil) then
       exit(cExact); // untyped argument
-    if (ParamResolved.BaseType=ExprResolved.BaseType) then
+    if GetActualBaseType(ParamResolved.BaseType)=GetActualBaseType(ExprResolved.BaseType) then
       begin
       if msDelphi in CurrentParser.CurrentModeswitches then
         begin
@@ -27921,6 +27923,8 @@ end;
 
 function TPasResolver.IsSameType(TypeA, TypeB: TPasType;
   ResolveAlias: TPRResolveAlias): boolean;
+var
+  btA, btB: TResolverBaseType;
 begin
   if (TypeA=nil) or (TypeB=nil) then exit(false);
   case ResolveAlias of
@@ -27939,7 +27943,11 @@ begin
   if (TypeA.ClassType=TPasUnresolvedSymbolRef)
       and (TypeB.ClassType=TPasUnresolvedSymbolRef) then
     begin
-    Result:=CompareText(TypeA.Name,TypeB.Name)=0;
+    if CompareText(TypeA.Name,TypeB.Name)=0 then
+      exit(true);
+    btA:=TResElDataBaseType(TypeA.CustomData).BaseType;
+    btB:=TResElDataBaseType(TypeB.CustomData).BaseType;
+    Result:=GetActualBaseType(btA)=GetActualBaseType(btB);
     exit;
     end;
   Result:=false;

+ 3 - 8
packages/fcl-passrc/src/pasuseanalyzer.pas

@@ -3159,15 +3159,10 @@ begin
 end;
 
 function TPasAnalyzer.IsSpecializedGenericType(El: TPasElement): boolean;
-var
-  GenScope: TPasGenericScope;
 begin
-  if El is TPasGenericType then
-    begin
-    GenScope:=El.CustomData as TPasGenericScope;
-    if (GenScope<>nil) and (GenScope.SpecializedFromItem<>nil) then
-      exit(true);
-    end;
+  if (El is TPasGenericType) and (El.CustomData is TPasGenericScope)
+      and (TPasGenericScope(El.CustomData).SpecializedFromItem<>nil) then
+    exit(true);
   Result:=false;
 end;
 

+ 3 - 0
packages/fcl-passrc/src/pparser.pp

@@ -3060,6 +3060,7 @@ begin
   FCurModule:=Module;
   HasFinished:=true;
   try
+    Scanner.CurModuleName:=AUnitName;
     if Assigned(Engine.Package) then
       begin
       Module.PackageName := Engine.Package.Name;
@@ -3231,6 +3232,7 @@ begin
   HasFinished:=true;
   FCurModule:=Module;
   try
+    Scanner.CurModuleName:=N;
     if Assigned(Engine.Package) then
     begin
       Module.PackageName := Engine.Package.Name;
@@ -3307,6 +3309,7 @@ begin
   HasFinished:=true;
   FCurModule:=Module;
   try
+    Scanner.CurModuleName:=N;
     if Assigned(Engine.Package) then
     begin
       Module.PackageName := Engine.Package.Name;

+ 6 - 2
packages/fcl-passrc/src/pscanner.pp

@@ -656,7 +656,8 @@ type
     po_ExtConstWithoutExpr,  // allow typed const without expression in external class and with external modifier
     po_StopOnUnitInterface,  // parse only a unit name and stop at interface keyword
     po_IgnoreUnknownResource,// Ignore resources for which no handler is registered.
-    po_AsyncProcs            // allow async procedure modifier
+    po_AsyncProcs,            // allow async procedure modifier
+    po_DisableResources      // Disable resources altogether
     );
   TPOptions = set of TPOption;
 
@@ -702,6 +703,7 @@ type
     FAllowedModeSwitches: TModeSwitches;
     FAllowedValueSwitches: TValueSwitches;
     FConditionEval: TCondDirectiveEvaluator;
+    FCurModulename: string;
     FCurrentBoolSwitches: TBoolSwitches;
     FCurrentModeSwitches: TModeSwitches;
     FCurrentValueSwitches: TValueSwitchArray;
@@ -863,6 +865,7 @@ type
     property Files: TStrings read FFiles;
     property CurSourceFile: TLineReader read FCurSourceFile;
     property CurFilename: string read FCurFilename;
+    property CurModuleName: string read FCurModulename Write FCurModuleName;
     property CurLine: string read FCurLine;
     property CurRow: Integer read FCurRow;
     property CurColumn: Integer read GetCurColumn;
@@ -4087,7 +4090,8 @@ begin
       'POINTERMATH':
         DoBoolDirective(bsPointerMath);
       'R' :
-        HandleResource(Param);
+        if not (po_DisableResources in Options) then
+          HandleResource(Param);
       'RANGECHECKS':
         DoBoolDirective(bsRangeChecks);
       'SCOPEDENUMS':

+ 25 - 0
packages/fcl-passrc/tests/tcuseanalyzer.pas

@@ -78,6 +78,7 @@ type
     procedure TestM_Class;
     procedure TestM_ClassForward;
     procedure TestM_Class_Property;
+    procedure TestM_ClassForward_Generic;
     procedure TestM_Class_PropertyProtected;
     procedure TestM_Class_PropertyOverride;
     procedure TestM_Class_PropertyOverride2;
@@ -1153,6 +1154,30 @@ begin
   AnalyzeProgram;
 end;
 
+procedure TTestUseAnalyzer.TestM_ClassForward_Generic;
+begin
+  StartUnit(false);
+  Add([
+  '{$mode delphi}',
+  'interface',
+  'type',
+  '  {tobject_used}TObject = class',
+  '  end;',
+  '  TBird = class;',
+  '  TAnt = class end;',
+  '  TBird = class end;',
+  'implementation',
+  'type',
+  '  TBird2 = class;',
+  '  TAnt2 = class end;',
+  '  TBird2 = class end;',
+  'var Bird2: TBird2;',
+  'begin',
+  '  if Bird2=nil then;',
+  '']);
+  AnalyzeUnit;
+end;
+
 procedure TTestUseAnalyzer.TestM_Class_PropertyProtected;
 begin
   StartUnit(false);

+ 1 - 1
packages/fcl-pdf/fpmake.pp

@@ -24,7 +24,7 @@ begin
     P.Email := '';
     P.Description := 'PDF generating and TTF file info library';
     P.NeedLibC:= false;
-    P.OSes:=P.OSes-[embedded,win16,msdos,nativent,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=P.OSes-[embedded,win16,msdos,nativent,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 40 - 10
packages/fcl-pdf/src/fppdf.pp

@@ -696,6 +696,7 @@ type
     function GetObjectCount: Integer;
     function CreateAnnotList: TPDFAnnotList; virtual;
     procedure SetOrientation(AValue: TPDFPaperOrientation);
+    procedure SetPaper(AValue: TPDFPaper);
     procedure SetPaperType(AValue: TPDFPaperType);
     procedure AddTextToLookupLists(AText: UTF8String);
     procedure SetUnitOfMeasure(AValue: TPDFUnitOfMeasure);
@@ -785,8 +786,8 @@ type
     // Quick settings for Paper.
     Property PaperType : TPDFPaperType Read FPaperType Write SetPaperType default ptA4;
     Property Orientation : TPDFPaperOrientation Read FOrientation Write SetOrientation;
-    // Set this if you want custom paper size. You must set this before setting PaperType = ptCustom.
-    Property Paper : TPDFPaper Read FPaper Write FPaper;
+    // Set this if you want custom paper size. Setting this will set PaperType to ptCustom.
+    Property Paper : TPDFPaper Read FPaper Write SetPaper;
     // Unit of Measure - how the PDF Page should convert the coordinates and dimensions
     property UnitOfMeasure: TPDFUnitOfMeasure read FUnitOfMeasure write SetUnitOfMeasure default uomMillimeters;
     Property ObjectCount: Integer Read GetObjectCount;
@@ -1241,6 +1242,11 @@ function PDFtoInches(APixels: TPDFFloat): single;
 
 function PDFCoord(x, y: TPDFFloat): TPDFCoord;
 
+Operator = (a,b : TPDFDimensions) z : boolean;
+Operator = (a,b : TPDFPaper) z : boolean;
+
+
+
 implementation
 
 uses
@@ -1285,6 +1291,19 @@ const
 Var
   PDFFormatSettings : TFormatSettings;
 
+Operator = (a,b : TPDFDimensions) z : boolean;
+
+begin
+  z:=(a.B=b.b) and (a.T=b.t) and (a.l=b.l) and (a.r=b.r);
+end;
+
+Operator = (a,b : TPDFPaper) z : boolean;
+
+begin
+  z:=(a.H=b.H) and (a.W=b.W) and (a.Printable=b.Printable);
+end;
+
+
 function GetLocalTZD(ADate: TDateTime; ISO8601: Boolean): string;
 var
   i: Integer;
@@ -2202,6 +2221,15 @@ begin
   AdjustMatrix;
 end;
 
+procedure TPDFPage.SetPaper(AValue: TPDFPaper);
+begin
+  if FPaper=AValue then exit;
+  FPaper:=AValue;
+  FPaperType:=ptCustom;
+  // No need to call calcpapersize
+  AdjustMatrix;
+end;
+
 procedure TPDFPage.CalcPaperSize;
 var
   PP: TPDFPaper;
@@ -2229,7 +2257,8 @@ procedure TPDFPage.SetPaperType(AValue: TPDFPaperType);
 begin
   if FPaperType=AValue then Exit;
   FPaperType:=AValue;
-  CalcPaperSize;
+  if FPaperType<>ptCustom then
+    CalcPaperSize;
   AdjustMatrix;
 end;
 
@@ -2310,20 +2339,21 @@ begin
   inherited Create(ADocument);
   FLastFont := nil;
   FLastFontColor := clBlack;
-  FPaperType := ptA4;
-  FUnitOfMeasure := uomMillimeters;
-  CalcPaperSize;
   If Assigned(ADocument) then
-  begin
+    begin
     PaperType := ADocument.DefaultPaperType;
     Orientation := ADocument.DefaultOrientation;
     FUnitOfMeasure:=ADocument.DefaultUnitOfMeasure;
-  end;
-
+    end
+  else
+    begin
+    FPaperType:=ptA4;
+    CalcPaperSize;
+    FUnitOfMeasure := uomMillimeters;
+    end;
   FMatrix._00 := 1;
   FMatrix._20 := 0;
   AdjustMatrix;
-
   FAnnots := CreateAnnotList;
 end;
 

+ 1 - 1
packages/fcl-process/fpmake.pp

@@ -25,7 +25,7 @@ begin
     P.Description := 'Process (execution) related parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.Options.Add('-S2h');
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,msdos,win16,go32v2,nativent,macosclassic,palmos,atari,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,go32v2,nativent,macosclassic,palmos,atari,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-registry/fpmake.pp

@@ -27,7 +27,7 @@ begin
     P.Email := '';
     P.Description := 'Windows registry + emulation parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 0
packages/fcl-registry/src/regini.inc

@@ -318,5 +318,6 @@ end;
 procedure TRegIniFile.CloseSection;
 begin
   CloseKey(CurrentKey);
+  fCurrentKey:=0;
 end;
 

+ 59 - 19
packages/fcl-registry/src/xregreg.inc

@@ -39,6 +39,22 @@ begin
   end;
 end;
 
+Function RootKeyToRootKeyStr(Value: HKEY): UnicodeString;
+
+begin
+  Case Value of
+    HKEY_CLASSES_ROOT     : Result := 'HKEY_CLASSES_ROOT';
+    HKEY_CURRENT_USER     : Result := 'HKEY_CURRENT_USER';
+    HKEY_LOCAL_MACHINE    : Result := 'HKEY_LOCAL_MACHINE';
+    HKEY_USERS            : Result := 'HKEY_USERS';
+    HKEY_PERFORMANCE_DATA : Result := 'HKEY_PERFORMANCE_DATA';
+    HKEY_CURRENT_CONFIG   : Result := 'HKEY_CURRENT_CONFIG';
+    HKEY_DYN_DATA         : Result := 'HKEY_DYN_DATA';
+  else
+    Result:=Format('Key%d',[Value]);
+  end;
+end;
+
 type
 
   { TXMLRegistryInstance }
@@ -115,6 +131,26 @@ begin
   Dec(FRefCount);
 end;
 
+procedure useKeyFromTRegistryInstance(reg: TRegistry);
+var XmlRegistry: TXMLRegistry;
+    RootKeyStr: UnicodeString;
+begin
+  XmlRegistry:=TXMLRegistry(reg.FSysData);
+  RootKeyStr:=RootKeyToRootKeyStr(reg.RootKey);
+
+  // '/' at the end when comparing
+  if (reg.CurrentKey=0) and (UnicodeCompareText(XmlRegistry.RootKey, RootKeyStr + '/')<>0) then
+    XmlRegistry.SetRootKey(RootKeyStr)
+  else
+    begin
+    if UnicodeCompareText(XmlRegistry.CurrentKey, RootKeyStr+'/'+reg.CurrentPath + '/')<>0 then
+      begin
+      XmlRegistry.SetRootKey(RootKeyStr);
+      XmlRegistry.SetKey(reg.CurrentPath, false);
+      end;
+    end;
+end;
+
 procedure TRegistry.SysRegCreate;
 var s : string;
 begin
@@ -139,17 +175,20 @@ end;
 function TRegistry.SysCreateKey(Key: UnicodeString): Boolean;
 
 begin
+  useKeyFromTRegistryInstance(self);
   Result:=TXmlRegistry(FSysData).CreateKey(Key);
 end;
 
 function TRegistry.DeleteKey(const Key: UnicodeString): Boolean;
 
 begin
+  useKeyFromTRegistryInstance(self);
   Result:=TXMLRegistry(FSysData).DeleteKey(Key);
 end;
 
 function TRegistry.DeleteValue(const Name: UnicodeString): Boolean;
 begin
+  useKeyFromTRegistryInstance(self);
   Result:=TXmlRegistry(FSysData).DeleteValue(Name);
 end;
 
@@ -159,6 +198,7 @@ function TRegistry.SysGetData(const Name: UnicodeString; Buffer: Pointer;
 Var
   DataType : TDataType;
 begin
+  useKeyFromTRegistryInstance(self);
   Result:=BufSize;
   If TXmlregistry(FSysData).GetValueDataUnicode(Name,DataType,Buffer^,Result) then
     RegData:=DataTypeToRegDataType(DataType)
@@ -172,6 +212,7 @@ Var
   Info : TDataInfo;
 
 begin
+  useKeyFromTRegistryInstance(self);
   Result := TXmlRegistry(FSysData).GetValueInfo(ValueName,Info,True);
   If Not Result then
     With Value do
@@ -198,6 +239,7 @@ Var
   Info : TKeyInfo;
 
 begin
+  useKeyFromTRegistryInstance(self);
   Result:=TXmlRegistry(FSysData).GetKeyInfo(info);
   If Result then
     With Value,Info do
@@ -213,6 +255,7 @@ end;
 
 function TRegistry.KeyExists(const Key: UnicodeString): Boolean;
 begin
+  useKeyFromTRegistryInstance(self);
   Result:=TXmlRegistry(FSysData).KeyExists(Key);
 end;
 
@@ -227,9 +270,10 @@ var
   S: UnicodeString;
   P: SizeInt;
 begin
+  useKeyFromTRegistryInstance(self);
   Result:=TXmlRegistry(FSysData).SetKey(Key,CanCreate);
-  FCurrentKey:=1;
   If Result then begin
+    fCurrentKey:=1;
     S:=TXmlRegistry(FSysData).CurrentKey;
     if (S>'') then begin
       //S starts with RootKey+'/'
@@ -237,14 +281,14 @@ begin
       if (P>0) then
         System.Delete(S,1,P);
     end;
-    ChangeKey(FCurrentKey, S);
+    ChangeKey(fCurrentKey, S);
   end;
 end;
 
 function TRegistry.OpenKeyReadOnly(const Key: UnicodeString): Boolean;
 
 begin
-  Result:=TXmlRegistry(FSysData).SetKey(Key,False);
+  Result:=OpenKey(Key,False);
 end;
 
 function TRegistry.RegistryConnect(const UNCName: UnicodeString): Boolean;
@@ -274,6 +318,7 @@ end;
 
 function TRegistry.ValueExists(const Name: UnicodeString): Boolean;
 begin
+  useKeyFromTRegistryInstance(self);
   Result := TXmlRegistry(FSysData).ValueExists(Name);
 end;
 
@@ -284,11 +329,13 @@ end;
 
 function TRegistry.GetKeyNames: TUnicodeStringArray;
 begin
+  useKeyFromTRegistryInstance(self);
   Result:=TXmlRegistry(FSysData).EnumSubKeys;
 end;
 
 function TRegistry.GetValueNames: TUnicodeStringArray;
 begin
+  useKeyFromTRegistryInstance(self);
   Result := TXmlRegistry(FSysData).EnumValues;
 end;
 
@@ -300,6 +347,7 @@ Var
   DataType : TDataType;
 
 begin
+  useKeyFromTRegistryInstance(self);
   //writeln('TRegistry.SysPutData: Name=',Name,', RegData=',RegData,', BufSize=',BufSize);
   DataType:=RegDataTypeToXmlDataType(RegData);
 
@@ -308,6 +356,7 @@ end;
 
 procedure TRegistry.RenameValue(const OldName, NewName: UnicodeString);
 begin
+  useKeyFromTRegistryInstance(self);
   TXMLRegistry(FSysData).RenameValue(OldName,NewName);
 end;
 
@@ -323,24 +372,11 @@ Var
   S: UnicodeString;
 
 begin
-  If (Value=HKEY_CLASSES_ROOT) then
-    S:='HKEY_CLASSES_ROOT'
-  else if (Value=HKEY_CURRENT_USER) then
-    S:='HKEY_CURRENT_USER'
-  else if (Value=HKEY_LOCAL_MACHINE) then
-    S:='HKEY_LOCAL_MACHINE'
-  else if (Value=HKEY_USERS) then
-    S:='HKEY_USERS'
-  else if Value=HKEY_PERFORMANCE_DATA then
-    S:='HKEY_PERFORMANCE_DATA'
-  else if (Value=HKEY_CURRENT_CONFIG) then
-    S:='HKEY_CURRENT_CONFIG'
-  else if (Value=HKEY_DYN_DATA) then
-    S:='HKEY_DYN_DATA'
-  else
-    S:=Format('Key%d',[Value]);
+  S:=RootKeyToRootKeyStr(Value);
   TXmlRegistry(FSysData).SetRootKey(S);
   fRootKey := Value;
+  fCurrentKey:=0;
+  FCurrentPath:='';
 end;
 
 function TRegistry.GetLastErrorMsg: string;
@@ -357,6 +393,8 @@ begin
   begin
     TXMLRegistry(FSysData).Flush;
     TXMLRegistry(FSysData).SetRootKey(TXMLRegistry(FSysData).RootKey);
+    fCurrentKey:=0;
+    FCurrentPath:='';
   end;
 end;
 
@@ -367,6 +405,8 @@ begin
   begin
     TXMLRegistry(FSysData).Flush;
     TXMLRegistry(FSysData).SetRootKey(TXMLRegistry(FSysData).RootKey);
+    fCurrentKey:=0;
+    FCurrentPath:='';
   end;
 end;
 

+ 1 - 1
packages/fcl-res/fpmake.pp

@@ -27,7 +27,7 @@ begin
     P.Email := '';
     P.Description := 'Resource handling of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-sdo/fpmake.pp

@@ -25,7 +25,7 @@ begin
     P.HomepageURL := 'www.freepascal.org';
     P.Email := '[email protected]';
     P.Description := 'Free Pascal implementation of Service Data Objects';
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-sound/fpmake.pp

@@ -26,7 +26,7 @@ begin
     P.Email := '';
     P.Description := 'Sound loading, storing and conversion parts for the Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

TEMPAT SAMPAH
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16.wav


+ 1 - 0
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16.wav.info.txt

@@ -0,0 +1 @@
+44100 1 16

TEMPAT SAMPAH
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16_tag.wav


+ 1 - 0
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16_tag.wav.info.txt

@@ -0,0 +1 @@
+44100 1 16

TEMPAT SAMPAH
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_24.wav


+ 1 - 0
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_24.wav.info.txt

@@ -0,0 +1 @@
+44100 1 24

TEMPAT SAMPAH
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav


+ 1 - 0
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav.info.txt

@@ -0,0 +1 @@
+44100 1 32

TEMPAT SAMPAH
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav


+ 1 - 0
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav.info.txt

@@ -0,0 +1 @@
+44100 1 8

+ 67 - 0
packages/fcl-sound/tests/tcwavreader.pas

@@ -0,0 +1,67 @@
+unit tcwavreader;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, fpcunit, testutils, testregistry,
+  fpwavreader;
+
+type
+
+  { TTestWavReader }
+
+  TTestWavReader= class(TTestCase)
+  private
+    procedure TestValidFile(const FileName: string);
+  published
+    procedure TestValidFiles;
+  end;
+
+implementation
+
+procedure TTestWavReader.TestValidFile(const FileName: string);
+const
+  CorrectFileDir = 'data/wav/reader/valid/';
+var
+  WavReader: TWavReader;
+  InfoFile: TextFile;
+  ExpectedSampleRate, ExpectedChannels, ExpectedBitsPerSample : Integer;
+begin
+  AssignFile(InfoFile, CorrectFileDir + FileName + '.info.txt');
+  Reset(InfoFile);
+  try
+    Readln(InfoFile, ExpectedSampleRate, ExpectedChannels, ExpectedBitsPerSample);
+  finally
+    CloseFile(InfoFile);
+  end;
+
+  WavReader := TWavReader.Create;
+  try
+    if not WavReader.LoadFromFile(CorrectFileDir + FileName) then
+      Fail('Error loading wave file');
+    AssertEquals('Incorrect sample rate', ExpectedSampleRate, WavReader.fmt.SampleRate);
+    AssertEquals('Incorrect number of channels', ExpectedChannels, WavReader.fmt.Channels);
+    AssertEquals('Incorrect number of bits per sample', ExpectedBitsPerSample, WavReader.fmt.BitsPerSample);
+  finally
+    FreeAndNil(WavReader);
+  end;
+end;
+
+procedure TTestWavReader.TestValidFiles;
+begin
+  TestValidFile('44k_mono_8.wav');
+  TestValidFile('44k_mono_16.wav');
+  TestValidFile('44k_mono_24.wav');
+  TestValidFile('44k_mono_32.wav');
+  TestValidFile('44k_mono_16_tag.wav');
+end;
+
+
+
+initialization
+
+  RegisterTest(TTestWavReader);
+end.
+

+ 75 - 0
packages/fcl-sound/tests/testfclsound.lpi

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="11"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="testfclsound"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+    </General>
+    <BuildModes Count="1">
+      <Item1 Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+      <Modes Count="0"/>
+    </RunParams>
+    <RequiredPackages Count="3">
+      <Item1>
+        <PackageName Value="fpcunittestrunner"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LCL"/>
+      </Item2>
+      <Item3>
+        <PackageName Value="FCL"/>
+      </Item3>
+    </RequiredPackages>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="testfclsound.lpr"/>
+        <IsPartOfProject Value="True"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="tcwavreader.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="testfclsound"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 15 - 0
packages/fcl-sound/tests/testfclsound.lpr

@@ -0,0 +1,15 @@
+program testfclsound;
+
+{$mode objfpc}{$H+}
+
+uses
+  Interfaces, Forms, GuiTestRunner, tcwavreader;
+
+{$R *.res}
+
+begin
+  Application.Initialize;
+  Application.CreateForm(TGuiTestRunner, TestRunner);
+  Application.Run;
+end.
+

+ 1 - 1
packages/fcl-stl/fpmake.pp

@@ -25,7 +25,7 @@ begin
     P.Email := '';
     P.Description := 'Generic container library of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/fcl-xml/fpmake.pp

@@ -29,7 +29,7 @@ begin
     P.Email := '';
     P.Description := 'XML and DOM parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
-    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=AllOSes-[embedded,msdos,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 16 - 37
packages/fcl-xml/src/sax_xml.pp

@@ -175,17 +175,6 @@ begin
             '<':
               begin
                 Inc(BufferPos);
-                if (Buffer[BufferPos]='!') and (Buffer[BufferPos + 1]='[') then 
-                begin
-                  Inc(BufferPos, 8);
-                  EnterNewScannerContext(scCData);
-                end
-                else if (Buffer[BufferPos]='!') and (Buffer[BufferPos + 1]='-') then 
-                begin
-                  Inc(BufferPos, 3);
-                  EnterNewScannerContext(scComment);
-                end
-                else
                 EnterNewScannerContext(scTag);
               end;
             else
@@ -206,17 +195,6 @@ begin
             '<':
               begin
                 Inc(BufferPos);
-                if (Buffer[BufferPos]='!') and (Buffer[BufferPos + 1]='[') then 
-                begin
-                  Inc(BufferPos, 8);
-                  EnterNewScannerContext(scCData);
-                end
-                else if (Buffer[BufferPos]='!') and (Buffer[BufferPos + 1]='-') then 
-                begin
-                  Inc(BufferPos, 3);
-                  EnterNewScannerContext(scComment);
-                end
-                else
                 EnterNewScannerContext(scTag);
               end;
             else
@@ -232,17 +210,6 @@ begin
             '<':
               begin
                 Inc(BufferPos);
-                if (Buffer[BufferPos]='!') and (Buffer[BufferPos + 1]='[') then 
-                begin
-                  Inc(BufferPos, 8);
-                  EnterNewScannerContext(scCData);
-                end
-                else if (Buffer[BufferPos]='!') and (Buffer[BufferPos + 1]='-') then 
-                begin
-                  Inc(BufferPos, 3);
-                  EnterNewScannerContext(scComment);
-                end
-                else
                 EnterNewScannerContext(scTag);
               end;
             else
@@ -252,9 +219,15 @@ begin
             end;
           end;
         scCData:
-          if (Buffer[BufferPos] = ']') and (Buffer[BufferPos + 1]=']') and (Buffer[BufferPos + 2]='>') then 
+          if (Length(FRawTokenText) = 0) and (Buffer[BufferPos] = '-') then
+          begin
+            Inc(BufferPos);
+            EnterNewScannerContext(scComment);
+          end
+          else if (Buffer[BufferPos] = '>') and (RightStr(FRawTokenText, 2) = ']]') then
           begin
-            Inc(BufferPos, 3);
+            FRawTokenText := Copy(FRawTokenText, 8, Length(FRawTokenText)-9);  //delete '[CDATA[' and ']]' from text
+            Inc(BufferPos);
             EnterNewScannerContext(scUnknown);
           end
           else
@@ -263,9 +236,10 @@ begin
             Inc(BufferPos);
           end;
         scComment:
-          if (Buffer[BufferPos] = '-') and (Buffer[BufferPos + 1]='-') and (Buffer[BufferPos + 2]='>') then  
+          if (Buffer[BufferPos] = '>') and (RightStr(FRawTokenText, 2) = '--') then
           begin
-            Inc(BufferPos, 3);
+            FRawTokenText := Copy(FRawTokenText, 2, Length(FRawTokenText)-3);  //delete '-' and '--' from text
+            Inc(BufferPos);
             EnterNewScannerContext(scUnknown);
           end
           else
@@ -309,6 +283,11 @@ begin
                 FRawTokenText := FRawTokenText + Buffer[BufferPos];
                 Inc(BufferPos);
               end;
+            '!':
+              begin
+                Inc(BufferPos);
+                EnterNewScannerContext(scCData);
+              end;
             '>':
               begin
                 Inc(BufferPos);

+ 1 - 0
packages/fpmake_add.inc

@@ -144,4 +144,5 @@
   add_gnutls(ADirectory+IncludeTrailingPathDelimiter('gnutls'));
   add_ide(ADirectory+IncludeTrailingPathDelimiter('ide'));
   add_vclcompat(ADirectory+IncludeTrailingPathDelimiter('vcl-compat'));
+  add_qlunits(ADirectory+IncludeTrailingPathDelimiter('qlunits'));
   

+ 5 - 0
packages/fpmake_proc.inc

@@ -815,5 +815,10 @@ begin
 {$include vcl-compat/fpmake.pp}
 end;
 
+procedure add_qlunits(const ADirectory: string);
+begin
+  with Installer do
+{$include qlunits/fpmake.pp}
+end;
 
 {$include ide/fpmake.pp}

+ 1 - 1
packages/fpmkunit/fpmake.pp

@@ -25,7 +25,7 @@ begin
     P.Email := '';
     P.Description := 'Basic library of the fpmake/fppkg build system.';
     P.NeedLibC:= false;  // true for headers that indirectly link to libc?
-    P.OSes := P.OSes - [embedded,nativent,msdos,win16,atari,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes := P.OSes - [embedded,nativent,msdos,win16,atari,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 353 - 32
packages/fpmkunit/src/fpmkunit.pp

@@ -122,7 +122,7 @@ Type
     palmos,macosclassic,darwin,emx,watcom,morphos,netwlibc,
     win64,wince,gba,nds,embedded,symbian,haiku,iphonesim,
     aix,java,android,nativent,msdos,wii,aros,dragonfly,
-    win16,wasm,freertos,zxspectrum,msxdos,ios,amstradcpc
+    win16,wasm,freertos,zxspectrum,msxdos,ios,amstradcpc,sinclairql
   );
   TOSes = Set of TOS;
 
@@ -158,7 +158,7 @@ Type
   TLogEvent = Procedure (Level : TVerboseLevel; Const Msg : String) of Object;
   TNotifyProcEvent = procedure(Sender: TObject);
 
-  TRunMode = (rmCompile,rmBuild,rmInstall,rmBuildInstall,rmArchive,rmClean,rmDistClean,rmManifest,rmZipInstall,rmPkgList,rmUnInstall,rmInfo);
+  TRunMode = (rmCompile,rmBuild,rmInstall,rmBuildInstall,rmArchive,rmClean,rmDistClean,rmManifest,rmZipInstall,rmPkgList,rmUnInstall,rmInfo,rmDocProject);
 
   TBuildMode = (bmOneByOne, bmBuildUnit{, bmSkipImplicitUnits});
   TBuildModes = set of TBuildMode;
@@ -231,7 +231,8 @@ Const
     {zxspectrum}( false, false, false, false, false, false, false, false, false, false, false, false, false, false,   false, false, false, false, false,  false,  false,   false, true ),
     { msxdos }  ( false, false, false, false, false, false, false, false, false, false, false, false, false, false,   false, false, false, false, false,  false,  false,   false, true ),
     { ios }     ( false, false, false, false, false, false,  true, false, false, false, false, false, false, false,   false, false, true , false, false,  false,  false,   false, false),
-    {amstradcpc}( false, false, false, false, false, false, false, false, false, false, false, false, false, false,   false, false, false, false, false,  false,  false,   false, true )
+    {amstradcpc}( false, false, false, false, false, false, false, false, false, false, false, false, false, false,   false, false, false, false, false,  false,  false,   false, true ),
+    {sinclairql}( false, false, true,  false, false, false, false, false, false, false, false, false, false, false,   false, false, false, false, false,  false,  false,   false, false)
   );
 
   // Useful
@@ -256,6 +257,7 @@ Const
 
   FPMakePPFile = 'fpmake.pp';
   ManifestFile = 'manifest.xml';
+  DocProjectFileExt = '-docs.xml';
   PkgListFileBase = 'pkg-';
   PkgListFileExt = '.lst';
 
@@ -336,6 +338,14 @@ Type
 
   { TCommands }
 
+  { TCommandEnumerator }
+
+  TCommandEnumerator = Class(TCollectionEnumerator)
+  public
+    function GetCurrent: TCommand;
+    property Current: TCommand read GetCurrent;
+  end;
+
   TCommands = Class(TNamedCollection)
   private
     FDefaultAt: TCommandAt;
@@ -349,6 +359,7 @@ Type
     Function AddCommand(At : TCommandAt; Const Cmd : String) : TCommand;
     Function AddCommand(At : TCommandAt; Const Cmd,Options : String) : TCommand;
     Function AddCommand(At : TCommandAt; Const Cmd,Options, Dest,Source : String) : TCommand;
+    Function GetEnumerator : TCommandEnumerator;
     Property CommandItems[Index : Integer] : TCommand Read GetCommandItem Write SetCommandItem;
     Property Commands[Dest : String] : TCommand Read GetCommand; default;
     Property DefaultAt : TCommandAt Read FDefaultAt Write FDefaultAt;
@@ -446,7 +457,8 @@ Type
                         neaBeforeClean, neaAfterClean, neaBeforeArchive, neaAfterArchive,
                         neaBeforeManifest, neaAfterManifest, neaBeforePkgList, neaAfterPkgList,
                         neaBeforeUnInstall, neaAfterUnInstall,
-                        neaBeforeCreateBuildEngine, neaAfterCreateBuildengine);
+                        neaBeforeCreateBuildEngine, neaAfterCreateBuildengine,
+                        neaBeforeDocProject, neaAfterDocProject);
 
   TNotifyEventActionSet = set of TNotifyEventAction;
 
@@ -462,11 +474,21 @@ Type
     procedure CallEvent(Sender: TObject);
   end;
 
+  { TNotifyEventEnumerator }
+
+  TNotifyEventEnumerator = Class(TCollectionEnumerator)
+  public
+    function GetCurrent: TNotifyEventItem;
+    property Current: TNotifyEventItem read GetCurrent;
+  end;
+
+
   TNotifyEventCollection = class(TCollection)
   private
     FSupportedActionSet: TNotifyEventActionSet;
   public
     constructor create(ASupportedActionSet: TNotifyEventActionSet);
+    Function GetEnumerator : TNotifyEventEnumerator;
     procedure AppendEvent(AnAction: TNotifyEventAction; AnEvent: TNotifyEvent);
     procedure AppendProcEvent(AnACtion: TNotifyEventAction; AnProcEvent: TNotifyProcEvent);
     procedure CallEvents(AnAction: TNotifyEventAction; Sender: TObject);
@@ -544,6 +566,15 @@ Type
     property Targets: TTargets read FTargets;
   end;
 
+
+  { TPackageVariantEnumerator }
+
+  TPackageVariantEnumerator = Class(TCollectionEnumerator)
+  public
+    function GetCurrent: TPackageVariant;
+    property Current: TPackageVariant read GetCurrent;
+  end;
+
   { TPackageVariants }
 
   TPackageVariants = class(TNamedCollection)
@@ -560,6 +591,7 @@ Type
     procedure SetDefaultPackageVariantName(AValue: string);
   public
     function Add(AName: String): TPackageVariant; overload; virtual;
+    Function GetEnumerator :  TPackageVariantEnumerator;
     property Name: string read FName write FName;
     property MasterPackage: TPackage read FMasterPackage;
     property DefaultPackageVariant: TPackageVariant read GetDefaultPackageVariant;
@@ -695,6 +727,15 @@ Type
     Property AfterClean : TNotifyEvent Read FAfterClean Write FAfterClean;
   end;
 
+
+  { TTargetEnumerator }
+
+  TTargetEnumerator = Class(TCollectionEnumerator)
+  public
+    function GetCurrent: TTarget;
+    property Current: TTarget read GetCurrent;
+  end;
+
   { TTargets }
 
   TTargets = Class(TNamedCollection)
@@ -738,6 +779,7 @@ Type
     Function AddExampleProgram(Const AProgramName : String;const CPUs:TCPUs) : TTarget;inline;
 {$endif cpu_only_overloads}
     Function AddExampleProgram(Const AProgramName : String;const CPUs:TCPUs;const OSes:TOSes) : TTarget;
+    Function GetEnumerator : TTargetEnumerator;
     Property Targets[AName : String] : TTarget Read GetTarget; default;
     Property TargetItems[Index : Integer] : TTarget Read GetTargetItem Write SetTargetItem;
   end;
@@ -759,6 +801,14 @@ Type
 
   { TSources }
 
+  { TSourceEnumerator }
+
+  TSourceEnumerator = Class(TCollectionEnumerator)
+  public
+    function GetCurrent: TSource;
+    property Current: TSource read GetCurrent;
+  end;
+
   TSources = Class(TNamedCollection)
   private
     function GetSourceItem(Index : Integer): TSource;
@@ -770,6 +820,7 @@ Type
     Function AddExample(const AFiles : String) : TSource;
     Function AddExample(const AFiles : String; AInstallSourcePath : String) : TSource;
     Function AddTest(const AFiles : String) : TSource;
+    Function GetEnumerator : TSourceEnumerator;
     procedure AddDocFiles(const AFileMask, ASearchPathPrefix: string; Recursive: boolean = False; AInstallSourcePath : String = '');
     procedure AddSrcFiles(const AFileMask, ASearchPathPrefix: string; Recursive: boolean = False);
     procedure AddExampleFiles(const AFileMask, ASearchPathPrefix: string; Recursive: boolean = False; AInstallSourcePath : String = '');
@@ -968,6 +1019,14 @@ Type
     Property AfterPkgListProc : TNotifyProcEvent Read FAfterPkgListProc Write FAfterPkgListProc;
   end;
 
+  { TPackageEnumerator }
+
+  TPackageEnumerator = Class(TCollectionEnumerator)
+  public
+    function GetCurrent: TPackage;
+    property Current: TPackage read GetCurrent;
+  end;
+
   { TPackages }
 
   TPackages = Class(TNamedCollection)
@@ -977,6 +1036,7 @@ Type
     procedure SetPackageItem(AIndex : Integer; const AValue: TPackage);
   Public
     Function AddPackage(Const AName : String) : TPackage;
+    Function GetEnumerator : TPackageEnumerator;
     Property Packages[AName : String] : TPackage Read GetPackage ; Default;
     Property PackageItems[AIndex : Integer] : TPackage Read GetPackageItem Write SetPackageItem;
   end;
@@ -989,6 +1049,7 @@ Type
     FBuildMode: TBuildMode;
     FCompiler: String;
     FCopy: String;
+    FFPDocOptions: String;
     FFPDocOutputDir: String;
     FFPUnitSourcePath: String;
     FIgnoreInvalidOptions: Boolean;
@@ -1008,6 +1069,8 @@ Type
     FLibInstallDir,
     FDocInstallDir,
     FExamplesInstallDir : String;
+    FSingleFPDocFile: Boolean;
+    FSingleDocProjectFile: Boolean;
     FSearchPath: TStrings;
     FSkipCrossPrograms: boolean;
     FThreadsAmount: integer;
@@ -1110,7 +1173,9 @@ Type
     Property DocInstallDir : String Read GetDocInstallDir Write FDocInstallDir;
     Property ExamplesInstallDir : String Read GetExamplesInstallDir Write FExamplesInstallDir;
     Property FPDocOutputDir : String Read GetFPDocOutputDir Write FFPDocOutputDir;
+    Property FPDocOptions : String Read FFPDocOptions Write FFPDocOptions;
     Property FPUnitSourcePath: String read GetFPUnitSourcePath Write FFPUnitSourcePath;
+
     // Command tools. If not set, internal commands  will be used.
     Property Compiler : String Read GetCompiler Write FCompiler; // Compiler. Defaults to fpc
     Property Copy : String Read FCopy Write FCopy;             // copy $(FILES) to $(DEST)
@@ -1124,6 +1189,7 @@ Type
     Property UseEnvironment : Boolean read FUseEnvironment write FUseEnvironment;
     Property IgnoreInvalidOptions: Boolean read FIgnoreInvalidOptions write FIgnoreInvalidOptions;
     Property BuildMode: TBuildMode read FBuildMode write FBuildMode;
+    Property SingleFPDocFile : Boolean Read FSingleFPDocFile Write FSingleFPDocFile;
     // Installation optioms
     Property InstallExamples: Boolean read FInstallExamples write FInstallExamples;
     Property SkipCrossPrograms: boolean read FSkipCrossPrograms write FSkipCrossPrograms;
@@ -1206,6 +1272,8 @@ Type
     procedure AddDependencyPaths(L: TStrings; DependencyType: TDependencyType; ATarget: TTarget);
     procedure AddDependencyUnitPaths(L:TStrings;APackage: TPackage);
     procedure AddDependencyTransmittedOptions(Args: TStrings; APackage: TPackage);
+    procedure GetDocProject(Proj: TStrings; P: TPackage; aIndent: string); virtual;
+
   Public
     Constructor Create(AOwner : TComponent); override;
     destructor Destroy;override;
@@ -1273,6 +1341,7 @@ Type
     Procedure Archive(Packages : TPackages);
     procedure Manifest(Packages: TPackages; Package: TPackage);
     procedure PkgList(Packages: TPackages);
+    procedure FPDocProject(Packages: TPackages; SingleDocFile : Boolean);
     Procedure Clean(Packages : TPackages; AllTargets: boolean);
 
     Procedure Log(Level : TVerboseLevel; Msg : String);
@@ -1282,6 +1351,7 @@ Type
     Property ForceCompile : Boolean Read FForceCompile Write FForceCompile;
     Property ExternalPackages: TPackages Read FExternalPackages;
     Property StartDir: String Read FStartDir;
+
     // Events
     Property NotifyEventCollection: TNotifyEventCollection read FNotifyEventCollection;
     Property OnLog : TLogEvent Read FOnLog Write FOnlog;
@@ -1320,7 +1390,8 @@ Type
     Procedure Archive; virtual;
     Procedure Manifest; virtual;
     Procedure PkgList; virtual;
-    Procedure Info;
+    Procedure FPDocProject; virtual;
+    Procedure Info; virtual;
     procedure AddAutoPackageVariantsToPackage(APackage: TPackage); virtual;
   Public
     Constructor Create(AOwner : TComponent); virtual;
@@ -1474,7 +1545,7 @@ Function FixPath (const APath : String) : String; inline; deprecated 'Use the ov
 Function FixPath (const APath : String; AIsDir : Boolean) : String;
 Function IsRelativePath(const APath : String) : boolean;
 Procedure ChangeDir(const APath : String);
-Procedure SplitCommand(Const Cmd : String; Var Exe,Options : String);
+Procedure SplitCommand(Const Cmd : String; out Exe,Options : String);
 Procedure AddCustomFpmakeCommandlineOption(const ACommandLineOption, HelpMessage : string);
 Function GetCustomFpmakeCommandlineOptionValue(const ACommandLineOption : string) : string;
 Function AddProgramExtension(const ExecutableName: string; AOS : TOS) : string;
@@ -1722,6 +1793,7 @@ ResourceString
   SInfoCleaningPackage    = 'Cleaning package %s';
   SInfoCleanPackagecomplete = 'Clean of package %s completed';
   SInfoManifestPackage    = 'Creating manifest for package %s';
+  SInfoPackageDocProject  = 'Creating fpdoc project file for package %s';
   SInfoPkgListPackage    = 'Adding package %s to the package list';
   SInfoCopyingFile        = 'Copying file "%s" to "%s"';
   SInfoDeletedFile        = 'Deleted file "%s"';
@@ -1796,6 +1868,7 @@ ResourceString
   SHelpHelp           = 'This message.';
   SHelpManifest       = 'Create a manifest suitable for import in repository.';
   SHelpPkgList        = 'Create list of all packages suitable for FPC installer.';
+  SHelpFPDocProject   = 'Create fpdoc project file(s) for all packages';
   SHelpZipInstall     = 'Install all units in the package(s) into an archive.';
   SHelpCmdOptions     = 'Where options is one or more of the following:';
   SHelpCPU            = 'Compile for indicated CPU.';
@@ -1819,6 +1892,8 @@ ResourceString
   SHelpSkipCrossProgs = 'Skip programs when cross-compiling/installing';
   SHelpIgnoreInvOpt   = 'Ignore further invalid options.';
   sHelpFpdocOutputDir = 'Use indicated directory as fpdoc output folder.';
+  sHelpSingleFpdocFile = 'Create a single fpdoc project file for all projects';
+  sHelpDocOptionsFile = 'Name=Value File with options for fpdoc project file';
   sHelpFPUnitSrcPath  = 'Sourcepath to replace in fpunits.cfg on installation.';
   sHelpThreads        = 'Enable the indicated amount of worker threads.';
   sHelpUseEnvironment = 'Use environment to pass options to compiler.';
@@ -2602,7 +2677,7 @@ Const
   WhiteSpace = [#9,#10,#13,' '];
   QuoteChars = ['''','"'];
 
-procedure SplitCommand(const Cmd : String; var Exe, Options : String);
+procedure SplitCommand(const Cmd : String; out Exe, Options : String);
 
 Var
   I : Integer;
@@ -2865,6 +2940,49 @@ begin
   Result := GPluginManager;
 end;
 
+{ TPackageEnumerator }
+
+function TPackageEnumerator.GetCurrent: TPackage;
+begin
+  Result:=TPackage(Inherited GetCurrent);
+end;
+
+{ TCommandEnumerator }
+
+function TCommandEnumerator.GetCurrent: TCommand;
+begin
+  Result:= TCommand(Inherited GetCurrent);
+end;
+
+{ TNotifyEventEnumerator }
+
+function TNotifyEventEnumerator.GetCurrent: TNotifyEventItem;
+begin
+  Result:= TNotifyEventItem( Inherited GetCurrent);
+end;
+
+{ TPackageVariantEnumerator }
+
+function TPackageVariantEnumerator.GetCurrent: TPackageVariant;
+begin
+  Result:= TPackageVariant( Inherited GetCurrent);
+end;
+
+{ TTargetEnumerator }
+
+function TTargetEnumerator.GetCurrent: TTarget;
+begin
+  Result:=TTarget(Inherited GetCurrent);
+end;
+
+{ TSourceEnumerator }
+
+function TSourceEnumerator.GetCurrent: TSource;
+begin
+  Result:=TSource(Inherited GetCurrent);
+end;
+
+
 { TResourceFiles }
 
 procedure TResourceFiles.GetInstallFiles(AList: TStrings; const APrefixU, APrefixB: String; ACPU: TCPU; AOS: TOS);
@@ -3112,6 +3230,11 @@ begin
     FDefaultPackageVariantName:=AName;
 end;
 
+function TPackageVariants.GetEnumerator: TPackageVariantEnumerator;
+begin
+  Result:= TPackageVariantEnumerator.Create(Self);
+end;
+
 
 { TConditionalDestStrings }
 
@@ -3362,13 +3485,13 @@ begin
   Result.TargetType:=ttFPDoc;
 end;
 
-Function TTargets.AddUnit(Const AUnitName : String) : TTarget;
+function TTargets.AddUnit(const AUnitName: String): TTarget;
 begin
   Result:=AddUnit(AUnitName,AllCPUs,AllOSes);
 end;
 
 
-Function TTargets.AddUnit(Const AUnitName : String;const OSes:TOSes) : TTarget;
+function TTargets.AddUnit(const AUnitName: String; const OSes: TOSes): TTarget;
 begin
   Result:=AddUnit(AUnitName,AllCPUs,OSes);
 end;
@@ -3382,7 +3505,8 @@ end;
 {$endif cpu_only_overloads}
 
 
-Function TTargets.AddUnit(Const AUnitName : String;const CPUs:TCPUs;const OSes:TOSes) : TTarget;
+function TTargets.AddUnit(const AUnitName: String; const CPUs: TCPUs;
+  const OSes: TOSes): TTarget;
 begin
   Result:=Add as TTarget;
   Result.Name:=AUnitName;
@@ -3392,25 +3516,29 @@ begin
 end;
 
 
-Function TTargets.AddImplicitUnit(Const AUnitName : String;InstallUnit:boolean=true) : TTarget;
+function TTargets.AddImplicitUnit(const AUnitName: String; InstallUnit: boolean
+  ): TTarget;
 begin
   Result:=AddImplicitUnit(AUnitName,AllCPUs,AllOSes,InstallUnit);
 end;
 
 
-Function TTargets.AddImplicitUnit(Const AUnitName : String;const OSes:TOSes;InstallUnit:boolean=true) : TTarget;
+function TTargets.AddImplicitUnit(const AUnitName: String; const OSes: TOSes;
+  InstallUnit: boolean): TTarget;
 begin
   Result:=AddImplicitUnit(AUnitName,AllCPUs,OSes,InstallUnit);
 end;
 
 
-Function TTargets.AddImplicitUnit(Const AUnitName : String;const CPUs:TCPUs;InstallUnit:boolean=true) : TTarget;
+function TTargets.AddImplicitUnit(const AUnitName: String; const CPUs: TCPUs;
+  InstallUnit: boolean): TTarget;
 begin
   Result:=AddImplicitUnit(AUnitName,CPUs,AllOSes,InstallUnit);
 end;
 
 
-Function TTargets.AddImplicitUnit(Const AUnitName : String;const CPUs:TCPUs;const OSes:TOSes;InstallUnit:boolean=true) : TTarget;
+function TTargets.AddImplicitUnit(const AUnitName: String; const CPUs: TCPUs;
+  const OSes: TOSes; InstallUnit: boolean): TTarget;
 begin
   Result:=Add as TTarget;
   Result.Name:=AUnitName;
@@ -3423,13 +3551,14 @@ begin
 end;
 
 
-Function TTargets.AddProgram(Const AProgramName : String) : TTarget;
+function TTargets.AddProgram(const AProgramName: String): TTarget;
 begin
   Result:=AddProgram(AProgramName,AllCPUs,AllOSes);
 end;
 
 
-Function TTargets.AddProgram(Const AProgramName : String;const OSes:TOSes) : TTarget;
+function TTargets.AddProgram(const AProgramName: String; const OSes: TOSes
+  ): TTarget;
 begin
   Result:=AddProgram(AProgramName,AllCPUs,OSes);
 end;
@@ -3443,7 +3572,8 @@ end;
 {$endif cpu_only_overloads}
 
 
-Function TTargets.AddProgram(Const AProgramName : String;const CPUs:TCPUs;const OSes:TOSes) : TTarget;
+function TTargets.AddProgram(const AProgramName: String; const CPUs: TCPUs;
+  const OSes: TOSes): TTarget;
 begin
   Result:=Add as TTarget;
   Result.Name:=AProgramName;
@@ -3453,13 +3583,14 @@ begin
 end;
 
 
-Function TTargets.AddLibrary(Const ALibraryName : String) : TTarget;
+function TTargets.AddLibrary(const ALibraryName: String): TTarget;
 begin
   Result:=AddLibrary(ALibraryName,AllCPUs,AllOSes);
 end;
 
 
-Function TTargets.AddLibrary(Const ALibraryName : String;const OSes:TOSes) : TTarget;
+function TTargets.AddLibrary(const ALibraryName: String; const OSes: TOSes
+  ): TTarget;
 begin
   Result:=AddLibrary(ALibraryName,AllCPUs,OSes);
 end;
@@ -3473,7 +3604,8 @@ end;
 {$endif cpu_only_overloads}
 
 
-Function TTargets.AddLibrary(Const ALibraryName : String;const CPUs:TCPUs;const OSes:TOSes) : TTarget;
+function TTargets.AddLibrary(const ALibraryName: String; const CPUs: TCPUs;
+  const OSes: TOSes): TTarget;
 begin
   Result:=Add as TTarget;
   Result.Name:=ALibraryName;
@@ -3483,13 +3615,14 @@ begin
 end;
 
 
-Function TTargets.AddExampleUnit(Const AUnitName : String) : TTarget;
+function TTargets.AddExampleUnit(const AUnitName: String): TTarget;
 begin
   Result:=AddExampleUnit(AUnitName,AllCPUs,AllOSes);
 end;
 
 
-Function TTargets.AddExampleUnit(Const AUnitName : String;const OSes:TOSes) : TTarget;
+function TTargets.AddExampleUnit(const AUnitName: String; const OSes: TOSes
+  ): TTarget;
 begin
   Result:=AddExampleUnit(AUnitName,AllCPUs,OSes);
 end;
@@ -3503,7 +3636,8 @@ end;
 {$endif cpu_only_overloads}
 
 
-Function TTargets.AddExampleUnit(Const AUnitName : String;const CPUs:TCPUs;const OSes:TOSes) : TTarget;
+function TTargets.AddExampleUnit(const AUnitName: String; const CPUs: TCPUs;
+  const OSes: TOSes): TTarget;
 begin
   Result:=Add as TTarget;
   Result.Name:=AUnitName;
@@ -3513,13 +3647,14 @@ begin
 end;
 
 
-Function TTargets.AddExampleProgram(Const AProgramName : String) : TTarget;
+function TTargets.AddExampleProgram(const AProgramName: String): TTarget;
 begin
   Result:=AddExampleProgram(AProgramName,AllCPUs,AllOSes);
 end;
 
 
-Function TTargets.AddExampleProgram(Const AProgramName : String;const OSes:TOSes) : TTarget;
+function TTargets.AddExampleProgram(const AProgramName: String;
+  const OSes: TOSes): TTarget;
 begin
   Result:=AddExampleProgram(AProgramName,AllCPUs,OSes);
 end;
@@ -3533,7 +3668,8 @@ end;
 {$endif cpu_only_overloads}
 
 
-Function TTargets.AddExampleProgram(Const AProgramName : String;const CPUs:TCPUs;const OSes:TOSes) : TTarget;
+function TTargets.AddExampleProgram(const AProgramName: String;
+  const CPUs: TCPUs; const OSes: TOSes): TTarget;
 begin
   Result:=Add as TTarget;
   Result.Name:=AProgramName;
@@ -3542,6 +3678,11 @@ begin
   Result.TargetType:=ttExampleProgram;
 end;
 
+function TTargets.GetEnumerator: TTargetEnumerator;
+begin
+  Result:= TTargetEnumerator.Create(Self);
+end;
+
 
 {****************************************************************************
                                 TSources
@@ -3607,6 +3748,11 @@ begin
   Result.FSourceType:=stTest;
 end;
 
+function TSources.GetEnumerator: TSourceEnumerator;
+begin
+  Result:=TSourceEnumerator.Create(Self);
+end;
+
 procedure TSources.AddDocFiles(const AFileMask, ASearchPathPrefix: string; Recursive: boolean; AInstallSourcePath: String);
 var
   List : TStrings;
@@ -4102,6 +4248,67 @@ begin
     end;
 end;
 
+procedure TBuildEngine.GetDocProject(Proj: TStrings; P : TPackage; aIndent: string);
+
+  Procedure AddLn(S : String);
+
+  begin
+     Proj.Add(aIndent+S);
+  end;
+
+  Procedure AddLn(Fmt : String; Args : array of const);
+
+  begin
+    Proj.Add(aIndent+Fmt,Args);
+  end;
+
+Var
+  T : TTarget;
+  S, O, FN : String;
+  SL : TStringList;
+  L : TUnsortedDuplicatesStringList;
+  I : Integer;
+
+begin
+  GPathPrefix:=P.Directory;
+  AddPackageMacrosToDictionary(P,P.Dictionary);
+  ResolveFileNames(P,Defaults.CPU,Defaults.OS,False,True);
+
+  AddLn('<package name="%s" output="" content="%s.xct">',[quotexml(P.Name),quotexml(P.Name)]);
+  Addln('  <units>');
+  SL:=TStringList.Create;
+  For T in P.Targets do
+    if (T.TargetType=ttUnit) and (T.TargetSourceFileName<>'') then
+      begin
+      SL.Clear;
+      Writeln(T.Name,' -> ',T.TargetSourceFileName);
+      FN:=AddPathPrefix(P,T.TargetSourceFileName);
+      SL.Add('-d'+CPUToString(Defaults.CPU));
+      SL.Add('-d'+OSToString(Defaults.OS));
+      SL.Add('-M'+ModeToString(T.Mode));
+      // Include Path
+      L:=TUnsortedDuplicatesStringList.Create;
+      L.Duplicates:=dupIgnore;
+      AddDependencyPaths(L,depInclude,T);
+      AddConditionalStrings(P, L,P.IncludePath,Defaults.CPU,Defaults.OS);
+      AddConditionalStrings(P, L,T.IncludePath,Defaults.CPU,Defaults.OS);
+      for i:=0 to L.Count-1 do
+        SL.Add('-Fi'+AddPathPrefix(P,L[i]));
+      FreeAndNil(L);
+      if P.HaveOptions Then
+        SL.AddStrings(P.Options);
+      if T.HaveOptions then
+        SL.AddStrings(T.Options);
+      O:='';
+      for S in SL do
+        O:=O+' '+MaybeQuoted(P.Dictionary.ReplaceStrings(S));
+      Delete(O,1,1);
+      AddLn('    <unit file="%s" options="%s"/>',[FN,QuoteXML(O)]);
+      end;
+  Addln('  </units>');
+  AddLn('</package>');
+end;
+
 procedure TPackage.AddPackageVariant(APackageVariant: TPackageVariants);
 begin
   if not assigned(APackageVariant.FMasterPackage) then
@@ -4381,6 +4588,11 @@ begin
     end;
 end;
 
+function TPackages.GetEnumerator: TPackageEnumerator;
+begin
+  Result:= TPackageEnumerator.Create(Self);
+end;
+
 
 {****************************************************************************
                              TCustomDefaults
@@ -4733,7 +4945,7 @@ begin
 end;
 
 
-procedure TCustomDefaults.LocalInit(Const AFileName : String);
+procedure TCustomDefaults.LocalInit(const AFileName: String);
 Var
   FN : String;
 begin
@@ -4800,7 +5012,7 @@ begin
 end;
 
 
-procedure TCustomDefaults.LoadFromFile(Const AFileName: String);
+procedure TCustomDefaults.LoadFromFile(const AFileName: String);
 Var
   F : TFileStream;
 begin
@@ -4813,7 +5025,7 @@ begin
 end;
 
 
-procedure TCustomDefaults.SaveToFile(Const AFileName: String);
+procedure TCustomDefaults.SaveToFile(const AFileName: String);
 Var
   F : TFileStream;
 begin
@@ -5300,6 +5512,8 @@ begin
       FRunMode:=rmUnInstall
     else if CheckCommand(I,'in','info') then
       FRunMode:=rmInfo
+    else if CheckCommand(I,'dp','fpdocproject') then
+      FRunMode:=rmDocProject
     else if CheckOption(I,'h','help') then
       Usage('',[])
     else if Checkoption(I,'C','cpu') then
@@ -5382,6 +5596,10 @@ begin
       Defaults.IgnoreInvalidOptions:=true
     else if CheckOption(I,'df','doc-folder') then
       Defaults.FPDocOutputDir:=OptionArg(I)
+    else if CheckCommand(I,'do','doc-options') then
+      Defaults.FPDocOptions:=OptionArg(I)
+    else if CheckCommand(I,'sd','single-docfile') then
+      Defaults.SingleFPDocFile:=True
     else if CheckOption(I,'fsp','fpunitsrcpath') then
       Defaults.FPUnitSourcePath:=OptionArg(I)
     else if assigned(CustomFpmakeCommandlineOptions) and CheckCustomOption(I,CustOptName) then
@@ -5442,6 +5660,7 @@ begin
   LogCmd('manifest',SHelpManifest);
   LogCmd('zipinstall',SHelpZipInstall);
   LogCmd('pkglist',SHelpPkgList);
+  LogCmd('fpdocproject',SHelpFPDocProject);
   Log(vlInfo,SHelpCmdOptions);
   LogOption('h','help',SHelpHelp);
   LogOption('l','list-commands',SHelpList);
@@ -5471,6 +5690,8 @@ begin
   LogArgOption('f','config',SHelpConfig);
   LogArgOption('o','options',SHelpOptions);
   LogArgOption('df', 'doc-folder', sHelpFpdocOutputDir);
+  LogArgOption('sd','single-docfile', sHelpSingleFpdocFile);
+  LogArgOption('do','doc-options', sHelpDocOptionsFile);
   LogArgOption('fsp', 'fpunitsrcpath', sHelpFPUnitSrcPath);
   LogArgOption('zp', 'zipprefix', sHelpZipPrefix);
 {$ifndef NO_THREADING}
@@ -5579,6 +5800,13 @@ begin
   NotifyEventCollection.CallEvents(neaAfterPkgList, self);
 end;
 
+procedure TCustomInstaller.FPDocProject;
+begin
+  NotifyEventCollection.CallEvents(neaBeforeDocProject, self);
+  BuildEngine.FPDocProject(Packages,Defaults.SingleFPDocFile);
+  NotifyEventCollection.CallEvents(neaAfterDocProject, self);
+end;
+
 procedure TCustomInstaller.AddAutoPackageVariantsToPackage(APackage: TPackage);
 var
   i: Integer;
@@ -5619,6 +5847,7 @@ begin
       rmPkgList : PkgList;
       rmUnInstall : UnInstall;
       rmInfo      : Info;
+      rmDocProject : FPDocProject;
     end;
   except
     On E : Exception do
@@ -8572,6 +8801,87 @@ begin
   NotifyEventCollection.CallEvents(neaAfterPkgList, Self);
 end;
 
+procedure TBuildEngine.FPDocProject(Packages: TPackages; SingleDocFile: Boolean);
+
+  Procedure AddHeader(L,Opts : Tstrings);
+
+  Var
+    I : Integer;
+    N,V : String;
+
+  begin
+    L.Add('<?xml version="1.0" encoding="utf-8"?>');
+    L.Add('<docproject>');
+    L.Add('  <options>');
+    L.Add('    <option name="ostarget" value="'+QuoteXML(CPUToString(Defaults.CPU))+'"/>');
+    L.Add('    <option name="cputarget" value="'+QuoteXML(OSToString(Defaults.OS))+'"/>');
+    L.Add('    <option name="parse-impl" value="false"/>');
+    L.Add('    <option name="dont-trim" value="false"/>');
+    if assigned(Opts) then
+      begin
+      For I:=0 to Opts.Count-1 do
+        begin
+        Opts.GetNameValue(I,N,V);
+        L.Add('    <option name="%s" value="%s"/>',[QuoteXML(N),QuoteXML(V)]);
+        end;
+      end;
+    L.Add('  </options>');
+    L.Add('  <packages>');
+  end;
+
+  Procedure AddFooter(L : Tstrings);
+  begin
+    L.Add('  </packages>');
+    L.Add('</docproject>');
+  end;
+
+Var
+  L,LOpts : TStringList;
+  FN : String;
+  P : TPackage;
+
+begin
+  LOpts:=Nil;
+  L:=TStringList.Create;
+  Try
+    if Defaults.FPDocOptions<>'' then
+       begin
+       LOpts:=TStringList.Create;
+       LOpts.LoadFromFile(Defaults.FPDocOptions);
+       end;
+    if SingleDocFile then
+      begin
+      FN:='fpmake'+DocProjectFileExt;
+      if Defaults.FPDocOutputDir<>'' then
+        FN:=IncludeTrailingPathDelimiter(Defaults.FPDocOutputDir)+FN;
+      Log(vlDebug, Format(SDbgGenerating, [FN]));
+      AddHeader(L,Lopts);
+      Log(vlInfo, Format(SInfoPackageDocProject,['<all>']));
+      For P in Packages do
+        GetDocProject(L,P,'    ');
+      AddFooter(L);
+      L.SaveToFile(FN);
+      end
+   else
+     For P in Packages do
+       begin
+       L.Clear;
+       FN:=P.Name+DocProjectFileExt;
+       if Defaults.FPDocOutputDir<>'' then
+         FN:=IncludeTrailingPathDelimiter(Defaults.FPDocOutputDir)+FN;
+       Log(vlDebug, Format(SDbgGenerating, [FN]));
+       AddHeader(L,Lopts);
+       Log(vlInfo, Format(SInfoPackageDocProject,[P.Name]));
+       GetDocProject(L,P,'    ');
+       AddFooter(L);
+       L.SaveToFile(FN);
+       end;
+  Finally
+    L.Free;
+    Lopts.Free;
+  end;
+end;
+
 procedure TBuildEngine.Clean(Packages: TPackages; AllTargets: boolean);
 Var
   I : Integer;
@@ -9089,7 +9399,7 @@ begin
 end;
 
 
-Function TCommands.AddCommand(const Cmd: String) : TCommand;
+function TCommands.AddCommand(const Cmd: String): TCommand;
 begin
   Result:=AddCommand(fdefaultAt,Cmd,'','','');
 end;
@@ -9107,7 +9417,7 @@ begin
 end;
 
 
-Function TCommands.AddCommand(At: TCommandAt; const Cmd: String) : TCommand;
+function TCommands.AddCommand(At: TCommandAt; const Cmd: String): TCommand;
 begin
   Result:=AddCommand(At,Cmd,'','','');
 end;
@@ -9130,6 +9440,11 @@ begin
   Result.DestFile:=Dest;
 end;
 
+function TCommands.GetEnumerator: TCommandEnumerator;
+begin
+  Result:=TCommandEnumerator.Create(Self);
+end;
+
 
 {****************************************************************************
                            TConditionalString
@@ -9368,6 +9683,11 @@ begin
   inherited create(TNotifyEventItem);
 end;
 
+function TNotifyEventCollection.GetEnumerator: TNotifyEventEnumerator;
+begin
+  Result:= TNotifyEventEnumerator.Create(Self);
+end;
+
 procedure TNotifyEventCollection.AppendEvent(AnAction: TNotifyEventAction; AnEvent: TNotifyEvent);
 var
   item: TNotifyEventItem;
@@ -9379,7 +9699,8 @@ begin
   item.OnAction:=AnAction;
 end;
 
-procedure TNotifyEventCollection.AppendProcEvent(AnAction: TNotifyEventAction; AnProcEvent: TNotifyProcEvent);
+procedure TNotifyEventCollection.AppendProcEvent(AnACtion: TNotifyEventAction;
+  AnProcEvent: TNotifyProcEvent);
 var
   item: TNotifyEventItem;
 begin

+ 1 - 1
packages/fppkg/fpmake.pp

@@ -44,7 +44,7 @@ begin
     P.Email := '';
     P.Description := 'Libraries to create fppkg package managers.';
     P.NeedLibC:= false;
-    P.OSes := P.OSes - [embedded,nativent,msdos,win16,atari,macosclassic,palmos,symbian,zxspectrum,msxdos,amstradcpc];
+    P.OSes := P.OSes - [embedded,nativent,msdos,win16,atari,macosclassic,palmos,symbian,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

+ 1 - 1
packages/hash/fpmake.pp

@@ -23,7 +23,7 @@ begin
     P.Email := '';
     P.Description := 'Several hash and cryptography algorithms (MD5,CRC,Linux crypt and NTLM1).';
     P.NeedLibC:= false;
-    P.OSes:=P.OSes-[embedded,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc];
+    P.OSes:=P.OSes-[embedded,win16,macosclassic,palmos,zxspectrum,msxdos,amstradcpc,sinclairql];
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
 

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini