Browse Source

Merge commit 'f289f2694ab837b414aa131a0514c56fee4950bc' into unicodekvm

Nikolay Nikolov 3 years ago
parent
commit
efe08183be
100 changed files with 2075 additions and 860 deletions
  1. 5 0
      .gitattributes
  2. 11 0
      .gitconfig
  3. 22 0
      .gitignore
  4. 36 0
      .gitlab-ci.yml
  5. 31 0
      .gitlab/issue_templates/Bug.md
  6. 14 0
      .gitlab/issue_templates/Feature Request.md
  7. 18 0
      .gitlab/merge_request_templates/Compiler.md
  8. 15 0
      .gitlab/merge_request_templates/Packages.md
  9. 35 25
      Makefile
  10. 11 0
      Makefile.fpc
  11. 62 46
      compiler/Makefile
  12. 43 23
      compiler/Makefile.fpc
  13. 6 1
      compiler/aarch64/a64att.inc
  14. 5 0
      compiler/aarch64/a64atts.inc
  15. 9 0
      compiler/aarch64/a64ins.dat
  16. 6 1
      compiler/aarch64/a64op.inc
  17. 15 1
      compiler/aarch64/aasmcpu.pas
  18. 37 3
      compiler/aarch64/agcpugas.pas
  19. 119 20
      compiler/aarch64/aoptcpu.pas
  20. 51 30
      compiler/aarch64/cgcpu.pas
  21. 6 2
      compiler/aarch64/cpubase.pas
  22. 12 4
      compiler/aarch64/cpuinfo.pas
  23. 2 2
      compiler/aarch64/cpupara.pas
  24. 98 0
      compiler/aarch64/ncpuinl.pas
  25. 25 7
      compiler/aarch64/racpugas.pas
  26. 18 4
      compiler/aasmbase.pas
  27. 16 14
      compiler/aasmcnst.pas
  28. 50 5
      compiler/aasmtai.pas
  29. 60 45
      compiler/aggas.pas
  30. 3 1
      compiler/aoptobj.pas
  31. 6 2
      compiler/arm/aasmcpu.pas
  32. 4 0
      compiler/arm/agarmgas.pas
  33. 16 6
      compiler/arm/cpuinfo.pas
  34. 1 1
      compiler/arm/cpupara.pas
  35. 5 0
      compiler/arm/narmutil.pas
  36. 59 33
      compiler/armgen/aoptarm.pas
  37. 62 5
      compiler/assemble.pas
  38. 0 2
      compiler/avr/cpuinfo.pas
  39. 54 28
      compiler/cclasses.pas
  40. 9 0
      compiler/cg64f32.pas
  41. 1 1
      compiler/cgobj.pas
  42. 0 3
      compiler/cgutils.pas
  43. 25 14
      compiler/comphook.pas
  44. 2 2
      compiler/compiler.pas
  45. 0 3
      compiler/cresstr.pas
  46. 2 2
      compiler/cstreams.pas
  47. 60 53
      compiler/cutils.pas
  48. 3 0
      compiler/dbgdwarf.pas
  49. 6 1
      compiler/defutil.pas
  50. 1 1
      compiler/fmodule.pas
  51. 0 5
      compiler/fpcdefs.inc
  52. 66 2
      compiler/fpchash.pas
  53. 25 0
      compiler/fppu.pas
  54. 0 2
      compiler/generic/cpuinfo.pas
  55. 17 15
      compiler/globals.pas
  56. 33 9
      compiler/globtype.pas
  57. 23 13
      compiler/hlcgobj.pas
  58. 14 1
      compiler/i386/aoptcpu.pas
  59. 0 2
      compiler/i386/cpuinfo.pas
  60. 2 2
      compiler/i386/cpupara.pas
  61. 8 1
      compiler/i386/i386att.inc
  62. 19 12
      compiler/i386/i386atts.inc
  63. 8 1
      compiler/i386/i386int.inc
  64. 1 1
      compiler/i386/i386nop.inc
  65. 8 1
      compiler/i386/i386op.inc
  66. 14 7
      compiler/i386/i386prop.inc
  67. 102 109
      compiler/i386/i386tab.inc
  68. 18 4
      compiler/i386/n386add.pas
  69. 0 2
      compiler/i8086/cpuinfo.pas
  70. 2 2
      compiler/i8086/cpupara.pas
  71. 8 1
      compiler/i8086/i8086att.inc
  72. 19 12
      compiler/i8086/i8086atts.inc
  73. 8 1
      compiler/i8086/i8086int.inc
  74. 1 1
      compiler/i8086/i8086nop.inc
  75. 8 1
      compiler/i8086/i8086op.inc
  76. 14 7
      compiler/i8086/i8086prop.inc
  77. 102 109
      compiler/i8086/i8086tab.inc
  78. 11 9
      compiler/i8086/n8086add.pas
  79. 4 0
      compiler/jvm/cpubase.pas
  80. 0 2
      compiler/jvm/cpuinfo.pas
  81. 1 1
      compiler/jvm/cpupara.pas
  82. 112 2
      compiler/link.pas
  83. 0 2
      compiler/m68k/cpuinfo.pas
  84. 3 3
      compiler/m68k/cpupara.pas
  85. 1 0
      compiler/m68k/rgcpu.pas
  86. 0 2
      compiler/mips/cpuinfo.pas
  87. 1 1
      compiler/mips/cpupara.pas
  88. 2 2
      compiler/mips/rgcpu.pas
  89. 1 1
      compiler/msg/errorct.msg
  90. 79 19
      compiler/msg/errord.msg
  91. 1 1
      compiler/msg/errorda.msg
  92. 78 19
      compiler/msg/errordu.msg
  93. 97 75
      compiler/msg/errore.msg
  94. 1 1
      compiler/msg/errores.msg
  95. 1 1
      compiler/msg/errorf.msg
  96. 1 1
      compiler/msg/errorfi.msg
  97. 1 1
      compiler/msg/errorhe.msg
  98. 1 1
      compiler/msg/errorheu.msg
  99. 1 1
      compiler/msg/erroriu.msg
  100. 1 1
      compiler/msg/errorn.msg

+ 5 - 0
.gitattributes

@@ -1 +1,6 @@
 * text=auto !eol
 * text=auto !eol
+*.pp gitlab-language=pascal
+*.inc gitlab-language=pascal
+*.pp diff=pascal
+*.pas diff=pascal
+*.inc diff=pascal

+ 11 - 0
.gitconfig

@@ -0,0 +1,11 @@
+# git config entry to make more nice looking diffs
+# run
+#  git config --local include.path ../.gitconfig
+# to include this file in your local git config
+
+# not sure if we could do a [diff "fpc" "pascal"] or something like this
+[diff "fpc"]
+  xfuncname = "^[ \\t]*(((class[ \\t]+)?(procedure|function)|constructor|destructor|[ \\t].*[ \\t]*=[ \\t]*(class|interface|object|record)|initialization|finalization)[ \\t]*.*)$"
+
+[diff "pascal"]
+  xfuncname = "^[ \\t]*(((class[ \\t]+)?(procedure|function)|constructor|destructor|[ \\t].*[ \\t]*=[ \\t]*(class|interface|object|record)|initialization|finalization)[ \\t]*.*)$"

+ 22 - 0
.gitignore

@@ -30,19 +30,26 @@
 fpcmade.*
 fpcmade.*
 *-stamp.*
 *-stamp.*
 build-stamp.*
 build-stamp.*
+BuildUnit_*.pp
+BUnit.pp
 log.*
 log.*
 faillist.*
 faillist.*
+gdb4fpc.ini
+link*.res
 longlog.*
 longlog.*
 bin
 bin
 backup
 backup
 lazbuild
 lazbuild
 *.wpo
 *.wpo
 a.out
 a.out
+symbol_order*.fpc
 /compiler/ppc*
 /compiler/ppc*
+/compiler/gppc*
 !/compiler/ppc*.lpi
 !/compiler/ppc*.lpi
 *.lpi
 *.lpi
 !/compiler/ppc*.pas
 !/compiler/ppc*.pas
 /compiler/*/pp
 /compiler/*/pp
+/compiler/revision.inc
 /compiler/utils/fpc
 /compiler/utils/fpc
 /compiler/utils/msg2inc
 /compiler/utils/msg2inc
 /compiler/utils/mka64ins
 /compiler/utils/mka64ins
@@ -55,9 +62,24 @@ a.out
 /compiler/utils/mkx86inl
 /compiler/utils/mkx86inl
 /packages/fpmake
 /packages/fpmake
 /packages/fpmkunit/units_bs
 /packages/fpmkunit/units_bs
+/rtl/Package.fpc
+/rtl/units-*
 /utils/fpmake
 /utils/fpmake
+/utils/fpcm/fpcmake
 units
 units
+/tests/createlst
+/tests/gparmake
 /tests/output
 /tests/output
+/tests/output*
 !/tests/test/units
 !/tests/test/units
+/tests/tstunits/tmp/
+/tests/tstunits/*-*/
+/tests/utils/concat
+/tests/utils/digest
+/tests/utils/dotest
+/tests/utils/fail
+/tests/utils/fptime
+/tests/utils/testfail
 bin/
 bin/
 fpmake
 fpmake
+packages/fcl-db/tests/database.ini

+ 36 - 0
.gitlab-ci.yml

@@ -0,0 +1,36 @@
+# This .gitlab.ci.yml is based on:
+# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
+# the FPC specific parts are partly from:
+# https://gitlab.com/alb42/testconversion2/-/blob/main/.gitlab-ci.yml
+
+image: registry.gitlab.com/freepascal.org/fpc/source:buster_fpcbuild
+
+stages:
+  - compilercycle
+  - buildandtest
+
+compiler-fullcycle-job:
+  stage: compilercycle
+  script:
+    - cd compiler
+    - make fullcycle -j 4 "OPT=-Oodfa"
+
+build-and-test-job:
+  stage: buildandtest
+  script:
+    - make -j 4 all OS_TARGET=linux CPU_TARGET=x86_64 FPMAKEOPT="-T 4" "OPT=-Oodfa"
+    - FPC_SRC=$(pwd)
+    - FPC_COMPILER=$FPC_SRC/compiler/ppcx64
+    - cd tests
+    - make clean TEST_FPC=$FPC_COMPILER TEST_DELTEMP=1 -j 4
+    - make full TEST_FPC=$FPC_COMPILER TEST_DELTEMP=1 -j 4
+    - cd utils
+    - make fpts2junit
+    - cd $FPC_SRC
+    - tests/utils/fpts2junit $FPC_SRC/tests/output/x86_64-linux/ testresult.xml
+  artifacts:
+    when: always  
+    paths:
+      - testresult.xml
+    reports:
+      junit: testresult.xml

+ 31 - 0
.gitlab/issue_templates/Bug.md

@@ -0,0 +1,31 @@
+## Summary
+<!-- Summarize the bug encountered concisely -->
+
+## System Information
+<!-- The more information are provided the easier it is to replicate the bug -->
+- **Operating system:** <!-- Windows, Linux (if possible, also name the distro), FreeBSD, Android, ... -->
+- **Processor architecture:** <!-- x86, x86-64, ARM, AARCH64, AVR, RISC-V, PowerPC, ... -->
+- **Compiler version:** <!-- 3.2, 3.2.2, 3.3, trunk, beta, ... (if possible, give also the git hash) -->
+- **Device:** <!-- Computer, Tablet, Mobile, Amiga, Microcontroller, ... -->
+
+## Steps to reproduce
+<!-- How one can reproduce the issue - this is very important! -->
+
+## Example Project
+<!-- If possible, please create an example project that exhibits the problematic
+behavior, and link to it here in the bug report. -->
+
+## What is the current bug behavior?
+<!-- What actually happens -->
+
+## What is the expected (correct) behavior?
+<!-- What you should see instead -->
+
+## Relevant logs and/or screenshots
+<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as
+it's very hard to read otherwise.
+You can also use syntax highlighting for Pascal with: ```pascal  the code```
+For more information see https://docs.gitlab.com/ee/user/markdown.html -->
+
+## Possible fixes
+<!-- If you can, link to the line of code that might be responsible for the problem -->

+ 14 - 0
.gitlab/issue_templates/Feature Request.md

@@ -0,0 +1,14 @@
+## Summary
+<!-- Summarize the wanted feature concisely -->
+
+## System Information
+<!-- Provide details if the feature request is only valid for specific platforms, otherwise remove this section -->
+- **Operating system:** <!-- Windows, Linux (if possible, also name the distro), FreeBSD, Android, ... -->
+- **Processor architecture:** <!-- x86, x86-64, ARM, AARCH64, AVR, RISC-V, PowerPC, ... -->
+- **Device:** <!-- Computer, Tablet, Mobile, Amiga, Microcontroller, ... -->
+
+## Example Project
+<!-- If possible, please create an example project that shows the usage of the wanted feature and the advantage of it, and link to it here in the bug report. -->
+
+## Relevant 3rd party information
+<!-- If this feature is already available in other languages please provide some information about it or link to Delphi Documentation if it's about Delphi compatibility -->

+ 18 - 0
.gitlab/merge_request_templates/Compiler.md

@@ -0,0 +1,18 @@
+## Summary
+<!-- Summarize the changes from this merge request -->
+
+## System
+<!-- All systems this patch will have an effect om -->
+- **Operating system:** <!-- Windows, Linux (if possible, also name the distro), FreeBSD, Android, ... -->
+- **Processor architecture:** <!-- x86, x86-64, ARM, AARCH64, AVR, RISC-V, PowerPC, ... -->
+- **Device:** <!-- Computer, Tablet, Mobile, Amiga, Microcontroller, ... -->
+
+## What is the current bug behavior?
+<!-- What actually happens -->
+
+## What is the behavior after applying this patch?
+<!-- What you should see instead -->
+
+## Relevant logs and/or screenshots
+<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as
+it's very hard to read otherwise.  -->

+ 15 - 0
.gitlab/merge_request_templates/Packages.md

@@ -0,0 +1,15 @@
+## Summary
+<!-- Summarize the changes from this merge request -->
+
+## What is the current bug behavior?
+<!-- What actually happens -->
+
+## What is the behavior after applying this patch?
+<!-- What you should see instead -->
+
+## Relevant logs and/or screenshots
+<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as
+it's very hard to read otherwise.  -->
+
+<!-- automatically add a label - do not touch this area -->
+/label ~Packages

+ 35 - 25
Makefile

@@ -58,7 +58,7 @@ SRCBATCHEXT=.bat
 endif
 endif
 endif
 endif
 ifdef COMSPEC
 ifdef COMSPEC
-ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+ifneq ($(filter $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
 ifndef RUNBATCH
 ifndef RUNBATCH
 RUNBATCH=$(COMSPEC) /C
 RUNBATCH=$(COMSPEC) /C
 endif
 endif
@@ -214,11 +214,11 @@ $(error When compiling for arm-freertos, a sub-architecture (e.g. SUBARCH=armv6m
 endif
 endif
 override FPCOPT+=-Cp$(SUBARCH)
 override FPCOPT+=-Cp$(SUBARCH)
 endif
 endif
-ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+ifneq ($(filter $(OS_SOURCE),$(LIMIT83fs)),)
 TARGETSUFFIX=$(OS_TARGET)
 TARGETSUFFIX=$(OS_TARGET)
 SOURCESUFFIX=$(OS_SOURCE)
 SOURCESUFFIX=$(OS_SOURCE)
 else
 else
-ifneq ($(findstring $(OS_TARGET),$(LIMIT83fs)),)
+ifneq ($(filter $(OS_TARGET),$(LIMIT83fs)),)
 TARGETSUFFIX=$(OS_TARGET)
 TARGETSUFFIX=$(OS_TARGET)
 else
 else
 TARGETSUFFIX=$(FULL_TARGET)
 TARGETSUFFIX=$(FULL_TARGET)
@@ -229,11 +229,11 @@ ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
 ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
 ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
-ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+ifeq ($(filter $(FULL_TARGET),$(MAKEFILETARGETS)),)
 $(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
 $(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
 endif
 endif
 endif
 endif
-ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+ifneq ($(filter $(OS_TARGET),$(BSDs)),)
 BSDhier=1
 BSDhier=1
 endif
 endif
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
@@ -287,8 +287,8 @@ endif
 ifndef CROSSBINDIR
 ifndef CROSSBINDIR
 CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
 CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
 endif
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim ios),)
-ifneq ($(findstring $(OS_SOURCE),darwin ios),)
+ifneq ($(filter $(OS_TARGET),darwin iphonesim ios),)
+ifneq ($(filter $(OS_SOURCE),darwin ios),)
 DARWIN2DARWIN=1
 DARWIN2DARWIN=1
 endif
 endif
 endif
 endif
@@ -514,6 +514,10 @@ UTILS=1
 endif
 endif
 endif
 endif
 endif
 endif
+INSTALLERTARGETS=emx go32v2 msdos os2
+ifneq ($(findstring $(OS_TARGET),$(INSTALLERTARGETS)),)
+INSTALLER=1
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_DIRS+=compiler rtl utils packages installer
 override TARGET_DIRS+=compiler rtl utils packages installer
 endif
 endif
@@ -840,11 +844,11 @@ ifdef REQUIRE_PACKAGESDIR
 override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
 override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
 endif
 endif
 ifdef ZIPINSTALL
 ifdef ZIPINSTALL
-ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+ifneq ($(filter $(OS_TARGET),$(UNIXs)),)
 UNIXHier=1
 UNIXHier=1
 endif
 endif
 else
 else
-ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+ifneq ($(filter $(OS_SOURCE),$(UNIXs)),)
 UNIXHier=1
 UNIXHier=1
 endif
 endif
 endif
 endif
@@ -1032,7 +1036,7 @@ endif
 ifeq ($(OS_SOURCE),linux)
 ifeq ($(OS_SOURCE),linux)
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 ifeq ($(CPU_TARGET),i386)
 ifeq ($(CPU_TARGET),i386)
-ifneq ($(findstring x86_64,$(shell uname -a)),)
+ifneq ($(filter x86_64,$(shell uname -a)),)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 else
 else
@@ -1055,11 +1059,11 @@ CROSSGCCOPT=-m64
 endif
 endif
 endif
 endif
 ifeq ($(CPU_TARGET),sparc)
 ifeq ($(CPU_TARGET),sparc)
-ifneq ($(findstring sparc64,$(shell uname -a)),)
+ifneq ($(filter sparc64,$(shell uname -a)),)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),mips mipsel),)
+ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips mipsel),)
 CROSSGCCOPT=-mabi=32
 CROSSGCCOPT=-mabi=32
 else
 else
 CROSSGCCOPT=-m32
 CROSSGCCOPT=-m32
@@ -1073,19 +1077,19 @@ FPCFPMAKE_CPU_TARGET=$(shell $(FPCFPMAKE) -iTP)
 ifeq ($(CPU_TARGET),$(FPCFPMAKE_CPU_TARGET))
 ifeq ($(CPU_TARGET),$(FPCFPMAKE_CPU_TARGET))
 FPCMAKEGCCLIBDIR:=$(GCCLIBDIR)
 FPCMAKEGCCLIBDIR:=$(GCCLIBDIR)
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_TARGET),aarch64 powerpc64 riscv64 sparc64 x86_64),)
+ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),aarch64 powerpc64 riscv64 sparc64 x86_64),)
 FPCMAKE_CROSSGCCOPT=-m64
 FPCMAKE_CROSSGCCOPT=-m64
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),mips64 mips64el),)
+ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips64 mips64el),)
 FPCMAKE_CROSSGCCOPT=-mabi=64
 FPCMAKE_CROSSGCCOPT=-mabi=64
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),mips mipsel),)
+ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips mipsel),)
 FPCMAKE_CROSSGCCOPT=-mabi=32
 FPCMAKE_CROSSGCCOPT=-mabi=32
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),riscv64),)
+ifeq ($(FPCFPMAKE_CPU_OPT),riscv64)
 FPCMAKE_CROSSGCCOPT=-mabi=lp64
 FPCMAKE_CROSSGCCOPT=-mabi=lp64
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),riscv32),)
+ifeq ($(FPCFPMAKE_CPU_OPT),riscv32)
 FPCMAKE_CROSSGCCOPT=-mabi=ilp32
 FPCMAKE_CROSSGCCOPT=-mabi=ilp32
 else
 else
 FPCMAKE_CROSSGCCOPT=-m32
 FPCMAKE_CROSSGCCOPT=-m32
@@ -1264,7 +1268,7 @@ DEBUGSYMEXT=.xcoff
 SHORTSUFFIX=mac
 SHORTSUFFIX=mac
 IMPORTLIBPREFIX=imp
 IMPORTLIBPREFIX=imp
 endif
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim ios),)
+ifneq ($(filter $(OS_TARGET),darwin iphonesim ios),)
 BATCHEXT=.sh
 BATCHEXT=.sh
 EXEEXT=
 EXEEXT=
 HASSHAREDLIB=1
 HASSHAREDLIB=1
@@ -1343,7 +1347,7 @@ endif
 ifeq ($(OS_TARGET),wasi)
 ifeq ($(OS_TARGET),wasi)
 EXEEXT=.wasm
 EXEEXT=.wasm
 endif
 endif
-ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+ifneq ($(filter $(OS_SOURCE),$(LIMIT83fs)),)
 FPCMADE=fpcmade.$(SHORTSUFFIX)
 FPCMADE=fpcmade.$(SHORTSUFFIX)
 ZIPSUFFIX=$(SHORTSUFFIX)
 ZIPSUFFIX=$(SHORTSUFFIX)
 ZIPCROSSPREFIX=
 ZIPCROSSPREFIX=
@@ -1704,8 +1708,8 @@ ifdef SYSROOTPATH
 override FPCOPT+=-XR$(SYSROOTPATH)
 override FPCOPT+=-XR$(SYSROOTPATH)
 else
 else
 ifeq ($(OS_TARGET),$(OS_SOURCE))
 ifeq ($(OS_TARGET),$(OS_SOURCE))
-ifneq ($(findstring $(OS_TARGET),darwin),)
-ifneq ($(findstring $(CPU_TARGET),aarch64),)
+ifeq ($(OS_TARGET),darwin)
+ifeq ($(CPU_TARGET),aarch64)
 ifneq ($(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk),)
 ifneq ($(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk),)
 override FPCOPT+=-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
 override FPCOPT+=-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
 endif
 endif
@@ -1716,8 +1720,8 @@ endif
 ifdef CREATESHARED
 ifdef CREATESHARED
 override FPCOPT+=-Cg
 override FPCOPT+=-Cg
 endif
 endif
-ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
-ifneq ($(findstring $(CPU_TARGET),x86_64 mips mipsel riscv64),)
+ifneq ($(filter $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
+ifneq ($(filter $(CPU_TARGET),x86_64 mips mipsel riscv64 powerpc64),)
 override FPCOPT+=-Cg
 override FPCOPT+=-Cg
 endif
 endif
 endif
 endif
@@ -1760,10 +1764,10 @@ ifdef ACROSSCOMPILE
 override FPCOPT+=$(CROSSOPT)
 override FPCOPT+=$(CROSSOPT)
 endif
 endif
 override COMPILER:=$(strip $(FPC) $(FPCOPT))
 override COMPILER:=$(strip $(FPC) $(FPCOPT))
-ifneq (,$(findstring -sh ,$(COMPILER)))
+ifneq (,$(filter -sh,$(COMPILER)))
 UseEXECPPAS=1
 UseEXECPPAS=1
 endif
 endif
-ifneq (,$(findstring -s ,$(COMPILER)))
+ifneq (,$(filter -s,$(COMPILER)))
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
 UseEXECPPAS=1
 UseEXECPPAS=1
 endif
 endif
@@ -3173,11 +3177,17 @@ endif
 	$(MAKE) packages_clean $(CLEANOPTS)
 	$(MAKE) packages_clean $(CLEANOPTS)
 ifdef UTILS
 ifdef UTILS
 	$(MAKE) utils_clean $(CLEANOPTS)
 	$(MAKE) utils_clean $(CLEANOPTS)
+endif
+ifdef INSTALLER
+	$(MAKE) installer_clean $(CLEANOPTS)
 endif
 endif
 	$(MAKE) rtl_$(ALLTARGET) $(BUILDOPTS)
 	$(MAKE) rtl_$(ALLTARGET) $(BUILDOPTS)
 	$(MAKE) packages_$(ALLTARGET) $(BUILDOPTS)
 	$(MAKE) packages_$(ALLTARGET) $(BUILDOPTS)
 ifdef UTILS
 ifdef UTILS
 	$(MAKE) utils_all $(BUILDOPTS)
 	$(MAKE) utils_all $(BUILDOPTS)
+endif
+ifdef INSTALLER
+	$(MAKE) installer_all $(BUILDOPTS)
 endif
 endif
 	$(ECHOREDIR) Build > $(BUILDSTAMP)
 	$(ECHOREDIR) Build > $(BUILDSTAMP)
 	$(ECHOREDIR) Build > base.$(BUILDSTAMP)
 	$(ECHOREDIR) Build > base.$(BUILDSTAMP)

+ 11 - 0
Makefile.fpc

@@ -231,6 +231,11 @@ endif
 endif
 endif
 endif
 endif
 
 
+INSTALLERTARGETS=emx go32v2 msdos os2
+ifneq ($(findstring $(OS_TARGET),$(INSTALLERTARGETS)),)
+INSTALLER=1
+endif
+
 [rules]
 [rules]
 # These values can change
 # These values can change
 unexport FPC_VERSION FPC_COMPILERINFO OS_SOURCE
 unexport FPC_VERSION FPC_COMPILERINFO OS_SOURCE
@@ -323,11 +328,17 @@ endif
 ifdef UTILS
 ifdef UTILS
         $(MAKE) utils_clean $(CLEANOPTS)
         $(MAKE) utils_clean $(CLEANOPTS)
 endif
 endif
+ifdef INSTALLER
+        $(MAKE) installer_clean $(CLEANOPTS)
+endif
 # build everything
 # build everything
         $(MAKE) rtl_$(ALLTARGET) $(BUILDOPTS)
         $(MAKE) rtl_$(ALLTARGET) $(BUILDOPTS)
         $(MAKE) packages_$(ALLTARGET) $(BUILDOPTS)
         $(MAKE) packages_$(ALLTARGET) $(BUILDOPTS)
 ifdef UTILS
 ifdef UTILS
         $(MAKE) utils_all $(BUILDOPTS)
         $(MAKE) utils_all $(BUILDOPTS)
+endif
+ifdef INSTALLER
+        $(MAKE) installer_all $(BUILDOPTS)
 endif
 endif
         $(ECHOREDIR) Build > $(BUILDSTAMP)
         $(ECHOREDIR) Build > $(BUILDSTAMP)
         $(ECHOREDIR) Build > base.$(BUILDSTAMP)
         $(ECHOREDIR) Build > base.$(BUILDSTAMP)

+ 62 - 46
compiler/Makefile

@@ -58,7 +58,7 @@ SRCBATCHEXT=.bat
 endif
 endif
 endif
 endif
 ifdef COMSPEC
 ifdef COMSPEC
-ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+ifneq ($(filter $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
 ifndef RUNBATCH
 ifndef RUNBATCH
 RUNBATCH=$(COMSPEC) /C
 RUNBATCH=$(COMSPEC) /C
 endif
 endif
@@ -214,11 +214,11 @@ $(error When compiling for arm-freertos, a sub-architecture (e.g. SUBARCH=armv6m
 endif
 endif
 override FPCOPT+=-Cp$(SUBARCH)
 override FPCOPT+=-Cp$(SUBARCH)
 endif
 endif
-ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+ifneq ($(filter $(OS_SOURCE),$(LIMIT83fs)),)
 TARGETSUFFIX=$(OS_TARGET)
 TARGETSUFFIX=$(OS_TARGET)
 SOURCESUFFIX=$(OS_SOURCE)
 SOURCESUFFIX=$(OS_SOURCE)
 else
 else
-ifneq ($(findstring $(OS_TARGET),$(LIMIT83fs)),)
+ifneq ($(filter $(OS_TARGET),$(LIMIT83fs)),)
 TARGETSUFFIX=$(OS_TARGET)
 TARGETSUFFIX=$(OS_TARGET)
 else
 else
 TARGETSUFFIX=$(FULL_TARGET)
 TARGETSUFFIX=$(FULL_TARGET)
@@ -229,11 +229,11 @@ ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
 ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
 ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
-ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+ifeq ($(filter $(FULL_TARGET),$(MAKEFILETARGETS)),)
 $(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
 $(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
 endif
 endif
 endif
 endif
-ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+ifneq ($(filter $(OS_TARGET),$(BSDs)),)
 BSDhier=1
 BSDhier=1
 endif
 endif
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
@@ -287,8 +287,8 @@ endif
 ifndef CROSSBINDIR
 ifndef CROSSBINDIR
 CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
 CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
 endif
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim ios),)
-ifneq ($(findstring $(OS_SOURCE),darwin ios),)
+ifneq ($(filter $(OS_TARGET),darwin iphonesim ios),)
+ifneq ($(filter $(OS_SOURCE),darwin ios),)
 DARWIN2DARWIN=1
 DARWIN2DARWIN=1
 endif
 endif
 endif
 endif
@@ -451,13 +451,19 @@ endif
 ifndef RTLOPT
 ifndef RTLOPT
 RTLOPT:=$(OPT)
 RTLOPT:=$(OPT)
 endif
 endif
+SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH))))
+ifndef GIT
+GIT:=$(firstword $(wildcard $(addsuffix /git$(SRCEXEEXT),$(SEARCHPATH))))
+endif
 DATE_FMT = +%Y/%m/%d
 DATE_FMT = +%Y/%m/%d
 ifdef SOURCE_DATE_EPOCH
 ifdef SOURCE_DATE_EPOCH
     COMPDATESTR ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
     COMPDATESTR ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
 else
 else
    GIT_DIR = $(wildcard ../.git)
    GIT_DIR = $(wildcard ../.git)
    ifneq ($(GIT_DIR),)
    ifneq ($(GIT_DIR),)
-      COMPDATESTR:=$(shell git log -1 --pretty=%cd --date=format:'%Y/%m/%d')
+      ifneq ($(GIT),)
+	COMPDATESTR:=$(shell $(GIT) log -1 --pretty=%cd --date=format:'%Y/%m/%d')
+      endif
    endif
    endif
 endif
 endif
 ifdef COMPDATESTR
 ifdef COMPDATESTR
@@ -557,7 +563,6 @@ CPUSUF=wasm32
 endif
 endif
 NOCPUDEF=1
 NOCPUDEF=1
 MSGFILE=msg/error$(FPCLANG).msg
 MSGFILE=msg/error$(FPCLANG).msg
-SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH))))
 PPUDUMPPROG:=$(firstword $(strip $(wildcard $(addsuffix /ppudump$(SRCEXEEXT),$(SEARCHPATH)))))
 PPUDUMPPROG:=$(firstword $(strip $(wildcard $(addsuffix /ppudump$(SRCEXEEXT),$(SEARCHPATH)))))
 ifndef PPUDUMP
 ifndef PPUDUMP
 ifdef PPUDUMPPROG
 ifdef PPUDUMPPROG
@@ -569,18 +574,33 @@ endif
 REVINC:=$(wildcard revision.inc)
 REVINC:=$(wildcard revision.inc)
 ifneq ($(REVINC),)
 ifneq ($(REVINC),)
 override LOCALOPT+=-dREVINC
 override LOCALOPT+=-dREVINC
-ifeq ($(REVSTR),)
-ifneq ($(SVNVERSION),)
+ ifeq ($(REVSTR),)
+  ifneq ($(wildcard ../.git),)
+   ifneq ($(GIT),)
+GITDESCRIBE=$(shell $(GIT) describe --dirty)
+REVSTR:=$(word 2,$(subst -, ,$(GITDESCRIBE)))-$(word 3,$(subst -, ,$(GITDESCRIBE)))
+    ifneq ($(shell $(GIT) log @{u}..),)
+REVSTR:=$(REVSTR)-unpushed
+    endif
+    ifneq ($(word 4,$(subst -, ,$(GITDESCRIBE))),)
+REVSTR:=$(REVSTR)-$(word 4,$(subst -, ,$(GITDESCRIBE)))
+    endif
+   endif
+export REVSTR
+  else
+   ifneq ($(SVNVERSION),)
 REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
 REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
 export REVSTR
 export REVSTR
-else
+   endif
+  endif
+ endif
+endif
 ifeq ($(REVINC),force)
 ifeq ($(REVINC),force)
+ifeq ($(REVSTR),)
 REVSTR:=exported
 REVSTR:=exported
 export REVSTR
 export REVSTR
 endif
 endif
 endif
 endif
-endif
-endif
 override LOCALOPT+=-d$(CPC_TARGET) -dGDB
 override LOCALOPT+=-d$(CPC_TARGET) -dGDB
 ifdef LLVM
 ifdef LLVM
 ifeq ($(findstring $(PPC_TARGET),x86_64 aarch64 arm),)
 ifeq ($(findstring $(PPC_TARGET),x86_64 aarch64 arm),)
@@ -2565,11 +2585,11 @@ ifdef REQUIRE_PACKAGESDIR
 override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
 override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
 endif
 endif
 ifdef ZIPINSTALL
 ifdef ZIPINSTALL
-ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+ifneq ($(filter $(OS_TARGET),$(UNIXs)),)
 UNIXHier=1
 UNIXHier=1
 endif
 endif
 else
 else
-ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+ifneq ($(filter $(OS_SOURCE),$(UNIXs)),)
 UNIXHier=1
 UNIXHier=1
 endif
 endif
 endif
 endif
@@ -2757,7 +2777,7 @@ endif
 ifeq ($(OS_SOURCE),linux)
 ifeq ($(OS_SOURCE),linux)
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 ifeq ($(CPU_TARGET),i386)
 ifeq ($(CPU_TARGET),i386)
-ifneq ($(findstring x86_64,$(shell uname -a)),)
+ifneq ($(filter x86_64,$(shell uname -a)),)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 else
 else
@@ -2780,11 +2800,11 @@ CROSSGCCOPT=-m64
 endif
 endif
 endif
 endif
 ifeq ($(CPU_TARGET),sparc)
 ifeq ($(CPU_TARGET),sparc)
-ifneq ($(findstring sparc64,$(shell uname -a)),)
+ifneq ($(filter sparc64,$(shell uname -a)),)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),mips mipsel),)
+ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips mipsel),)
 CROSSGCCOPT=-mabi=32
 CROSSGCCOPT=-mabi=32
 else
 else
 CROSSGCCOPT=-m32
 CROSSGCCOPT=-m32
@@ -2798,19 +2818,19 @@ FPCFPMAKE_CPU_TARGET=$(shell $(FPCFPMAKE) -iTP)
 ifeq ($(CPU_TARGET),$(FPCFPMAKE_CPU_TARGET))
 ifeq ($(CPU_TARGET),$(FPCFPMAKE_CPU_TARGET))
 FPCMAKEGCCLIBDIR:=$(GCCLIBDIR)
 FPCMAKEGCCLIBDIR:=$(GCCLIBDIR)
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_TARGET),aarch64 powerpc64 riscv64 sparc64 x86_64),)
+ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),aarch64 powerpc64 riscv64 sparc64 x86_64),)
 FPCMAKE_CROSSGCCOPT=-m64
 FPCMAKE_CROSSGCCOPT=-m64
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),mips64 mips64el),)
+ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips64 mips64el),)
 FPCMAKE_CROSSGCCOPT=-mabi=64
 FPCMAKE_CROSSGCCOPT=-mabi=64
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),mips mipsel),)
+ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips mipsel),)
 FPCMAKE_CROSSGCCOPT=-mabi=32
 FPCMAKE_CROSSGCCOPT=-mabi=32
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),riscv64),)
+ifeq ($(FPCFPMAKE_CPU_OPT),riscv64)
 FPCMAKE_CROSSGCCOPT=-mabi=lp64
 FPCMAKE_CROSSGCCOPT=-mabi=lp64
 else
 else
-ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),riscv32),)
+ifeq ($(FPCFPMAKE_CPU_OPT),riscv32)
 FPCMAKE_CROSSGCCOPT=-mabi=ilp32
 FPCMAKE_CROSSGCCOPT=-mabi=ilp32
 else
 else
 FPCMAKE_CROSSGCCOPT=-m32
 FPCMAKE_CROSSGCCOPT=-m32
@@ -2989,7 +3009,7 @@ DEBUGSYMEXT=.xcoff
 SHORTSUFFIX=mac
 SHORTSUFFIX=mac
 IMPORTLIBPREFIX=imp
 IMPORTLIBPREFIX=imp
 endif
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim ios),)
+ifneq ($(filter $(OS_TARGET),darwin iphonesim ios),)
 BATCHEXT=.sh
 BATCHEXT=.sh
 EXEEXT=
 EXEEXT=
 HASSHAREDLIB=1
 HASSHAREDLIB=1
@@ -3068,7 +3088,7 @@ endif
 ifeq ($(OS_TARGET),wasi)
 ifeq ($(OS_TARGET),wasi)
 EXEEXT=.wasm
 EXEEXT=.wasm
 endif
 endif
-ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+ifneq ($(filter $(OS_SOURCE),$(LIMIT83fs)),)
 FPCMADE=fpcmade.$(SHORTSUFFIX)
 FPCMADE=fpcmade.$(SHORTSUFFIX)
 ZIPSUFFIX=$(SHORTSUFFIX)
 ZIPSUFFIX=$(SHORTSUFFIX)
 ZIPCROSSPREFIX=
 ZIPCROSSPREFIX=
@@ -3786,8 +3806,8 @@ ifdef SYSROOTPATH
 override FPCOPT+=-XR$(SYSROOTPATH)
 override FPCOPT+=-XR$(SYSROOTPATH)
 else
 else
 ifeq ($(OS_TARGET),$(OS_SOURCE))
 ifeq ($(OS_TARGET),$(OS_SOURCE))
-ifneq ($(findstring $(OS_TARGET),darwin),)
-ifneq ($(findstring $(CPU_TARGET),aarch64),)
+ifeq ($(OS_TARGET),darwin)
+ifeq ($(CPU_TARGET),aarch64)
 ifneq ($(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk),)
 ifneq ($(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk),)
 override FPCOPT+=-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
 override FPCOPT+=-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
 endif
 endif
@@ -3798,8 +3818,8 @@ endif
 ifdef CREATESHARED
 ifdef CREATESHARED
 override FPCOPT+=-Cg
 override FPCOPT+=-Cg
 endif
 endif
-ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
-ifneq ($(findstring $(CPU_TARGET),x86_64 mips mipsel riscv64),)
+ifneq ($(filter $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
+ifneq ($(filter $(CPU_TARGET),x86_64 mips mipsel riscv64 powerpc64),)
 override FPCOPT+=-Cg
 override FPCOPT+=-Cg
 endif
 endif
 endif
 endif
@@ -3842,10 +3862,10 @@ ifdef ACROSSCOMPILE
 override FPCOPT+=$(CROSSOPT)
 override FPCOPT+=$(CROSSOPT)
 endif
 endif
 override COMPILER:=$(strip $(FPC) $(FPCOPT))
 override COMPILER:=$(strip $(FPC) $(FPCOPT))
-ifneq (,$(findstring -sh ,$(COMPILER)))
+ifneq (,$(filter -sh,$(COMPILER)))
 UseEXECPPAS=1
 UseEXECPPAS=1
 endif
 endif
-ifneq (,$(findstring -s ,$(COMPILER)))
+ifneq (,$(filter -s,$(COMPILER)))
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
 UseEXECPPAS=1
 UseEXECPPAS=1
 endif
 endif
@@ -4971,6 +4991,9 @@ endif
 else
 else
 	$(MAKE) revision.inc REVINC=force
 	$(MAKE) revision.inc REVINC=force
 endif
 endif
+ifeq ($(COMPILEREXENAME),)
+COMPILEREXENAME:=$(EXENAME)
+endif
 .PHONY : revision
 .PHONY : revision
 revision :
 revision :
 	$(DEL) revision.inc
 	$(DEL) revision.inc
@@ -4991,9 +5014,8 @@ else
 endif
 endif
 	$(COMPILER) version.pas
 	$(COMPILER) version.pas
 endif
 endif
-	$(COMPILER) pp.pas
+	$(COMPILER) -o$(BASEDIR)/$(COMPILEREXENAME) pp.pas
 	$(EXECPPAS)
 	$(EXECPPAS)
-	$(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME)
 .PHONY: cycle full full_targets fullcycle wpocycle
 .PHONY: cycle full full_targets fullcycle wpocycle
 ifeq ($(CPU_SOURCE),$(PPC_TARGET))
 ifeq ($(CPU_SOURCE),$(PPC_TARGET))
 ifeq ($(OS_SOURCE),$(OS_TARGET))
 ifeq ($(OS_SOURCE),$(OS_TARGET))
@@ -5010,13 +5032,11 @@ wpocycle:
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtlclean
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtlclean
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtl
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtl
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' $(addsuffix _clean,$(ALLTARGETS))
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' $(addsuffix _clean,$(ALLTARGETS))
-	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' compiler
-	$(MOVE) $(EXENAME) $(TEMPWPONAME1)
+	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' 'COMPILEREXENAME=$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' compiler 
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtlclean
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtlclean
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtl
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtl
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' $(addsuffix _clean,$(ALLTARGETS))
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' $(addsuffix _clean,$(ALLTARGETS))
-	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' compiler
-	$(COPY) $(EXENAME) $(TEMPWPONAME2)
+	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' 'COMPILEREXENAME=$(EXENAME)' compiler
 else
 else
 wpocycle:
 wpocycle:
 endif
 endif
@@ -5050,17 +5070,13 @@ next :
 	$(MAKE) echotime
 	$(MAKE) echotime
 endif
 endif
 $(TEMPNAME1) :
 $(TEMPNAME1) :
-	$(MAKE) 'OLDFPC=' next CYCLELEVEL=1
-	-$(DEL) $(TEMPNAME1)
-	$(MOVE) $(EXENAME) $(TEMPNAME1)
+	$(MAKE) 'OLDFPC=' next CYCLELEVEL=1 'COMPILEREXENAME=$(TEMPNAME1PREFIX)$(TEMPNAME1)'
 $(TEMPNAME2) : $(TEMPNAME1)
 $(TEMPNAME2) : $(TEMPNAME1)
-	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME1PREFIX)$(TEMPNAME1)' 'OLDFPC=' next CYCLELEVEL=2
-	-$(DEL) $(TEMPNAME2)
-	$(MOVE) $(EXENAME) $(TEMPNAME2)
+	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME1PREFIX)$(TEMPNAME1)' 'OLDFPC=' next CYCLELEVEL=2 'COMPILEREXENAME=$(TEMPNAME2REFIX)$(TEMPNAME2)'
 $(TEMPNAME3) : $(TEMPNAME2)
 $(TEMPNAME3) : $(TEMPNAME2)
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME2PREFIX)$(TEMPNAME2)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME1)' next CYCLELEVEL=3
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME2PREFIX)$(TEMPNAME2)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME1)' next CYCLELEVEL=3
-	-$(DEL) $(TEMPNAME3)
-	$(MOVE) $(EXENAME) $(TEMPNAME3)
+		-$(DEL) $(TEMPNAME3)
+		$(MOVE) $(EXENAME) $(TEMPNAME3)
 cycle:
 cycle:
 ifdef NEED_G_COMPILERS
 ifdef NEED_G_COMPILERS
 	$(MAKE) fpcmade.generate_g_compilers
 	$(MAKE) fpcmade.generate_g_compilers

+ 43 - 23
compiler/Makefile.fpc

@@ -168,6 +168,12 @@ ifndef RTLOPT
 RTLOPT:=$(OPT)
 RTLOPT:=$(OPT)
 endif
 endif
 
 
+SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH))))
+
+ifndef GIT
+GIT:=$(firstword $(wildcard $(addsuffix /git$(SRCEXEEXT),$(SEARCHPATH))))
+endif
+
 DATE_FMT = +%Y/%m/%d
 DATE_FMT = +%Y/%m/%d
 ifdef SOURCE_DATE_EPOCH
 ifdef SOURCE_DATE_EPOCH
     COMPDATESTR ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
     COMPDATESTR ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
@@ -176,7 +182,9 @@ else
    GIT_DIR = $(wildcard ../.git)
    GIT_DIR = $(wildcard ../.git)
    ifneq ($(GIT_DIR),)
    ifneq ($(GIT_DIR),)
       # ... then take date from head
       # ... then take date from head
-      COMPDATESTR:=$(shell git log -1 --pretty=%cd --date=format:'%Y/%m/%d')
+      ifneq ($(GIT),)
+        COMPDATESTR:=$(shell $(GIT) log -1 --pretty=%cd --date=format:'%Y/%m/%d')
+      endif
    endif
    endif
 endif
 endif
 
 
@@ -290,8 +298,6 @@ NOCPUDEF=1
 # Default message file
 # Default message file
 MSGFILE=msg/error$(FPCLANG).msg
 MSGFILE=msg/error$(FPCLANG).msg
 
 
-
-SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH))))
 PPUDUMPPROG:=$(firstword $(strip $(wildcard $(addsuffix /ppudump$(SRCEXEEXT),$(SEARCHPATH)))))
 PPUDUMPPROG:=$(firstword $(strip $(wildcard $(addsuffix /ppudump$(SRCEXEEXT),$(SEARCHPATH)))))
 ifndef PPUDUMP
 ifndef PPUDUMP
 ifdef PPUDUMPPROG
 ifdef PPUDUMPPROG
@@ -309,18 +315,35 @@ ifneq ($(REVINC),)
 override LOCALOPT+=-dREVINC
 override LOCALOPT+=-dREVINC
 # Automatically update revision.inc if
 # Automatically update revision.inc if
 # svnversion executable is available
 # svnversion executable is available
-ifeq ($(REVSTR),)
-ifneq ($(SVNVERSION),)
+ ifeq ($(REVSTR),)
+  ifneq ($(wildcard ../.git),)
+   ifneq ($(GIT),)
+GITDESCRIBE=$(shell $(GIT) describe --dirty)
+REVSTR:=$(word 2,$(subst -, ,$(GITDESCRIBE)))-$(word 3,$(subst -, ,$(GITDESCRIBE)))
+    ifneq ($(shell $(GIT) log @{u}..),)
+REVSTR:=$(REVSTR)-unpushed
+    endif
+    ifneq ($(word 4,$(subst -, ,$(GITDESCRIBE))),)
+REVSTR:=$(REVSTR)-$(word 4,$(subst -, ,$(GITDESCRIBE)))
+    endif
+   endif
+export REVSTR
+  else
+   ifneq ($(SVNVERSION),)
 REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
 REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
 export REVSTR
 export REVSTR
-else
+   endif
+  endif
+ endif
+endif
+
+# Avoid infinite loop
 ifeq ($(REVINC),force)
 ifeq ($(REVINC),force)
+ifeq ($(REVSTR),)
 REVSTR:=exported
 REVSTR:=exported
 export REVSTR
 export REVSTR
 endif
 endif
 endif
 endif
-endif
-endif
 
 
 # set correct defines (-d$(CPU_TARGET) is automatically added in makefile.fpc)
 # set correct defines (-d$(CPU_TARGET) is automatically added in makefile.fpc)
 override LOCALOPT+=-d$(CPC_TARGET) -dGDB
 override LOCALOPT+=-d$(CPC_TARGET) -dGDB
@@ -806,6 +829,10 @@ else
 	$(MAKE) revision.inc REVINC=force
 	$(MAKE) revision.inc REVINC=force
 endif
 endif
 
 
+ifeq ($(COMPILEREXENAME),)
+COMPILEREXENAME:=$(EXENAME)
+endif
+
 .PHONY : revision
 .PHONY : revision
 
 
 revision :
 revision :
@@ -830,9 +857,8 @@ else
 endif
 endif
         $(COMPILER) version.pas
         $(COMPILER) version.pas
 endif
 endif
-        $(COMPILER) pp.pas
+        $(COMPILER) -o$(BASEDIR)/$(COMPILEREXENAME) pp.pas
         $(EXECPPAS)
         $(EXECPPAS)
-        $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME)
 
 
 #####################################################################
 #####################################################################
 # Cycle targets
 # Cycle targets
@@ -877,13 +903,11 @@ wpocycle:
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtlclean
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtlclean
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtl
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtl
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' $(addsuffix _clean,$(ALLTARGETS))
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' $(addsuffix _clean,$(ALLTARGETS))
-	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' compiler
-        $(MOVE) $(EXENAME) $(TEMPWPONAME1)
-        $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtlclean
+	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' 'COMPILEREXENAME=$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' compiler 
+	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtlclean
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtl
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtl
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' $(addsuffix _clean,$(ALLTARGETS))
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' $(addsuffix _clean,$(ALLTARGETS))
-        $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' compiler
-        $(COPY) $(EXENAME) $(TEMPWPONAME2)
+        $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' 'COMPILEREXENAME=$(EXENAME)' compiler
 else
 else
 wpocycle:
 wpocycle:
 endif
 endif
@@ -921,19 +945,15 @@ next :
 endif
 endif
 
 
 $(TEMPNAME1) :
 $(TEMPNAME1) :
-        $(MAKE) 'OLDFPC=' next CYCLELEVEL=1
-        -$(DEL) $(TEMPNAME1)
-        $(MOVE) $(EXENAME) $(TEMPNAME1)
+	$(MAKE) 'OLDFPC=' next CYCLELEVEL=1 'COMPILEREXENAME=$(TEMPNAME1PREFIX)$(TEMPNAME1)'
 
 
 $(TEMPNAME2) : $(TEMPNAME1)
 $(TEMPNAME2) : $(TEMPNAME1)
-        $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME1PREFIX)$(TEMPNAME1)' 'OLDFPC=' next CYCLELEVEL=2
-        -$(DEL) $(TEMPNAME2)
-        $(MOVE) $(EXENAME) $(TEMPNAME2)
+        $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME1PREFIX)$(TEMPNAME1)' 'OLDFPC=' next CYCLELEVEL=2 'COMPILEREXENAME=$(TEMPNAME2REFIX)$(TEMPNAME2)'
 
 
 $(TEMPNAME3) : $(TEMPNAME2)
 $(TEMPNAME3) : $(TEMPNAME2)
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME2PREFIX)$(TEMPNAME2)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME1)' next CYCLELEVEL=3
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME2PREFIX)$(TEMPNAME2)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME1)' next CYCLELEVEL=3
-        -$(DEL) $(TEMPNAME3)
-        $(MOVE) $(EXENAME) $(TEMPNAME3)
+		-$(DEL) $(TEMPNAME3)
+		$(MOVE) $(EXENAME) $(TEMPNAME3)
 
 
 cycle:
 cycle:
 ifdef NEED_G_COMPILERS
 ifdef NEED_G_COMPILERS

+ 6 - 1
compiler/aarch64/a64att.inc

@@ -424,5 +424,10 @@
 'cas',
 'cas',
 'casa',
 'casa',
 'casal',
 'casal',
-'casl'
+'casl',
+'sdot',
+'sha512h',
+'sha512h2',
+'sha512su0',
+'sha512su1'
 );
 );

+ 5 - 0
compiler/aarch64/a64atts.inc

@@ -424,5 +424,10 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE
 attsufNONE
 );
 );

+ 9 - 0
compiler/aarch64/a64ins.dat

@@ -855,3 +855,12 @@
 
 
 [CASL]
 [CASL]
 
 
+[SDOT]
+
+[SHA512H]
+
+[SHA512H2]
+
+[SHA512SU0]
+
+[SHA512SU1]

+ 6 - 1
compiler/aarch64/a64op.inc

@@ -424,5 +424,10 @@ A_LDADDL,
 A_CAS,
 A_CAS,
 A_CASA,
 A_CASA,
 A_CASAL,
 A_CASAL,
-A_CASL
+A_CASL,
+A_SDOT,
+A_SHA512H,
+A_SHA512H2,
+A_SHA512SU0,
+A_SHA512SU1
 );
 );

+ 15 - 1
compiler/aarch64/aasmcpu.pas

@@ -187,6 +187,7 @@ uses
          constructor op_reg_reg_shifterop(op : tasmop;_op1,_op2 : tregister;_op3 : tshifterop);
          constructor op_reg_reg_shifterop(op : tasmop;_op1,_op2 : tregister;_op3 : tshifterop);
          constructor op_reg_reg_reg_shifterop(op : tasmop;_op1,_op2,_op3 : tregister; const _op4 : tshifterop);
          constructor op_reg_reg_reg_shifterop(op : tasmop;_op1,_op2,_op3 : tregister; const _op4 : tshifterop);
          constructor op_reg_reg_reg_cond(op : tasmop;_op1,_op2,_op3 : tregister; const _op4: tasmcond);
          constructor op_reg_reg_reg_cond(op : tasmop;_op1,_op2,_op3 : tregister; const _op4: tasmcond);
+         constructor op_reg_const_ref(op: tasmop; _op1: tregister; _op2: aint; _op3: treference);
 
 
          constructor op_const_ref(op:tasmop; _op1: aint; _op2: treference);
          constructor op_const_ref(op:tasmop; _op1: aint; _op2: treference);
 
 
@@ -607,6 +608,16 @@ implementation
       end;
       end;
 
 
 
 
+    constructor taicpu.op_reg_const_ref(op : tasmop;_op1 : tregister;_op2 : aint;_op3 : treference);
+      begin
+         inherited create(op);
+         ops:=3;
+         loadreg(0,_op1);
+         loadconst(1,_op2);
+         loadref(2,_op3);
+      end;
+
+
     function taicpu.is_same_reg_move(regtype: Tregistertype):boolean;
     function taicpu.is_same_reg_move(regtype: Tregistertype):boolean;
       begin
       begin
         { allow the register allocator to remove unnecessary moves }
         { allow the register allocator to remove unnecessary moves }
@@ -660,7 +671,7 @@ implementation
           exit;
           exit;
         { "ldr literal" must be a 32/64 bit LDR and have a symbol }
         { "ldr literal" must be a 32/64 bit LDR and have a symbol }
         if (ref.refaddr=addr_pic) and
         if (ref.refaddr=addr_pic) and
-           (not (op in [A_LDR,A_B,A_BL]) or
+           (not (op in [A_LDR,A_B,A_BL,A_ADR]) or
             not(oppostfix in [PF_NONE,PF_W,PF_SW]) or
             not(oppostfix in [PF_NONE,PF_W,PF_SW]) or
             (not assigned(ref.symbol) and
             (not assigned(ref.symbol) and
              not assigned(ref.symboldata))) then
              not assigned(ref.symboldata))) then
@@ -1094,6 +1105,7 @@ implementation
            A_FNMADD,
            A_FNMADD,
            A_FNMSUB,
            A_FNMSUB,
            A_FRINTX,
            A_FRINTX,
+           A_FRINTZ,
            A_FSQRT,
            A_FSQRT,
            A_FSUB,
            A_FSUB,
            A_ORR,
            A_ORR,
@@ -1118,6 +1130,7 @@ implementation
            A_FCVTZS,
            A_FCVTZS,
            A_SDIV,
            A_SDIV,
            A_SMULL,
            A_SMULL,
+           A_SMULH,
            A_STLXP,
            A_STLXP,
            A_STLXR,
            A_STLXR,
            A_STXP,
            A_STXP,
@@ -1131,6 +1144,7 @@ implementation
            A_UCVTF,
            A_UCVTF,
            A_UDIV,
            A_UDIV,
            A_UMULL,
            A_UMULL,
+           A_UMULH,
            A_UXTB,
            A_UXTB,
            A_UXTH:
            A_UXTH:
              if opnr=0 then
              if opnr=0 then

+ 37 - 3
compiler/aarch64/agcpugas.pas

@@ -68,7 +68,7 @@ unit agcpugas;
     const
     const
       cputype_to_gas_march : array[tcputype] of string = (
       cputype_to_gas_march : array[tcputype] of string = (
         '', // cpu_none
         '', // cpu_none
-        '', // armv8 is not accepted by GNU assembler
+        'armv8-a', // armv8 is not accepted by GNU assembler
         'armv8-a',
         'armv8-a',
         'armv8.1-a',
         'armv8.1-a',
         'armv8.2-a',
         'armv8.2-a',
@@ -99,6 +99,40 @@ unit agcpugas;
        cgbase,cgutils;
        cgbase,cgutils;
 
 
 
 
+    function GetmarchStr : String;
+      var
+        cf: tcpuflags;
+      begin
+        Result:='-march='+cputype_to_gas_march[current_settings.cputype];
+        for cf in cpu_capabilities[current_settings.cputype] do
+          begin
+            case cf of
+              CPUAARCH64_HAS_DOTPROD:
+                Result:=Result+'+dotprod';
+              CPUAARCH64_HAS_AES:
+                Result:=Result+'+aes';
+              CPUAARCH64_HAS_SHA2:
+                Result:=Result+'+sha2';
+              CPUAARCH64_HAS_SHA3:
+                Result:=Result+'+sha3';
+              CPUAARCH64_HAS_SM4:
+                Result:=Result+'+sm4';
+              CPUAARCH64_HAS_CRYPTO:
+                Result:=Result+'+crypto';
+              CPUAARCH64_HAS_MEMTAG:
+                Result:=Result+'+memtag';
+              CPUAARCH64_HAS_PAUTH:
+                Result:=Result+'+pauth';
+              CPUAARCH64_HAS_TME:
+                Result:=Result+'+tme';
+              CPUAARCH64_HAS_PROFILE:
+                Result:=Result+'+profile';
+              else
+                ;
+            end
+          end;
+      end;
+
 {****************************************************************************}
 {****************************************************************************}
 {                      AArch64 Assembler writer                              }
 {                      AArch64 Assembler writer                              }
 {****************************************************************************}
 {****************************************************************************}
@@ -113,7 +147,7 @@ unit agcpugas;
       begin
       begin
         result:=inherited MakeCmdLine;
         result:=inherited MakeCmdLine;
         if cputype_to_gas_march[current_settings.cputype] <> '' then
         if cputype_to_gas_march[current_settings.cputype] <> '' then
-	  Replace(result,'$MARCHOPT','-march='+cputype_to_gas_march[current_settings.cputype])
+          Replace(result,'$MARCHOPT',GetmarchStr)
         else
         else
           Replace(result,'$MARCHOPT','');
           Replace(result,'$MARCHOPT','');
       end;
       end;
@@ -133,7 +167,7 @@ unit agcpugas;
       begin
       begin
         result:=inherited MakeCmdLine;
         result:=inherited MakeCmdLine;
         if cputype_to_gas_march[current_settings.cputype] <> '' then
         if cputype_to_gas_march[current_settings.cputype] <> '' then
-	  Replace(result,'$MARCHOPT','-march='+cputype_to_gas_march[current_settings.cputype])
+          Replace(result,'$MARCHOPT',GetmarchStr)
         else
         else
           Replace(result,'$MARCHOPT','');
           Replace(result,'$MARCHOPT','');
       end;
       end;

+ 119 - 20
compiler/aarch64/aoptcpu.pas

@@ -25,7 +25,9 @@ Unit aoptcpu;
 
 
 {$i fpcdefs.inc}
 {$i fpcdefs.inc}
 
 
-{ $define DEBUG_AOPTCPU}
+{$ifdef EXTDEBUG}
+{$define DEBUG_AOPTCPU}
+{$endif EXTDEBUG}
 
 
 Interface
 Interface
 
 
@@ -52,6 +54,7 @@ Interface
         function RemoveSuperfluousFMov(const p: tai; movp: tai; const optimizer: string): boolean;
         function RemoveSuperfluousFMov(const p: tai; movp: tai; const optimizer: string): boolean;
         function OptPass1Shift(var p: tai): boolean;
         function OptPass1Shift(var p: tai): boolean;
         function OptPostCMP(var p: tai): boolean;
         function OptPostCMP(var p: tai): boolean;
+        function OptPostAnd(var p: tai): Boolean;
         function OptPass1Data(var p: tai): boolean;
         function OptPass1Data(var p: tai): boolean;
         function OptPass1FData(var p: tai): Boolean;
         function OptPass1FData(var p: tai): Boolean;
         function OptPass1STP(var p: tai): boolean;
         function OptPass1STP(var p: tai): boolean;
@@ -95,28 +98,18 @@ Implementation
 
 
       p := taicpu(hp);
       p := taicpu(hp);
       case p.opcode of
       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:
+        { These operations do not write into a register at all
+
+          LDR/STR with post/pre-indexed operations do not need special treatment
+          because post-/preindexed does not mean that a register
+          is loaded with a new value, it is only modified }
+        A_STR, A_CMP, A_CMN, A_TST, A_B, A_BL, A_MSR, A_FCMP:
           exit;
           exit;
-        {Take care of post/preincremented store and loads, they will change their base register}
-        A_STR, A_LDR:
-          begin
-            Result := false;
-            { actually, this does not apply here because post-/preindexed does not mean that a register
-              is loaded with a new value, it is only modified
-              (taicpu(p).oper[1]^.typ=top_ref) and
-              (taicpu(p).oper[1]^.ref^.addressmode in [AM_PREINDEXED,AM_POSTINDEXED]) and
-              (taicpu(p).oper[1]^.ref^.base = reg);
-            }
-            { STR does not load into it's first register }
-            if p.opcode = A_STR then
-              exit;
-          end;
         else
         else
           ;
           ;
       end;
       end;
 
 
-      if Result then
+      if p.ops=0 then
         exit;
         exit;
 
 
       case p.oper[0]^.typ of
       case p.oper[0]^.typ of
@@ -296,11 +289,17 @@ Implementation
 
 
 
 
   function TCpuAsmOptimizer.OptPass1LDR(var p: tai): Boolean;
   function TCpuAsmOptimizer.OptPass1LDR(var p: tai): Boolean;
+    var
+      hp1: tai;
     begin
     begin
       Result := False;
       Result := False;
       if inherited OptPass1LDR(p) or
       if inherited OptPass1LDR(p) or
         LookForPostindexedPattern(p) then
         LookForPostindexedPattern(p) then
-        Exit(True);
+        Exit(True)
+      else if (taicpu(p).oppostfix in [PF_B,PF_SB,PF_H,PF_SH,PF_None]) and
+        GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
+        RemoveSuperfluousMove(p, hp1, 'Ldr<Postfix>Mov2Ldr<Postfix>') then
+        Exit(true);
     end;
     end;
 
 
 
 
@@ -549,6 +548,7 @@ Implementation
   function TCpuAsmOptimizer.OptPass1FMov(var p: tai): Boolean;
   function TCpuAsmOptimizer.OptPass1FMov(var p: tai): Boolean;
     var
     var
       hp1: tai;
       hp1: tai;
+      alloc, dealloc: tai_regalloc;
     begin
     begin
       {
       {
         change
         change
@@ -565,9 +565,48 @@ Implementation
         begin
         begin
           asml.Remove(hp1);
           asml.Remove(hp1);
           hp1.free;
           hp1.free;
-          DebugMsg(SPeepholeOptimization + 'FMovFMov2FMov done', p);
+          DebugMsg(SPeepholeOptimization + 'FMovFMov2FMov 1 done', p);
           Result:=true;
           Result:=true;
         end;
         end;
+
+      { change
+          fmov reg0,const
+          fmov reg1,reg0
+          dealloc reg0
+          into
+          fmov reg1,const
+      }
+      if MatchOpType(taicpu(p),top_reg,top_realconst) and
+        GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
+        (not RegModifiedBetween(taicpu(p).oper[1]^.reg, p, hp1)) and
+        MatchInstruction(hp1,A_FMOV,[taicpu(p).condition],[taicpu(p).oppostfix]) and
+        MatchOpType(taicpu(hp1),top_reg,top_reg) and
+        MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[1]^.reg) and
+        (not RegModifiedByInstruction(taicpu(p).oper[0]^.reg, hp1)) and
+        assigned(FindRegDeAlloc(taicpu(p).oper[0]^.reg,tai(hp1.Next)))
+        then
+        begin
+          DebugMsg('Peephole FMovFMov2FMov 2 done', p);
+
+          taicpu(hp1).loadrealconst(1,taicpu(p).oper[1]^.val_real);
+
+          alloc:=FindRegAllocBackward(taicpu(p).oper[0]^.reg,tai(p.Previous));
+          dealloc:=FindRegDeAlloc(taicpu(p).oper[0]^.reg,tai(hp1.Next));
+
+          if assigned(alloc) and assigned(dealloc) then
+            begin
+              asml.Remove(alloc);
+              alloc.Free;
+              asml.Remove(dealloc);
+              dealloc.Free;
+            end;
+
+          { p will be removed, update used register as we continue
+            with the next instruction after p }
+
+          result:=RemoveCurrentP(p);
+        end;
+
       { not enabled as apparently not happening
       { not enabled as apparently not happening
       if MatchOpType(taicpu(p),top_reg,top_reg) and
       if MatchOpType(taicpu(p),top_reg,top_reg) and
         GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
         GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
@@ -747,11 +786,69 @@ Implementation
     end;
     end;
 
 
 
 
+  function TCpuAsmOptimizer.OptPostAnd(var p: tai): Boolean;
+    var
+      hp1, hp2: tai;
+      hp3: taicpu;
+      bitval : cardinal;
+    begin
+      Result:=false;
+      {
+        and reg1,reg0,<const=power of 2>
+        cmp reg1,#0
+        <reg1 end of life>
+        b.e/b.ne label
+
+        into
+
+        tb(n)z reg0,<power of 2>,label
+      }
+      if MatchOpType(taicpu(p),top_reg,top_reg,top_const) and
+        (PopCnt(QWord(taicpu(p).oper[2]^.val))=1) and
+        GetNextInstruction(p,hp1) and
+        MatchInstruction(hp1,A_CMP,[PF_None]) and
+        MatchOpType(taicpu(hp1),top_reg,top_const) and
+        (taicpu(hp1).oper[1]^.val=0) and
+        MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[0]^) and
+        RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) and
+        GetNextInstruction(hp1,hp2) and
+        MatchInstruction(hp2,A_B,[PF_None]) and
+        (taicpu(hp2).condition in [C_EQ,C_NE]) then
+        begin
+           bitval:=BsfQWord(qword(taicpu(p).oper[2]^.val));
+           case taicpu(hp2).condition of
+            C_NE:
+              hp3:=taicpu.op_reg_const_ref(A_TBNZ,taicpu(p).oper[1]^.reg,bitval,taicpu(hp2).oper[0]^.ref^);
+            C_EQ:
+              hp3:=taicpu.op_reg_const_ref(A_TBZ,taicpu(p).oper[1]^.reg,bitval,taicpu(hp2).oper[0]^.ref^);
+            else
+              Internalerror(2021100201);
+          end;
+          taicpu(hp3).fileinfo:=taicpu(hp1).fileinfo;
+          asml.insertbefore(hp3, hp1);
+
+          RemoveInstruction(hp1);
+          RemoveInstruction(hp2);
+          RemoveCurrentP(p);
+          DebugMsg(SPeepholeOptimization + 'AndCmpB.E/NE2Tbnz/Tbz done', p);
+          Result:=true;
+        end;
+    end;
+
+
   function TCpuAsmOptimizer.OptPostCMP(var p : tai): boolean;
   function TCpuAsmOptimizer.OptPostCMP(var p : tai): boolean;
     var
     var
      hp1,hp2: tai;
      hp1,hp2: tai;
     begin
     begin
       Result:=false;
       Result:=false;
+      {
+         cmp reg0,#0
+         b.e/b.ne label
+
+         into
+
+         cb(n)z reg0,label
+      }
       if MatchOpType(taicpu(p),top_reg,top_const) and
       if MatchOpType(taicpu(p),top_reg,top_const) and
         (taicpu(p).oper[1]^.val=0) and
         (taicpu(p).oper[1]^.val=0) and
         GetNextInstruction(p,hp1) and
         GetNextInstruction(p,hp1) and
@@ -867,6 +964,8 @@ Implementation
           case taicpu(p).opcode of
           case taicpu(p).opcode of
             A_CMP:
             A_CMP:
               Result:=OptPostCMP(p);
               Result:=OptPostCMP(p);
+            A_AND:
+              Result:=OptPostAnd(p);
             else
             else
               ;
               ;
           end;
           end;

+ 51 - 30
compiler/aarch64/cgcpu.pas

@@ -1872,6 +1872,13 @@ implementation
         ref: treference;
         ref: treference;
         totalstackframesize: longint;
         totalstackframesize: longint;
       begin
       begin
+        { on aarch64, we need to store the link register and the generate a frame pointer if the subroutine either
+          - receives parameters on the stack
+          - is not a leaf procedure
+          - has nested procedures
+          - helpers retrieve the stack pointer
+        }
+
         hitem:=list.last;
         hitem:=list.last;
         { pi_has_unwind_info may already be set at this point if there are
         { pi_has_unwind_info may already be set at this point if there are
           SEH directives in assembler body. In this case, .seh_endprologue
           SEH directives in assembler body. In this case, .seh_endprologue
@@ -1885,28 +1892,30 @@ implementation
 
 
             if target_info.system=system_aarch64_win64 then
             if target_info.system=system_aarch64_win64 then
               include(current_procinfo.flags,pi_has_unwind_info);
               include(current_procinfo.flags,pi_has_unwind_info);
-
-            { save stack pointer and return address }
-            reference_reset_base(ref,NR_SP,-16,ctempposinvalid,16,[]);
-            ref.addressmode:=AM_PREINDEXED;
-            list.concat(taicpu.op_reg_reg_ref(A_STP,NR_FP,NR_LR,ref));
-            current_asmdata.asmcfi.cfa_def_cfa_offset(list,2*sizeof(pint));
-            current_asmdata.asmcfi.cfa_offset(list,NR_FP,-16);
-            current_asmdata.asmcfi.cfa_offset(list,NR_LR,-8);
-            if target_info.system=system_aarch64_win64 then
-              list.concat(cai_seh_directive.create_offset(ash_savefplr_x,16));
-            { initialise frame pointer }
-            if current_procinfo.procdef.proctypeoption<>potype_exceptfilter then
+            if not(pi_no_framepointer_needed in current_procinfo.flags) then
               begin
               begin
-                a_load_reg_reg(list,OS_ADDR,OS_ADDR,NR_SP,NR_FP);
-                current_asmdata.asmcfi.cfa_def_cfa_register(list,NR_FP);
+                { save stack pointer and return address }
+                reference_reset_base(ref,NR_SP,-16,ctempposinvalid,16,[]);
+                ref.addressmode:=AM_PREINDEXED;
+                list.concat(taicpu.op_reg_reg_ref(A_STP,NR_FP,NR_LR,ref));
+                current_asmdata.asmcfi.cfa_def_cfa_offset(list,2*sizeof(pint));
+                current_asmdata.asmcfi.cfa_offset(list,NR_FP,-16);
+                current_asmdata.asmcfi.cfa_offset(list,NR_LR,-8);
                 if target_info.system=system_aarch64_win64 then
                 if target_info.system=system_aarch64_win64 then
-                  list.concat(cai_seh_directive.create(ash_setfp));
-              end
-            else
-              begin
-                gen_load_frame_for_exceptfilter(list);
-                localsize:=current_procinfo.maxpushedparasize;
+                  list.concat(cai_seh_directive.create_offset(ash_savefplr_x,16));
+                { initialise frame pointer }
+                if current_procinfo.procdef.proctypeoption<>potype_exceptfilter then
+                  begin
+                    a_load_reg_reg(list,OS_ADDR,OS_ADDR,NR_SP,NR_FP);
+                    current_asmdata.asmcfi.cfa_def_cfa_register(list,NR_FP);
+                    if target_info.system=system_aarch64_win64 then
+                      list.concat(cai_seh_directive.create(ash_setfp));
+                  end
+                else
+                  begin
+                    gen_load_frame_for_exceptfilter(list);
+                    localsize:=current_procinfo.maxpushedparasize;
+                  end;
               end;
               end;
 
 
             totalstackframesize:=localsize;
             totalstackframesize:=localsize;
@@ -2081,7 +2090,6 @@ implementation
       end;
       end;
 
 
 
 
-
     procedure tcgaarch64.g_proc_exit(list : TAsmList;parasize:longint;nostackframe:boolean);
     procedure tcgaarch64.g_proc_exit(list : TAsmList;parasize:longint;nostackframe:boolean);
       var
       var
         ref: treference;
         ref: treference;
@@ -2122,13 +2130,22 @@ implementation
                 load_regs(list,R_INTREGISTER,RS_X19,RS_X28,R_SUBWHOLE);
                 load_regs(list,R_INTREGISTER,RS_X19,RS_X28,R_SUBWHOLE);
               end
               end
             else if current_procinfo.final_localsize<>0 then
             else if current_procinfo.final_localsize<>0 then
-              { restore stack pointer }
-              a_load_reg_reg(list,OS_ADDR,OS_ADDR,NR_FP,NR_SP);
+              begin
+                { restore stack pointer }
+                if pi_no_framepointer_needed in current_procinfo.flags then
+                  handle_reg_imm12_reg(list,A_ADD,OS_ADDR,current_procinfo.framepointer,current_procinfo.final_localsize,
+                    current_procinfo.framepointer,NR_IP0,false,true)
+                else
+                  a_load_reg_reg(list,OS_ADDR,OS_ADDR,NR_FP,NR_SP);
+              end;
 
 
-            { restore framepointer and return address }
-            reference_reset_base(ref,NR_SP,16,ctempposinvalid,16,[]);
-            ref.addressmode:=AM_POSTINDEXED;
-            list.concat(taicpu.op_reg_reg_ref(A_LDP,NR_FP,NR_LR,ref));
+            if not(pi_no_framepointer_needed in current_procinfo.flags) then
+              begin
+                { restore framepointer and return address }
+                reference_reset_base(ref,NR_SP,16,ctempposinvalid,16,[]);
+                ref.addressmode:=AM_POSTINDEXED;
+                list.concat(taicpu.op_reg_reg_ref(A_LDP,NR_FP,NR_LR,ref));
+              end;
           end;
           end;
 
 
         { return }
         { return }
@@ -2500,7 +2517,8 @@ implementation
         if cs_opt_size in current_settings.optimizerswitches then
         if cs_opt_size in current_settings.optimizerswitches then
           maxlenunrolled:=maxlenunrolled div 2;
           maxlenunrolled:=maxlenunrolled div 2;
         if (len>maxlenunrolled) and
         if (len>maxlenunrolled) and
-           (len>totalalign*8) then
+           (len>totalalign*8) and
+           (pi_do_call in current_procinfo.flags) then
           begin
           begin
             g_concatcopy_move(list,source,dest,len);
             g_concatcopy_move(list,source,dest,len);
             exit;
             exit;
@@ -2585,7 +2603,7 @@ implementation
             current_asmdata.getjumplabel(hl);
             current_asmdata.getjumplabel(hl);
             countreg:=getintregister(list,OS_32);
             countreg:=getintregister(list,OS_32);
             if loadop=A_LDP then
             if loadop=A_LDP then
-              a_load_const_reg(list,OS_32,len div tcgsize2size[opsize]*2,countreg)
+              a_load_const_reg(list,OS_32,len div (tcgsize2size[opsize]*2),countreg)
             else
             else
               a_load_const_reg(list,OS_32,len div tcgsize2size[opsize],countreg);
               a_load_const_reg(list,OS_32,len div tcgsize2size[opsize],countreg);
             a_label(list,hl);
             a_label(list,hl);
@@ -2604,7 +2622,10 @@ implementation
                 genloadstore(list,storeop,regs[1],tmpdest,postfix,opsize);
                 genloadstore(list,storeop,regs[1],tmpdest,postfix,opsize);
               end;
               end;
             list.concat(taicpu.op_reg_sym_ofs(A_CBNZ,countreg,hl,0));
             list.concat(taicpu.op_reg_sym_ofs(A_CBNZ,countreg,hl,0));
-            len:=len mod tcgsize2size[opsize];
+            if loadop=A_LDP then
+              len:=len mod (tcgsize2size[opsize]*2)
+            else
+              len:=len mod tcgsize2size[opsize];
           end;
           end;
         gencopyleftovers(list,tmpsource,tmpdest,len);
         gencopyleftovers(list,tmpsource,tmpdest,len);
       end;
       end;

+ 6 - 2
compiler/aarch64/cpubase.pas

@@ -148,13 +148,17 @@ unit cpubase;
       TOpPostfixes = set of TOpPostfix;
       TOpPostfixes = set of TOpPostfix;
 
 
     const
     const
-      tcgsizep2size: array[OS_NO..OS_F128] of byte =
+      tcgsizep2size: array[tcgsize] of byte =
         {OS_NO }
         {OS_NO }
         (0,
         (0,
         {OS_8,OS_16,OS_32,OS_64,OS_128,OS_S8,OS_S16,OS_S32,OS_S64,OS_S128}
         {OS_8,OS_16,OS_32,OS_64,OS_128,OS_S8,OS_S16,OS_S32,OS_S64,OS_S128}
             0,    1,    2,    3,     4,    0,     1,     2,     3,      4,
             0,    1,    2,    3,     4,    0,     1,     2,     3,      4,
         {OS_F32,OS_F64,OS_F80,OS_C64,OS_F128,}
         {OS_F32,OS_F64,OS_F80,OS_C64,OS_F128,}
-             2,      3,     0,     3,      4);
+             2,      3,     0,     3,      4,
+
+         {OS_M8,   OS_M16,  OS_M32,  OS_M64,  OS_M128, OS_M256, OS_M512}
+              0,        1,       2,       3,        4,       5,       6);
+
       oppostfix2str: array[TOpPostfix] of string[2] = ('',
       oppostfix2str: array[TOpPostfix] of string[2] = ('',
         's',
         's',
         'b','sb','h','sh','w','sw');
         'b','sb','h','sh','w','sw');

+ 12 - 4
compiler/aarch64/cpuinfo.pas

@@ -23,9 +23,7 @@ Interface
 
 
 Type
 Type
    bestreal = double;
    bestreal = double;
-{$if FPC_FULLVERSION>20700}
    bestrealrec = TDoubleRec;
    bestrealrec = TDoubleRec;
-{$endif FPC_FULLVERSION>20700}
    ts32real = single;
    ts32real = single;
    ts64real = double;
    ts64real = double;
    ts80real = type extended;
    ts80real = type extended;
@@ -131,13 +129,23 @@ Const
 
 
    level1optimizerswitches = genericlevel1optimizerswitches;
    level1optimizerswitches = genericlevel1optimizerswitches;
    level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
    level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
-     [{$ifndef llvm}cs_opt_regvar,{$endif}cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse];
+     [{$ifndef llvm}cs_opt_regvar,{$endif}cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse,cs_opt_consts];
    level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [{,cs_opt_loopunroll}];
    level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [{,cs_opt_loopunroll}];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];
 
 
 type
 type
    tcpuflags =
    tcpuflags =
-     (CPUAARCH64_HAS_LSE       { CPU supports Large System Extensions }
+     (CPUAARCH64_HAS_LSE,     { CPU supports Large System Extensions }
+      CPUAARCH64_HAS_DOTPROD, { CPU supports dotprod extension }
+      CPUAARCH64_HAS_CRYPTO,  { CPU supports the crypto extension }
+      CPUAARCH64_HAS_AES,     { CPU supports the AES extension }
+      CPUAARCH64_HAS_SHA2,    { CPU supports the SHA2 extension }
+      CPUAARCH64_HAS_SHA3,    { CPU supports the SHA3 extension }
+      CPUAARCH64_HAS_SM4,     { CPU supports the SM3 and SM4 extension }
+      CPUAARCH64_HAS_PROFILE, { CPU supports the profile extension }
+      CPUAARCH64_HAS_MEMTAG,  { CPU supports the memtag extension }
+      CPUAARCH64_HAS_TME,     { CPU supports the tme extension }
+      CPUAARCH64_HAS_PAUTH    { CPU supports the pauth extension }
      );
      );
 
 
    tfpuflags =
    tfpuflags =

+ 2 - 2
compiler/aarch64/cpupara.pas

@@ -92,7 +92,7 @@ unit cpupara;
 
 
     function tcpuparamanager.get_saved_registers_int(calloption: tproccalloption): tcpuregisterarray;
     function tcpuparamanager.get_saved_registers_int(calloption: tproccalloption): tcpuregisterarray;
       const
       const
-        saved_regs : {$ifndef VER3_0}tcpuregisterarray{$else}array[0..9] of tsuperregister{$endif} =
+        saved_regs : tcpuregisterarray =
           (RS_X19,RS_X20,RS_X21,RS_X22,RS_X23,RS_X24,RS_X25,RS_X26,RS_X27,RS_X28);
           (RS_X19,RS_X20,RS_X21,RS_X22,RS_X23,RS_X24,RS_X25,RS_X26,RS_X27,RS_X28);
       begin
       begin
         result:=saved_regs;
         result:=saved_regs;
@@ -101,7 +101,7 @@ unit cpupara;
 
 
     function tcpuparamanager.get_saved_registers_mm(calloption: tproccalloption): tcpuregisterarray;
     function tcpuparamanager.get_saved_registers_mm(calloption: tproccalloption): tcpuregisterarray;
       const
       const
-        saved_mm_regs : {$ifndef VER3_0}tcpuregisterarray{$else}array[0..7] of tsuperregister{$endif} =
+        saved_mm_regs : tcpuregisterarray =
           (RS_D8,RS_D9,RS_D10,RS_D11,RS_D12,RS_D13,RS_D14,RS_D15);
           (RS_D8,RS_D9,RS_D10,RS_D11,RS_D12,RS_D13,RS_D14,RS_D15);
       begin
       begin
         result:=saved_mm_regs;
         result:=saved_mm_regs;

+ 98 - 0
compiler/aarch64/ncpuinl.pas

@@ -38,6 +38,7 @@ interface
         function first_int_real: tnode; override;
         function first_int_real: tnode; override;
         function first_frac_real: tnode; override;
         function first_frac_real: tnode; override;
         function first_fma : tnode; override;
         function first_fma : tnode; override;
+        function first_minmax : tnode; override;
         procedure second_abs_real; override;
         procedure second_abs_real; override;
         procedure second_sqr_real; override;
         procedure second_sqr_real; override;
         procedure second_sqrt_real; override;
         procedure second_sqrt_real; override;
@@ -49,6 +50,7 @@ interface
         procedure second_get_frame; override;
         procedure second_get_frame; override;
         procedure second_fma; override;
         procedure second_fma; override;
         procedure second_prefetch; override;
         procedure second_prefetch; override;
+        procedure second_minmax; override;
       private
       private
         procedure load_fpu_location;
         procedure load_fpu_location;
       end;
       end;
@@ -58,6 +60,7 @@ implementation
 
 
     uses
     uses
       globtype,verbose,globals,
       globtype,verbose,globals,
+      compinnr,
       cpuinfo, defutil,symdef,aasmdata,aasmcpu,
       cpuinfo, defutil,symdef,aasmdata,aasmcpu,
       cgbase,cgutils,pass_1,pass_2,
       cgbase,cgutils,pass_1,pass_2,
       ncal,nutils,
       ncal,nutils,
@@ -347,6 +350,101 @@ implementation
       end;
       end;
 
 
 
 
+    function taarch64inlinenode.first_minmax : tnode;
+      begin
+        if is_single(resultdef) or is_double(resultdef) then
+          begin
+            expectloc:=LOC_MMREGISTER;
+            Result:=nil;
+          end
+        else if is_32bitint(resultdef) then
+          begin
+            expectloc:=LOC_REGISTER;
+            Result:=nil;
+          end
+        else
+          Result:=inherited first_minmax;
+      end;
+
+
+    procedure taarch64inlinenode.second_minmax;
+      var
+        paraarray : array[1..2] of tnode;
+        i: Integer;
+        ai: taicpu;
+        op: TAsmOp;
+      begin
+        paraarray[1]:=tcallparanode(tcallparanode(parameters).nextpara).paravalue;
+          paraarray[2]:=tcallparanode(parameters).paravalue;
+
+        for i:=low(paraarray) to high(paraarray) do
+           secondpass(paraarray[i]);
+
+        if is_single(resultdef) or is_double(resultdef) then
+           begin
+             { no memory operand is allowed }
+             for i:=low(paraarray) to high(paraarray) do
+               begin
+                 if not(paraarray[i].location.loc in [LOC_MMREGISTER,LOC_CMMREGISTER]) then
+                   hlcg.location_force_mmregscalar(current_asmdata.CurrAsmList,paraarray[i].location,
+                     paraarray[i].resultdef,true);
+               end;
+
+             location_reset(location,LOC_MMREGISTER,paraarray[1].location.size);
+             location.register:=cg.getmmregister(current_asmdata.CurrAsmList,location.size);
+
+             current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FCMP,
+               paraarray[1].location.register,paraarray[2].location.register));
+
+             case inlinenumber of
+               in_min_single,
+               in_min_double:
+                current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg_cond(A_FCSEL,
+                  location.register,paraarray[1].location.register,paraarray[2].location.register,C_MI));
+               in_max_single,
+               in_max_double:
+                current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg_cond(A_FCSEL,
+                  location.register,paraarray[1].location.register,paraarray[2].location.register,C_GT));
+               else
+                 Internalerror(2021121802);
+             end;
+
+             cg.maybe_check_for_fpu_exception(current_asmdata.CurrAsmList);
+           end
+         else if is_32bitint(resultdef) then
+           begin
+             { no memory operand is allowed }
+             for i:=low(paraarray) to high(paraarray) do
+               begin
+                 if not(paraarray[i].location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
+                   hlcg.location_force_reg(current_asmdata.CurrAsmList,paraarray[i].location,
+                     paraarray[i].resultdef,paraarray[i].resultdef,true);
+               end;
+
+             location_reset(location,LOC_REGISTER,paraarray[1].location.size);
+             location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
+
+             current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,
+               paraarray[1].location.register,paraarray[2].location.register));
+
+             case inlinenumber of
+               in_min_dword,
+               in_min_longint:
+                current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg_cond(A_CSEL,
+                  location.register,paraarray[1].location.register,paraarray[2].location.register,C_LT));
+               in_max_dword,
+               in_max_longint:
+                current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg_cond(A_CSEL,
+                  location.register,paraarray[1].location.register,paraarray[2].location.register,C_GT));
+               else
+                 Internalerror(2021121901);
+             end;
+           end
+         else
+           internalerror(2021121801);
+      end;
+
+
 begin
 begin
   cinlinenode:=taarch64inlinenode;
   cinlinenode:=taarch64inlinenode;
 end.
 end.

+ 25 - 7
compiler/aarch64/racpugas.pas

@@ -840,14 +840,32 @@ Unit racpugas;
               oper.opr.typ:=OPR_REGSET;
               oper.opr.typ:=OPR_REGSET;
               oper.opr.basereg:=parsereg;
               oper.opr.basereg:=parsereg;
               oper.opr.nregs:=1;
               oper.opr.nregs:=1;
-              while (oper.opr.nregs<4) and
-                    (actasmtoken=AS_COMMA) do
+
+              while (actasmtoken<>AS_RSBRACKET) and (oper.opr.nregs<4) do
                 begin
                 begin
-                  consume(AS_COMMA);
-                  tempreg:=parsereg;
-                  if getsupreg(tempreg)<>((getsupreg(oper.opr.basereg)+oper.opr.nregs) mod 32) then
-                    Message(asmr_e_a64_invalid_regset);
-                  inc(oper.opr.nregs);
+                  if actasmtoken=AS_MINUS then
+                    begin
+                      consume(AS_MINUS);
+                      tempreg:=parsereg;
+
+                      if (getsupreg(tempreg)-getsupreg(oper.opr.basereg))>=4 then
+                        Message(asmr_e_a64_regset_too_large);
+                      oper.opr.nregs:=getsupreg(tempreg)-getsupreg(oper.opr.basereg)+1;
+                      if actasmtoken<>AS_COMMA then
+                        break;
+                    end;
+                  if actasmtoken=AS_COMMA then
+                    begin
+                      consume(AS_COMMA);
+                      tempreg:=parsereg;
+                      if (getsupreg(tempreg)-getsupreg(oper.opr.basereg))>=4 then
+                        Message(asmr_e_a64_regset_too_large);
+                      if getsupreg(tempreg)<>((getsupreg(oper.opr.basereg)+oper.opr.nregs) mod 32) then
+                        Message(asmr_e_a64_invalid_regset);
+                      inc(oper.opr.nregs);
+                    end
+                  else
+                    break;
                 end;
                 end;
               consume(AS_RSBRACKET);
               consume(AS_RSBRACKET);
               if actasmtoken=AS_LBRACKET then
               if actasmtoken=AS_LBRACKET then

+ 18 - 4
compiler/aasmbase.pas

@@ -47,7 +47,8 @@ interface
          AB_TEMP,
          AB_TEMP,
          { a global symbol that points to another global symbol and is only used
          { a global symbol that points to another global symbol and is only used
            to allow indirect loading in case of packages and indirect imports }
            to allow indirect loading in case of packages and indirect imports }
-         AB_INDIRECT,AB_EXTERNAL_INDIRECT);
+         AB_INDIRECT,AB_EXTERNAL_INDIRECT,
+         AB_WEAK);
 
 
        TAsmsymtype=(
        TAsmsymtype=(
          AT_NONE,AT_FUNCTION,AT_DATA,AT_SECTION,AT_LABEL,
          AT_NONE,AT_FUNCTION,AT_DATA,AT_SECTION,AT_LABEL,
@@ -70,7 +71,12 @@ interface
          { Thread-local symbol (ELF targets) }
          { Thread-local symbol (ELF targets) }
          AT_TLS,
          AT_TLS,
          { GNU indirect function (ELF targets) }
          { GNU indirect function (ELF targets) }
-         AT_GNU_IFUNC
+         AT_GNU_IFUNC,
+         { WebAssembly global variable }
+         AT_WASM_GLOBAL,
+         { WebAssembly exception tag (used as a parameter for the 'throw' and
+           'catch' instructions) }
+         AT_WASM_EXCEPTION_TAG
          );
          );
 
 
        { is the label only there for getting an DataOffset (e.g. for i/o
        { is the label only there for getting an DataOffset (e.g. for i/o
@@ -78,11 +84,13 @@ interface
          info alt_dbgline and alt_dbgfile, etc. }
          info alt_dbgline and alt_dbgfile, etc. }
        TAsmLabelType = (alt_jump,alt_addr,alt_data,alt_dbgline,alt_dbgfile,alt_dbgtype,alt_dbgframe,alt_eh_begin,alt_eh_end);
        TAsmLabelType = (alt_jump,alt_addr,alt_data,alt_dbgline,alt_dbgfile,alt_dbgtype,alt_dbgframe,alt_eh_begin,alt_eh_end);
 
 
+       TSymbolPairKind = (spk_set, spk_set_global, spk_thumb_set, spk_localentry);
+
     const
     const
        asmlabeltypeprefix : array[TAsmLabeltype] of string[2] = ('j','a','d','l','f','t','c','eb','ee');
        asmlabeltypeprefix : array[TAsmLabeltype] of string[2] = ('j','a','d','l','f','t','c','eb','ee');
        asmsymbindname : array[TAsmsymbind] of string[23] = ('none', 'external','common',
        asmsymbindname : array[TAsmsymbind] of string[23] = ('none', 'external','common',
        'local','global','weak external','private external','lazy','import','internal temp',
        'local','global','weak external','private external','lazy','import','internal temp',
-       'indirect','external indirect');
+       'indirect','external indirect','weak');
        asmsymbindindirect = [AB_INDIRECT,AB_EXTERNAL_INDIRECT];
        asmsymbindindirect = [AB_INDIRECT,AB_EXTERNAL_INDIRECT];
 
 
     type
     type
@@ -188,6 +196,9 @@ interface
            TAsmList with loadsym/loadref/const_symbol (PFV) }
            TAsmList with loadsym/loadref/const_symbol (PFV) }
          refs       : longint;
          refs       : longint;
        public
        public
+{$ifdef wasm}
+         nestingdepth : longint;
+{$endif wasm}
          { on avr the compiler needs to replace cond. jumps with too large offsets
          { on avr the compiler needs to replace cond. jumps with too large offsets
            so we have to store an offset somewhere to calculate jump distances }
            so we have to store an offset somewhere to calculate jump distances }
 {$ifdef AVR}
 {$ifdef AVR}
@@ -257,7 +268,7 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      verbose,fpccrc;
+      verbose,fpchash;
 
 
 
 
     function create_smartlink_sections:boolean;inline;
     function create_smartlink_sections:boolean;inline;
@@ -329,6 +340,9 @@ implementation
         typ:=_typ;
         typ:=_typ;
         { used to remove unused labels from the al_procedures }
         { used to remove unused labels from the al_procedures }
         refs:=0;
         refs:=0;
+{$ifdef wasm}
+        nestingdepth:=-1;
+{$endif wasm}
       end;
       end;
 
 
 
 

+ 16 - 14
compiler/aasmcnst.pas

@@ -1196,12 +1196,12 @@ implementation
          2 +
          2 +
          { elesize }
          { elesize }
          2 +
          2 +
-{$ifdef cpu64bitaddr}
-         { alignment }
-         4 +
-{$endif cpu64bitaddr}
          { reference count }
          { reference count }
+{$ifdef cpu64bitaddr}
+         s32inttype.size +
+{$else !cpu64bitaddr}
          sizesinttype.size +
          sizesinttype.size +
+{$endif !cpu64bitaddr}
          { length }
          { length }
          sizesinttype.size;
          sizesinttype.size;
        unicodestring_header_size:=ansistring_header_size;
        unicodestring_header_size:=ansistring_header_size;
@@ -1244,8 +1244,10 @@ implementation
 
 
    destructor ttai_typedconstbuilder.destroy;
    destructor ttai_typedconstbuilder.destroy;
      begin
      begin
-       { the queue should have been flushed if it was used }
-       if fqueue_offset<>low(fqueue_offset) then
+       { the queue should have been flushed if it was used
+         (but if there were errors, we may have aborted before that happened) }
+       if (fqueue_offset<>low(fqueue_offset)) and
+          (ErrorCount=0) then
          internalerror(2014062901);
          internalerror(2014062901);
        faggregateinformation.free;
        faggregateinformation.free;
        fasmlist.free;
        fasmlist.free;
@@ -1440,12 +1442,12 @@ implementation
        emit_tai(tai_const.create_16bit(elesize),u16inttype);
        emit_tai(tai_const.create_16bit(elesize),u16inttype);
        inc(result.ofs,2);
        inc(result.ofs,2);
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
-       { dummy for alignment }
-       emit_tai(tai_const.create_32bit(0),u32inttype);
-       inc(result.ofs,4);
-{$endif cpu64bitaddr}
+       emit_tai(tai_const.Create_32bit(-1),s32inttype);
+       inc(result.ofs,s32inttype.size);
+{$else !cpu64bitaddr}
        emit_tai(tai_const.create_sizeint(-1),sizesinttype);
        emit_tai(tai_const.create_sizeint(-1),sizesinttype);
        inc(result.ofs,sizesinttype.size);
        inc(result.ofs,sizesinttype.size);
+{$endif !cpu64bitaddr}
        emit_tai(tai_const.create_sizeint(len),sizesinttype);
        emit_tai(tai_const.create_sizeint(len),sizesinttype);
        inc(result.ofs,sizesinttype.size);
        inc(result.ofs,sizesinttype.size);
        if string_symofs=0 then
        if string_symofs=0 then
@@ -1651,12 +1653,12 @@ implementation
              else
              else
                internalerror(2016082301);
                internalerror(2016082301);
            end;
            end;
-{$ifdef cpu64bitaddr}
-           { dummy for alignment }
-           result.add_field_by_def('',u32inttype);
-{$endif cpu64bitaddr}
            { reference count }
            { reference count }
+{$ifdef cpu64bitaddr}
+           result.add_field_by_def('',s32inttype);
+{$else !cpu64bitaddr}
            result.add_field_by_def('',sizesinttype);
            result.add_field_by_def('',sizesinttype);
+{$endif !cpu64bitaddr}
            { length in elements }
            { length in elements }
            result.add_field_by_def('',sizesinttype);
            result.add_field_by_def('',sizesinttype);
          end
          end

+ 50 - 5
compiler/aasmtai.pas

@@ -92,9 +92,13 @@ interface
           ait_llvmmetadatarefoperand, { llvm metadata referece: !metadataname !id }
           ait_llvmmetadatarefoperand, { llvm metadata referece: !metadataname !id }
 {$endif}
 {$endif}
 {$ifdef wasm}
 {$ifdef wasm}
-          ait_importexport,
+          ait_export_name,
           ait_local,
           ait_local,
+          ait_globaltype,
           ait_functype,
           ait_functype,
+          ait_tagtype,
+          ait_import_module,
+          ait_import_name,
 {$endif}
 {$endif}
           { SEH directives used in ARM,MIPS and x86_64 COFF targets }
           { SEH directives used in ARM,MIPS and x86_64 COFF targets }
           ait_seh_directive,
           ait_seh_directive,
@@ -239,9 +243,13 @@ interface
           'llvmmetadatarefop',
           'llvmmetadatarefop',
 {$endif}
 {$endif}
 {$ifdef wasm}
 {$ifdef wasm}
-          'importexport',
+          'export_name',
           'local',
           'local',
+          'globaltype',
           'functype',
           'functype',
+          'tagtype',
+          'import_module',
+          'import_name',
 {$endif}
 {$endif}
           'cfi',
           'cfi',
           'seh_directive',
           'seh_directive',
@@ -357,7 +365,13 @@ interface
                      ait_llvmmetadatarefoperand,
                      ait_llvmmetadatarefoperand,
 {$endif llvm}
 {$endif llvm}
 {$ifdef wasm}
 {$ifdef wasm}
-                     ait_importexport,ait_local,ait_functype,
+                     ait_export_name,
+                     ait_local,
+                     ait_globaltype,
+                     ait_functype,
+                     ait_tagtype,
+                     ait_import_module,
+                     ait_import_name,
 {$endif wasm}
 {$endif wasm}
                      ait_seh_directive,
                      ait_seh_directive,
                      ait_cfi,
                      ait_cfi,
@@ -426,8 +440,6 @@ interface
           ash_pushnv,ash_savenv
           ash_pushnv,ash_savenv
         );
         );
 
 
-      TSymbolPairKind = (spk_set, spk_set_global, spk_thumb_set, spk_localentry);
-
 
 
     const
     const
       regallocstr : array[tregalloctype] of string[10]=('allocated','released','sync','resized','used');
       regallocstr : array[tregalloctype] of string[10]=('allocated','released','sync','resized','used');
@@ -595,6 +607,7 @@ interface
           has_value : boolean;
           has_value : boolean;
           constructor Create(_sym:tasmsymbol;siz:longint);
           constructor Create(_sym:tasmsymbol;siz:longint);
           constructor Create_Global(_sym:tasmsymbol;siz:longint);
           constructor Create_Global(_sym:tasmsymbol;siz:longint);
+          constructor Create_Weak(_sym:tasmsymbol;siz:longint);
           constructor Createname(const _name : string;_symtyp:Tasmsymtype;siz:longint;def:tdef);
           constructor Createname(const _name : string;_symtyp:Tasmsymtype;siz:longint;def:tdef);
           constructor Createname_global(const _name : string;_symtyp:Tasmsymtype;siz:longint;def:tdef);
           constructor Createname_global(const _name : string;_symtyp:Tasmsymtype;siz:longint;def:tdef);
           constructor Createname_hidden(const _name : string;_symtyp:Tasmsymtype;siz:longint;def:tdef);
           constructor Createname_hidden(const _name : string;_symtyp:Tasmsymtype;siz:longint;def:tdef);
@@ -936,6 +949,7 @@ interface
            constructor Create(b:byte);virtual;
            constructor Create(b:byte);virtual;
            constructor Create_op(b: byte; _op: byte);virtual;
            constructor Create_op(b: byte; _op: byte);virtual;
            constructor create_max(b: byte; max: byte);virtual;
            constructor create_max(b: byte; max: byte);virtual;
+           constructor create_op_max(b: byte; _op: byte; max: byte);virtual;
            constructor Create_zeros(b:byte);
            constructor Create_zeros(b:byte);
            constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
            constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
            procedure ppuwrite(ppufile:tcompilerppufile);override;
            procedure ppuwrite(ppufile:tcompilerppufile);override;
@@ -1437,6 +1451,19 @@ implementation
       end;
       end;
 
 
 
 
+    constructor tai_symbol.Create_Weak(_sym:tasmsymbol;siz:longint);
+      begin
+        inherited Create;
+        typ:=ait_symbol;
+        sym:=_sym;
+        size:=siz;
+        if not(sym.bind in [AB_NONE,AB_WEAK_EXTERNAL]) then
+          internalerror(2021092801);
+        sym.bind:=AB_WEAK;
+        is_global:=false;
+      end;
+
+
     constructor tai_symbol.Createname(const _name : string;_symtyp:Tasmsymtype;siz:longint;def:tdef);
     constructor tai_symbol.Createname(const _name : string;_symtyp:Tasmsymtype;siz:longint;def:tdef);
       begin
       begin
          inherited Create;
          inherited Create;
@@ -2318,6 +2345,7 @@ implementation
 
 
     function tai_realconst.datasize: word;
     function tai_realconst.datasize: word;
       begin
       begin
+        result:=0;
         case realtyp of
         case realtyp of
           aitrealconst_s32bit:
           aitrealconst_s32bit:
             result:=4;
             result:=4;
@@ -3322,6 +3350,21 @@ implementation
        end;
        end;
 
 
 
 
+     constructor tai_align_abstract.create_op_max(b: byte; _op: byte; max: byte);
+       begin
+          inherited Create;
+          typ:=ait_align;
+          if b in [1,2,4,8,16,32] then
+            aligntype := b
+          else
+            aligntype := 1;
+          fillop:=_op;
+          use_op:=true;
+          maxbytes:=max;
+          fillsize:=0;
+       end;
+
+
      constructor tai_align_abstract.Create_zeros(b: byte);
      constructor tai_align_abstract.Create_zeros(b: byte);
        begin
        begin
           inherited Create;
           inherited Create;
@@ -3625,9 +3668,11 @@ implementation
 {$endif JVM}
 {$endif JVM}
 
 
 begin
 begin
+{$ifndef WASM}
 {$push}{$warnings off}
 {$push}{$warnings off}
   { taitype should fit into a 4 byte set for speed reasons }
   { taitype should fit into a 4 byte set for speed reasons }
   if ord(high(taitype))>31 then
   if ord(high(taitype))>31 then
     internalerror(201108181);
     internalerror(201108181);
 {$pop}
 {$pop}
+{$endif WASM}
 end.
 end.

+ 60 - 45
compiler/aggas.pas

@@ -74,8 +74,6 @@ interface
 {$endif WASM}
 {$endif WASM}
        private
        private
         setcount: longint;
         setcount: longint;
-        procedure WriteDecodedSleb128(a: int64);
-        procedure WriteDecodedUleb128(a: qword);
         procedure WriteCFI(hp: tai_cfi_base);
         procedure WriteCFI(hp: tai_cfi_base);
         function NextSetLabel: string;
         function NextSetLabel: string;
        protected
        protected
@@ -223,11 +221,11 @@ implementation
 { vtable for a class called Window:                                       }
 { vtable for a class called Window:                                       }
 { .section .data.rel.ro._ZTV6Window,"awG",@progbits,_ZTV6Window,comdat    }
 { .section .data.rel.ro._ZTV6Window,"awG",@progbits,_ZTV6Window,comdat    }
 { TODO: .data.ro not yet working}
 { TODO: .data.ro not yet working}
-{$if defined(arm) or defined(riscv64) or defined(powerpc)}
+{$if defined(arm) or defined(riscv64) or defined(powerpc) or defined(x86_64)}
           '.rodata',
           '.rodata',
-{$else defined(arm) or defined(riscv64) or defined(powerpc)}
+{$else defined(arm) or defined(riscv64) or defined(powerpc) or defined(x86_64)}
           '.data',
           '.data',
-{$endif defined(arm) or defined(riscv64) or defined(powerpc)}
+{$endif defined(arm) or defined(riscv64) or defined(powerpc) or defined(x86_64)}
           '.rodata',
           '.rodata',
           '.bss',
           '.bss',
           '.threadvar',
           '.threadvar',
@@ -660,21 +658,6 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TGNUAssembler.WriteDecodedUleb128(a: qword);
-      var
-        i,len : longint;
-        buf   : array[0..63] of byte;
-      begin
-        len:=EncodeUleb128(a,buf,0);
-        for i:=0 to len-1 do
-          begin
-            if (i > 0) then
-              writer.AsmWrite(',');
-            writer.AsmWrite(tostr(buf[i]));
-          end;
-      end;
-
-
     procedure TGNUAssembler.WriteCFI(hp: tai_cfi_base);
     procedure TGNUAssembler.WriteCFI(hp: tai_cfi_base);
       begin
       begin
         writer.AsmWrite(cfi2str[hp.cfityp]);
         writer.AsmWrite(cfi2str[hp.cfityp]);
@@ -708,21 +691,6 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TGNUAssembler.WriteDecodedSleb128(a: int64);
-      var
-        i,len : longint;
-        buf   : array[0..255] of byte;
-      begin
-        len:=EncodeSleb128(a,buf,0);
-        for i:=0 to len-1 do
-          begin
-            if (i > 0) then
-              writer.AsmWrite(',');
-            writer.AsmWrite(tostr(buf[i]));
-          end;
-      end;
-
-
 {$ifdef WASM}
 {$ifdef WASM}
     procedure TGNUAssembler.WriteFuncType(functype: TWasmFuncType);
     procedure TGNUAssembler.WriteFuncType(functype: TWasmFuncType);
       var
       var
@@ -852,14 +820,26 @@ implementation
         end;
         end;
 
 
 
 
-      procedure WriteImportExport(hp:tai_impexp);
+      procedure WriteTagType(hp: tai_tagtype);
         var
         var
-          symstypestr: string;
+          wasm_basic_typ: TWasmBasicType;
+          first: boolean;
         begin
         begin
-          Str(hp.symstype,symstypestr);
-          writer.AsmWriteLn(asminfo^.comment+'ait_importexport(extname='''+hp.extname+''', intname='''+hp.intname+''', extmodule='''+hp.extmodule+''', symstype='+symstypestr+')');
-          if hp.extmodule='' then
-            writer.AsmWriteLn(#9'.export_name '+hp.intname+', '+hp.extname);
+          writer.AsmWrite(#9'.tagtype'#9);
+          writer.AsmWrite(hp.tagname);
+          first:=true;
+          for wasm_basic_typ in hp.params do
+            begin
+              if first then
+                begin
+                  first:=false;
+                  writer.AsmWrite(' ');
+                end
+              else
+                writer.AsmWrite(',');
+              writer.AsmWrite(gas_wasm_basic_type_str[wasm_basic_typ]);
+            end;
+          writer.AsmLn;
         end;
         end;
 {$endif WASM}
 {$endif WASM}
 
 
@@ -1194,9 +1174,9 @@ implementation
                          writer.AsmWrite(ait_const2str[aitconst_8bit]);
                          writer.AsmWrite(ait_const2str[aitconst_8bit]);
                          case tai_const(hp).consttype of
                          case tai_const(hp).consttype of
                            aitconst_uleb128bit:
                            aitconst_uleb128bit:
-                             WriteDecodedUleb128(qword(tai_const(hp).value));
+                             writer.AsmWrite(uleb128tostr(qword(tai_const(hp).value)));
                            aitconst_sleb128bit:
                            aitconst_sleb128bit:
-                             WriteDecodedSleb128(int64(tai_const(hp).value));
+                             writer.AsmWrite(sleb128tostr(tai_const(hp).value));
                            else
                            else
                              ;
                              ;
                          end
                          end
@@ -1410,6 +1390,10 @@ implementation
                    { the dotted name is the name of the actual function entry }
                    { the dotted name is the name of the actual function entry }
                    writer.AsmWrite('.');
                    writer.AsmWrite('.');
                  end
                  end
+               else if tai_symbol(hp).sym.typ=AT_WASM_EXCEPTION_TAG then
+                 begin
+                   { nothing here, to ensure we don' write the .type directive for exception tags }
+                 end
                else
                else
                  begin
                  begin
                    if ((target_info.system <> system_arm_linux) and (target_info.system <> system_arm_android)) or
                    if ((target_info.system <> system_arm_linux) and (target_info.system <> system_arm_android)) or
@@ -1653,10 +1637,41 @@ implementation
                if tai_local(hp).last then
                if tai_local(hp).last then
                  writer.AsmLn;
                  writer.AsmLn;
              end;
              end;
+           ait_globaltype:
+             begin
+               writer.AsmWrite(#9'.globaltype'#9);
+               writer.AsmWrite(tai_globaltype(hp).globalname);
+               writer.AsmWrite(', ');
+               writer.AsmWrite(gas_wasm_basic_type_str[tai_globaltype(hp).gtype]);
+               if tai_globaltype(hp).immutable then
+                 writer.AsmWrite(', immutable');
+               writer.AsmLn;
+             end;
            ait_functype:
            ait_functype:
              WriteFuncTypeDirective(tai_functype(hp));
              WriteFuncTypeDirective(tai_functype(hp));
-           ait_importexport:
-             WriteImportExport(tai_impexp(hp));
+           ait_export_name:
+             begin
+               writer.AsmWrite(#9'.export_name'#9);
+               writer.AsmWrite(tai_export_name(hp).intname);
+               writer.AsmWrite(', ');
+               writer.AsmWriteLn(tai_export_name(hp).extname);
+             end;
+           ait_tagtype:
+             WriteTagType(tai_tagtype(hp));
+           ait_import_module:
+             begin
+               writer.AsmWrite(#9'.import_module'#9);
+               writer.AsmWrite(tai_import_module(hp).symname);
+               writer.AsmWrite(', ');
+               writer.AsmWriteLn(tai_import_module(hp).importmodule);
+             end;
+           ait_import_name:
+             begin
+               writer.AsmWrite(#9'.import_name'#9);
+               writer.AsmWrite(tai_import_name(hp).symname);
+               writer.AsmWrite(', ');
+               writer.AsmWriteLn(tai_import_name(hp).importname);
+             end;
 {$endif WASM}
 {$endif WASM}
 
 
            else
            else

+ 3 - 1
compiler/aoptobj.pas

@@ -1410,6 +1410,7 @@ Unit AoptObj;
             hp := tai_regalloc.alloc(reg,nil);
             hp := tai_regalloc.alloc(reg,nil);
             insertllItem(p1.previous,p1,hp);
             insertllItem(p1.previous,p1,hp);
             IncludeRegInUsedRegs(reg,initialusedregs);
             IncludeRegInUsedRegs(reg,initialusedregs);
+            lastRemovedWasDealloc := True; { If no tai_regallocs are found at all, treat as if the last one was a deallocation }
           end;
           end;
         while assigned(p1) and
         while assigned(p1) and
               (p1 <> p2) do
               (p1 <> p2) do
@@ -1429,7 +1430,8 @@ Unit AoptObj;
                   { same super register, different sub register? }
                   { same super register, different sub register? }
                   if SuperRegistersEqual(reg,tai_regalloc(p1).reg) and (tai_regalloc(p1).reg<>reg) then
                   if SuperRegistersEqual(reg,tai_regalloc(p1).reg) and (tai_regalloc(p1).reg<>reg) then
                     begin
                     begin
-                      if (getsubreg(tai_regalloc(p1).reg)>getsubreg(reg)) or (getsubreg(reg)=R_SUBH) then
+                      if (getsubreg(reg)<>R_SUBMMWHOLE) and { R_SUBMMWHOLE is below R_SUBMMX, R_SUBMMY and R_SUBMMZ }
+                        ((getsubreg(tai_regalloc(p1).reg)>getsubreg(reg)) or (getsubreg(reg)=R_SUBH)) then
                         internalerror(2016101501);
                         internalerror(2016101501);
                       tai_regalloc(p1).reg:=reg;
                       tai_regalloc(p1).reg:=reg;
                     end;
                     end;

+ 6 - 2
compiler/arm/aasmcpu.pas

@@ -166,11 +166,12 @@ uses
       IF_ARMv7M     = $00F00000;
       IF_ARMv7M     = $00F00000;
       IF_ARMv7EM    = $01000000;
       IF_ARMv7EM    = $01000000;
 
 
-      IF_FPMASK     = $00000F00;
+      IF_FPMASK     = $c0000F00;
       IF_FPA        = $00000100;
       IF_FPA        = $00000100;
       IF_VFPv2      = $00000200;
       IF_VFPv2      = $00000200;
       IF_VFPv3      = $00000400;
       IF_VFPv3      = $00000400;
       IF_VFPv4      = $00000800;
       IF_VFPv4      = $00000800;
+      IF_VFPv5      = $80000000;
 
 
       { if the instruction can change in a second pass }
       { if the instruction can change in a second pass }
       IF_PASS2  = $80000000;
       IF_PASS2  = $80000000;
@@ -2245,7 +2246,10 @@ implementation
             { fpu_fpv4_s16   } IF_NONE,
             { fpu_fpv4_s16   } IF_NONE,
             { fpu_vfpv4      } IF_VFPv2 or IF_VFPv3 or IF_VFPv4,
             { fpu_vfpv4      } IF_VFPv2 or IF_VFPv3 or IF_VFPv4,
             { fpu_vfpv4      } IF_VFPv2 or IF_VFPv3 or IF_VFPv4,
             { fpu_vfpv4      } IF_VFPv2 or IF_VFPv3 or IF_VFPv4,
-            { fpu_neon_vfpv4 } IF_VFPv2 or IF_VFPv3 or IF_VFPv4 or IF_NEON
+            { fpu_neon_vfpv4 } IF_VFPv2 or IF_VFPv3 or IF_VFPv4 or IF_NEON,
+            { fpu_fpv5_d16   } IF_VFPv2 or IF_VFPv3 or IF_VFPv4 or IF_VFPv5,
+            { fpu_fpv5_sp_d16} IF_VFPv2 or IF_VFPv3 or IF_VFPv4 or IF_VFPv5,
+            { fpu_fp_armv8   } IF_VFPv2 or IF_VFPv3 or IF_VFPv4 or IF_VFPv5
           );
           );
       begin
       begin
         fArmVMask:=Masks[current_settings.cputype] or FPUMasks[current_settings.fputype];
         fArmVMask:=Masks[current_settings.cputype] or FPUMasks[current_settings.fputype];

+ 4 - 0
compiler/arm/agarmgas.pas

@@ -129,6 +129,10 @@ unit agarmgas;
             result:='-mfpu=vfpv4 '+result;
             result:='-mfpu=vfpv4 '+result;
           fpu_neon_vfpv4:
           fpu_neon_vfpv4:
             result:='-mfpu=neon-vfpv4 '+result;
             result:='-mfpu=neon-vfpv4 '+result;
+          fpu_fpv5_sp_d16:
+            result:='-mfpu=fpv5-sp-d16 '+result;
+          fpu_fpv5_d16:
+            result:='-mfpu=fpv5-d16 '+result;
           else
           else
             ;
             ;
         end;
         end;

+ 16 - 6
compiler/arm/cpuinfo.pas

@@ -23,9 +23,7 @@ Interface
 
 
 Type
 Type
    bestreal = double;
    bestreal = double;
-{$if FPC_FULLVERSION>20700}
    bestrealrec = TDoubleRec;
    bestrealrec = TDoubleRec;
-{$endif FPC_FULLVERSION>20700}
    ts32real = single;
    ts32real = single;
    ts64real = double;
    ts64real = double;
    ts80real = type extended;
    ts80real = type extended;
@@ -76,7 +74,10 @@ Type
       fpu_fpv4_s16,     { same as fpu_fpv4_sp_d32, kept for backwards compatibility }
       fpu_fpv4_s16,     { same as fpu_fpv4_sp_d32, kept for backwards compatibility }
       fpu_vfpv4,
       fpu_vfpv4,
       fpu_fpv4_sp_d16,  { 32 registers single precision, for load/store/move they can be accessed as 16 double registers }
       fpu_fpv4_sp_d16,  { 32 registers single precision, for load/store/move they can be accessed as 16 double registers }
-      fpu_neon_vfpv4
+      fpu_neon_vfpv4,
+      fpu_fpv5_d16,
+      fpu_fpv5_sp_d16,
+      fpu_fp_armv8
       { when new elements added afterwards, update
       { when new elements added afterwards, update
         class procedure tarmnodeutils.InsertObjectInfo; in narmutil.pas }
         class procedure tarmnodeutils.InsertObjectInfo; in narmutil.pas }
      );
      );
@@ -95,7 +96,10 @@ Const
     'fpu=vfpv4-s16',
     'fpu=vfpv4-s16',
     'fpu=vfpv4',
     'fpu=vfpv4',
     'fpu=fpv4-sp-d16',
     'fpu=fpv4-sp-d16',
-    'fpu=neon-vfpv4'
+    'fpu=neon-vfpv4',
+    'fpu=fpv5-sp-d16',
+    'fpu=fpv5-d16',
+    'fpu=fp-armv8'
   );
   );
 
 
 Type
 Type
@@ -588,7 +592,10 @@ Const
      'FPV4_S16',
      'FPV4_S16',
      'VFPV4',
      'VFPV4',
      'FPV4_SP_D16',
      'FPV4_SP_D16',
-     'NEON_VFPV4'
+     'NEON_VFPV4',
+     'FPV5_D16',
+     'FPV5_SP_D16',
+     'FP_ARMV8'
    );
    );
 
 
 
 
@@ -1131,7 +1138,10 @@ Const
          { fpu_fpv4_s16     } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_32REGS,FPUARM_HAS_VFP_DOUBLE_MOVLDST,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_FMA],
          { fpu_fpv4_s16     } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_32REGS,FPUARM_HAS_VFP_DOUBLE_MOVLDST,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_FMA],
          { fpu_vfpv4        } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE,FPUARM_HAS_32REGS,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_FMA],
          { fpu_vfpv4        } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE,FPUARM_HAS_32REGS,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_FMA],
          { fpu_fpv4_sp_d16  } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_32REGS,FPUARM_HAS_VFP_DOUBLE_MOVLDST,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_FMA],
          { fpu_fpv4_sp_d16  } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_32REGS,FPUARM_HAS_VFP_DOUBLE_MOVLDST,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_FMA],
-         { fpu_neon_vfpv4   } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE,FPUARM_HAS_32REGS,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_NEON,FPUARM_HAS_FMA]
+         { fpu_neon_vfpv4   } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE,FPUARM_HAS_32REGS,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_NEON,FPUARM_HAS_FMA],
+         { fpu_fpv5_d16     } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_32REGS,FPUARM_HAS_VFP_DOUBLE_MOVLDST,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_FMA],
+         { fpu_fpv5_sp_d16  } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_32REGS,FPUARM_HAS_VFP_DOUBLE_MOVLDST,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_FMA],
+         { fpu_fp_armv8     } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE,FPUARM_HAS_32REGS,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_FMA]
        );
        );
 
 
    { contains all CPU supporting any kind of thumb instruction set }
    { contains all CPU supporting any kind of thumb instruction set }

+ 1 - 1
compiler/arm/cpupara.pas

@@ -87,7 +87,7 @@ unit cpupara;
 
 
     function tcpuparamanager.get_saved_registers_int(calloption : tproccalloption):tcpuregisterarray;
     function tcpuparamanager.get_saved_registers_int(calloption : tproccalloption):tcpuregisterarray;
       const
       const
-        saved_regs : {$ifndef VER3_0}tcpuregisterarray{$else}array[0..6] of tsuperregister{$endif} =
+        saved_regs : tcpuregisterarray =
           (RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,RS_R9,RS_R10);
           (RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,RS_R9,RS_R10);
       begin
       begin
         result:=saved_regs;
         result:=saved_regs;

+ 5 - 0
compiler/arm/narmutil.pas

@@ -218,6 +218,11 @@ interface
               fpu_vfpv4,
               fpu_vfpv4,
               fpu_neon_vfpv4:
               fpu_neon_vfpv4:
                 current_asmdata.asmlists[al_start].Concat(tai_eabi_attribute.create(Tag_FP_Arch,5));
                 current_asmdata.asmlists[al_start].Concat(tai_eabi_attribute.create(Tag_FP_Arch,5));
+              fpu_fpv5_sp_d16,
+              fpu_fpv5_d16:
+                current_asmdata.asmlists[al_start].Concat(tai_eabi_attribute.create(Tag_FP_Arch,8));
+              fpu_fp_armv8:
+                current_asmdata.asmlists[al_start].Concat(tai_eabi_attribute.create(Tag_FP_Arch,7));
               { else not needed anymore PM 2020/04/13
               { else not needed anymore PM 2020/04/13
                 Internalerror(2019100603); }
                 Internalerror(2019100603); }
             end;
             end;

+ 59 - 33
compiler/armgen/aoptarm.pas

@@ -26,7 +26,9 @@ Unit aoptarm;
 {$i fpcdefs.inc}
 {$i fpcdefs.inc}
 
 
 { $define DEBUG_PREREGSCHEDULER}
 { $define DEBUG_PREREGSCHEDULER}
+{$ifdef EXTDEBUG}
 {$define DEBUG_AOPTCPU}
 {$define DEBUG_AOPTCPU}
+{$endif EXTDEBUG}
 
 
 Interface
 Interface
 
 
@@ -344,6 +346,8 @@ Implementation
             ) and
             ) and
 {$ifdef AARCH64}
 {$ifdef AARCH64}
             (taicpu(p).oper[1]^.reg<>NR_SP) and
             (taicpu(p).oper[1]^.reg<>NR_SP) and
+            { in this case you have to transform it to movk or the like }
+            (getsupreg(taicpu(p).oper[1]^.reg)<>RS_XZR) and
 {$endif AARCH64}
 {$endif AARCH64}
             not(RegUsedBetween(taicpu(p).oper[1]^.reg,p,hp1)) then
             not(RegUsedBetween(taicpu(p).oper[1]^.reg,p,hp1)) then
             begin
             begin
@@ -1115,7 +1119,7 @@ Implementation
         hp1: tai;
         hp1: tai;
         Reference: TReference;
         Reference: TReference;
         SizeMismatch: Boolean;
         SizeMismatch: Boolean;
-        SrcReg: TRegister;
+        SrcReg, DstReg: TRegister;
         NewOp: TAsmOp;
         NewOp: TAsmOp;
       begin
       begin
         Result := False;
         Result := False;
@@ -1129,17 +1133,16 @@ Implementation
           GetNextInstruction(p, hp1) and
           GetNextInstruction(p, hp1) and
           (hp1.typ = ait_instruction) and
           (hp1.typ = ait_instruction) and
           (taicpu(hp1).condition = C_None) and
           (taicpu(hp1).condition = C_None) and
-          (taicpu(hp1).oppostfix = taicpu(p).oppostfix) then
-
-        if GetNextInstruction(p, hp1) and
-          (hp1.typ = ait_instruction) and
-          (taicpu(hp1).condition = C_None) then
+          (taicpu(hp1).oppostfix = taicpu(p).oppostfix) and
+          (taicpu(hp1).ops>0) and (taicpu(hp1).oper[0]^.typ=top_reg) then
           begin
           begin
             { Saves constant dereferencing and makes it easier to change the size if necessary }
             { Saves constant dereferencing and makes it easier to change the size if necessary }
             SrcReg := taicpu(p).oper[0]^.reg;
             SrcReg := taicpu(p).oper[0]^.reg;
+            DstReg := taicpu(hp1).oper[0]^.reg;
 
 
             if (taicpu(hp1).opcode = A_LDR) and
             if (taicpu(hp1).opcode = A_LDR) and
               RefsEqual(taicpu(hp1).oper[1]^.ref^, Reference) and
               RefsEqual(taicpu(hp1).oper[1]^.ref^, Reference) and
+              (taicpu(hp1).oper[1]^.ref^.volatility=[]) and
               (
               (
                 (taicpu(hp1).oppostfix = taicpu(p).oppostfix) or
                 (taicpu(hp1).oppostfix = taicpu(p).oppostfix) or
                 ((taicpu(p).oppostfix = PF_B) and (taicpu(hp1).oppostfix = PF_SB)) or
                 ((taicpu(p).oppostfix = PF_B) and (taicpu(hp1).oppostfix = PF_SB)) or
@@ -1157,7 +1160,7 @@ Implementation
                   If reg1 <> reg2, replace ldr with "mov reg2,reg1"
                   If reg1 <> reg2, replace ldr with "mov reg2,reg1"
                 }
                 }
 
 
-                if (SrcReg = taicpu(hp1).oper[0]^.reg) and
+                if (SrcReg = DstReg) and
                   { e.g. the ldrb in strb/ldrb is not a null operation as it clears the upper 24 bits }
                   { e.g. the ldrb in strb/ldrb is not a null operation as it clears the upper 24 bits }
                   (taicpu(p).oppostfix=PF_None) then
                   (taicpu(p).oppostfix=PF_None) then
                   begin
                   begin
@@ -1166,43 +1169,65 @@ Implementation
                     Result := True;
                     Result := True;
                     Exit;
                     Exit;
                   end
                   end
-                else if (getregtype(taicpu(p).oper[0]^.reg) = R_INTREGISTER) and
-                  (getregtype(taicpu(hp1).oper[0]^.reg) = R_INTREGISTER) and
-                  (getsubreg(taicpu(p).oper[0]^.reg) = getsubreg(taicpu(hp1).oper[0]^.reg)) then
+                else if (getregtype(SrcReg) = R_INTREGISTER) and
+                  (getregtype(DstReg) = R_INTREGISTER) and
+                  (getsubreg(SrcReg) = getsubreg(DstReg)) then
                   begin
                   begin
                     NewOp:=A_NONE;
                     NewOp:=A_NONE;
                     if taicpu(hp1).oppostfix=PF_None then
                     if taicpu(hp1).oppostfix=PF_None then
                       NewOp:=A_MOV
                       NewOp:=A_MOV
                     else 
                     else 
-{$ifndef AARCH64}
-                      if (current_settings.cputype >= cpu_armv6) then
-{$endif not AARCH64}
-                      case taicpu(hp1).oppostfix of
-                        PF_B:
-                          NewOp := A_UXTB;
-                        PF_SB:
-                          NewOp := A_SXTB;
-                        PF_H:
-                          NewOp := A_UXTH;
-                        PF_SH:
-                          NewOp := A_SXTH;
+{$ifdef ARM}
+                      if (current_settings.cputype < cpu_armv6) then
+                        begin
+                          { The zero- and sign-extension operations were only
+                            introduced under ARMv6 }
+                          case taicpu(hp1).oppostfix of
+                            PF_B:
+                              begin
+                                { The if-block afterwards will set the middle operand to the correct register }
+                                taicpu(hp1).allocate_oper(3);
+                                taicpu(hp1).ops := 3;
+                                taicpu(hp1).loadconst(2, $FF);
+                                NewOp := A_AND;
+                              end;
+                            PF_H:
+                              { ARMv5 and under doesn't have a concise way of storing the immediate $FFFF, so leave alone };
+                            PF_SB,
+                            PF_SH:
+                              { Do nothing - can't easily encode sign-extensions };
+                            else
+                              InternalError(2021043002);
+                          end;
+                        end
+                      else
+{$endif ARM}
+                        case taicpu(hp1).oppostfix of
+                          PF_B:
+                            NewOp := A_UXTB;
+                          PF_SB:
+                            NewOp := A_SXTB;
+                          PF_H:
+                            NewOp := A_UXTH;
+                          PF_SH:
+                            NewOp := A_SXTH;
 {$ifdef AARCH64}
 {$ifdef AARCH64}
-                        PF_SW:
-                          NewOp := A_SXTW;
-                        PF_W:
-                          NewOp := A_MOV;
+                          PF_SW:
+                            NewOp := A_SXTW;
+                          PF_W:
+                            NewOp := A_MOV;
 {$endif AARCH64}
 {$endif AARCH64}
-                      else
-                        InternalError(2021043001);
-                      end;
+                        else
+                          InternalError(2021043001);
+                        end;
                     if (NewOp<>A_None) then
                     if (NewOp<>A_None) then
                       begin
                       begin
                         DebugMsg(SPeepholeOptimization + 'Changed ldr' + oppostfix2str[taicpu(hp1).oppostfix] + ' to ' + gas_op2str[NewOp] + ' (store/load -> store/move)', hp1);
                         DebugMsg(SPeepholeOptimization + 'Changed ldr' + oppostfix2str[taicpu(hp1).oppostfix] + ' to ' + gas_op2str[NewOp] + ' (store/load -> store/move)', hp1);
 
 
                         taicpu(hp1).oppostfix := PF_None;
                         taicpu(hp1).oppostfix := PF_None;
                         taicpu(hp1).opcode := NewOp;
                         taicpu(hp1).opcode := NewOp;
-                        taicpu(hp1).loadreg(1, taicpu(p).oper[0]^.reg);
-                        AllocRegBetween(taicpu(p).oper[0]^.reg, p, hp1, UsedRegs);
+                        taicpu(hp1).loadreg(1, SrcReg);
+                        AllocRegBetween(SrcReg, p, hp1, UsedRegs);
                         Result := True;
                         Result := True;
                         Exit;
                         Exit;
                       end;
                       end;
@@ -1218,7 +1243,7 @@ Implementation
                   If reg1 <> reg2, delete the first str
                   If reg1 <> reg2, delete the first str
                   IF reg1 = reg2, delete the second str
                   IF reg1 = reg2, delete the second str
                 }
                 }
-                if SrcReg = taicpu(hp1).oper[0]^.reg then
+                if (SrcReg = DstReg) and (taicpu(hp1).oper[1]^.ref^.volatility=[]) then
                   begin
                   begin
                     DebugMsg(SPeepholeOptimization + 'Removed duplicate store instruction (store/store -> store/nop)', hp1);
                     DebugMsg(SPeepholeOptimization + 'Removed duplicate store instruction (store/store -> store/nop)', hp1);
                     RemoveInstruction(hp1);
                     RemoveInstruction(hp1);
@@ -1227,7 +1252,8 @@ Implementation
                   end
                   end
                 else if
                 else if
                   { Registers same byte size? }
                   { Registers same byte size? }
-                  (tcgsize2size[reg_cgsize(taicpu(p).oper[0]^.reg)] = tcgsize2size[reg_cgsize(taicpu(hp1).oper[0]^.reg)]) then
+                  (tcgsize2size[reg_cgsize(SrcReg)] = tcgsize2size[reg_cgsize(DstReg)]) and
+                  (taicpu(p).oper[1]^.ref^.volatility=[])  then
                   begin
                   begin
                     DebugMsg(SPeepholeOptimization + 'Removed dominated store instruction (store/store -> nop/store)', p);
                     DebugMsg(SPeepholeOptimization + 'Removed dominated store instruction (store/store -> nop/store)', p);
                     RemoveCurrentP(p, hp1);
                     RemoveCurrentP(p, hp1);

+ 62 - 5
compiler/assemble.pas

@@ -157,6 +157,8 @@ interface
         function single2str(d : single) : string; virtual;
         function single2str(d : single) : string; virtual;
         function double2str(d : double) : string; virtual;
         function double2str(d : double) : string; virtual;
         function extended2str(e : extended) : string; virtual;
         function extended2str(e : extended) : string; virtual;
+        function sleb128tostr(a : int64) : string;
+        function uleb128tostr(a : qword) : string;
         Function DoPipe:boolean; virtual;
         Function DoPipe:boolean; virtual;
 
 
         function CreateNewAsmWriter: TExternalAssemblerOutputFile; virtual;
         function CreateNewAsmWriter: TExternalAssemblerOutputFile; virtual;
@@ -268,6 +270,9 @@ Implementation
       sfpux80,
       sfpux80,
 {$endif FPC_SOFT_FPUX80}
 {$endif FPC_SOFT_FPUX80}
 {$endif}
 {$endif}
+{$ifdef WASM}
+      ogwasm,
+{$endif WASM}
       cscript,fmodule,verbose,
       cscript,fmodule,verbose,
       cpubase,cpuinfo,triplet,
       cpubase,cpuinfo,triplet,
       aasmcpu;
       aasmcpu;
@@ -275,7 +280,7 @@ Implementation
     var
     var
       CAssembler : array[tasm] of TAssemblerClass;
       CAssembler : array[tasm] of TAssemblerClass;
 
 
-    function fixline(s:string):string;
+    function fixline(const s:string):string;
      {
      {
        return s with all leading and ending spaces and tabs removed
        return s with all leading and ending spaces and tabs removed
      }
      }
@@ -288,10 +293,10 @@ Implementation
         j:=1;
         j:=1;
         while (j<i) and (s[j] in [#9,' ']) do
         while (j<i) and (s[j] in [#9,' ']) do
           inc(j);
           inc(j);
-        for k:=j to i do
-          if s[k] in [#0..#31,#127..#255] then
-            s[k]:='.';
-        fixline:=Copy(s,j,i-j+1);
+        result := Copy(s, j, i - j + 1);
+        for k:=1 to length(result) do
+          if result[k] in [#0..#31,#127..#255] then
+            result[k]:='.';
       end;
       end;
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -744,6 +749,36 @@ Implementation
          extended2str:='0d'+hs
          extended2str:='0d'+hs
       end;
       end;
 
 
+    function TExternalAssembler.sleb128tostr(a: int64): string;
+      var
+        i,len : longint;
+        buf   : array[0..31] of byte;
+      begin
+        result:='';
+        len:=EncodeSleb128(a,buf,0);
+        for i:=0 to len-1 do
+          begin
+            if (i > 0) then
+              result:=result+',';
+            result:=result+tostr(buf[i]);
+          end;
+      end;
+
+    function TExternalAssembler.uleb128tostr(a: qword): string;
+    var
+      i,len : longint;
+      buf   : array[0..31] of byte;
+    begin
+      result:='';
+      len:=EncodeUleb128(a,buf,0);
+      for i:=0 to len-1 do
+        begin
+          if (i > 0) then
+            result:=result+',';
+          result:=result+tostr(buf[i]);
+        end;
+    end;
+
 
 
     Function TExternalAssembler.DoPipe:boolean;
     Function TExternalAssembler.DoPipe:boolean;
       begin
       begin
@@ -1755,6 +1790,9 @@ Implementation
                       internalerror(2009090804); ;}
                       internalerror(2009090804); ;}
                  ObjData.SymbolDefine(Tai_symbol(hp).sym);
                  ObjData.SymbolDefine(Tai_symbol(hp).sym);
                end;
                end;
+             ait_symbolpair :
+               with tai_symbolpair(hp) do
+                 ObjData.SymbolPairDefine(kind,sym^,value^);
              ait_label :
              ait_label :
                ObjData.SymbolDefine(Tai_label(hp).labsym);
                ObjData.SymbolDefine(Tai_label(hp).labsym);
              ait_string :
              ait_string :
@@ -1799,6 +1837,22 @@ Implementation
                      Internalerror(2019100701);
                      Internalerror(2019100701);
                  end;
                  end;
                end;
                end;
+{$ifdef WASM}
+             ait_globaltype:
+               TWasmObjData(ObjData).DeclareGlobalType(tai_globaltype(hp));
+             ait_functype:
+               TWasmObjData(ObjData).DeclareFuncType(tai_functype(hp));
+             ait_tagtype:
+               TWasmObjData(ObjData).DeclareTagType(tai_tagtype(hp));
+             ait_export_name:
+               TWasmObjData(ObjData).DeclareExportName(tai_export_name(hp));
+             ait_import_module:
+               TWasmObjData(ObjData).DeclareImportModule(tai_import_module(hp));
+             ait_import_name:
+               TWasmObjData(ObjData).DeclareImportName(tai_import_name(hp));
+             ait_local:
+               TWasmObjData(ObjData).DeclareLocal(tai_local(hp));
+{$endif WASM}
              else
              else
                ;
                ;
            end;
            end;
@@ -1906,6 +1960,9 @@ Implementation
                  objsym:=ObjData.SymbolRef(Tai_symbol_end(hp).sym);
                  objsym:=ObjData.SymbolRef(Tai_symbol_end(hp).sym);
                  objsym.size:=ObjData.CurrObjSec.Size-objsym.offset;
                  objsym.size:=ObjData.CurrObjSec.Size-objsym.offset;
                end;
                end;
+             ait_symbolpair:
+               with tai_symbolpair(hp) do
+                 ObjData.SymbolPairDefine(kind,sym^,value^);
              ait_label :
              ait_label :
                ObjData.SymbolDefine(Tai_label(hp).labsym);
                ObjData.SymbolDefine(Tai_label(hp).labsym);
              ait_string :
              ait_string :

+ 0 - 2
compiler/avr/cpuinfo.pas

@@ -23,9 +23,7 @@ Interface
 
 
 Type
 Type
    bestreal = double;
    bestreal = double;
-{$if FPC_FULLVERSION>20700}
    bestrealrec = TDoubleRec;
    bestrealrec = TDoubleRec;
-{$endif FPC_FULLVERSION>20700}
    ts32real = single;
    ts32real = single;
    ts64real = double;
    ts64real = double;
    ts80real = type extended;
    ts80real = type extended;

+ 54 - 28
compiler/cclasses.pas

@@ -230,7 +230,7 @@ type
     function Extract(item: Pointer): Pointer;
     function Extract(item: Pointer): Pointer;
     function IndexOf(Item: Pointer): Integer;
     function IndexOf(Item: Pointer): Integer;
     function Find(const AName:TSymStr): Pointer;
     function Find(const AName:TSymStr): Pointer;
-    function FindIndexOf(const AName:TSymStr): Integer;
+    function FindIndexOf(const AName:TSymStr): Integer; {$ifdef CCLASSESINLINE}inline;{$endif}
     function FindWithHash(const AName:TSymStr;AHash:LongWord): Pointer;
     function FindWithHash(const AName:TSymStr;AHash:LongWord): Pointer;
     function Rename(const AOldName,ANewName:TSymStr): Integer;
     function Rename(const AOldName,ANewName:TSymStr): Integer;
     function Remove(Item: Pointer): Integer;
     function Remove(Item: Pointer): Integer;
@@ -284,7 +284,7 @@ type
     FFreeObjects : Boolean;
     FFreeObjects : Boolean;
     FHashList: TFPHashList;
     FHashList: TFPHashList;
     function GetCount: integer; {$ifdef CCLASSESINLINE}inline;{$endif}
     function GetCount: integer; {$ifdef CCLASSESINLINE}inline;{$endif}
-    procedure SetCount(const AValue: integer);
+    procedure SetCount(const AValue: integer); {$ifdef CCLASSESINLINE}inline;{$endif}
   protected
   protected
     function GetItem(Index: Integer): TObject; {$ifdef CCLASSESINLINE}inline;{$endif}
     function GetItem(Index: Integer): TObject; {$ifdef CCLASSESINLINE}inline;{$endif}
     procedure SetItem(Index: Integer; AObject: TObject);
     procedure SetItem(Index: Integer; AObject: TObject);
@@ -305,7 +305,7 @@ type
     function IndexOf(AObject: TObject): Integer; {$ifdef CCLASSESINLINE}inline;{$endif}
     function IndexOf(AObject: TObject): Integer; {$ifdef CCLASSESINLINE}inline;{$endif}
     function Find(const s:TSymStr): TObject; {$ifdef CCLASSESINLINE}inline;{$endif}
     function Find(const s:TSymStr): TObject; {$ifdef CCLASSESINLINE}inline;{$endif}
     function FindIndexOf(const s:TSymStr): Integer; {$ifdef CCLASSESINLINE}inline;{$endif}
     function FindIndexOf(const s:TSymStr): Integer; {$ifdef CCLASSESINLINE}inline;{$endif}
-    function FindWithHash(const AName:TSymStr;AHash:LongWord): Pointer;
+    function FindWithHash(const AName:TSymStr;AHash:LongWord): Pointer; {$ifdef CCLASSESINLINE}inline;{$endif}
     function Rename(const AOldName,ANewName:TSymStr): Integer; {$ifdef CCLASSESINLINE}inline;{$endif}
     function Rename(const AOldName,ANewName:TSymStr): Integer; {$ifdef CCLASSESINLINE}inline;{$endif}
     function FindInstanceOf(AClass: TClass; AExact: Boolean; AStartAt: Integer): Integer;
     function FindInstanceOf(AClass: TClass; AExact: Boolean; AStartAt: Integer): Integer;
     procedure Pack; {$ifdef CCLASSESINLINE}inline;{$endif}
     procedure Pack; {$ifdef CCLASSESINLINE}inline;{$endif}
@@ -465,7 +465,7 @@ type
          constructor Create(Ablocksize:longword);
          constructor Create(Ablocksize:longword);
          destructor  Destroy;override;
          destructor  Destroy;override;
          procedure reset;
          procedure reset;
-         function  size:longword;
+         function  size:longword; {$ifdef CCLASSESINLINE}inline;{$endif}
          procedure align(i:longword);
          procedure align(i:longword);
          procedure seek(i:longword);
          procedure seek(i:longword);
          function  read(var d;len:longword):longword;
          function  read(var d;len:longword):longword;
@@ -571,7 +571,7 @@ type
          constructor create(initsize: longint);
          constructor create(initsize: longint);
          constructor create_bytesize(bytesize: longint);
          constructor create_bytesize(bytesize: longint);
          destructor destroy; override;
          destructor destroy; override;
-         procedure clear;
+         procedure clear; {$ifdef CCLASSESINLINE}inline;{$endif}
          procedure grow(nsize: longint);
          procedure grow(nsize: longint);
          { sets a bit }
          { sets a bit }
          procedure include(index: longint);
          procedure include(index: longint);
@@ -1241,38 +1241,64 @@ end;
                             TFPHashList
                             TFPHashList
 *****************************************************************************}
 *****************************************************************************}
 
 
-
-    function FPHash(P: PChar; Len: Integer; Tag: LongWord): LongWord;
-    Var
-      pmax : pchar;
-    begin
+// MurmurHash3_32
+function FPHash(P: PChar; Len: Integer; Tag: LongWord): LongWord;
+const
+  C1 = uint32($cc9e2d51);
+  C2 = uint32($1b873593);
+var
+  h, tail: uint32;
+  e4: pChar;
+  len4, nTail: SizeUint;
+begin
 {$push}
 {$push}
 {$q-,r-}
 {$q-,r-}
-      result:=Tag;
-      pmax:=p+len;
-      while (p<pmax) do
-        begin
-          {DJBHash: result:=result*33 + next_char}
-          result:=LongWord(LongInt(result shl 5) + LongInt(result)) + LongWord(P^);
-          inc(p);
-        end;
-{$pop}
-    end;
+  h := tag;
 
 
-    function FPHash(P: PChar; Len: Integer): LongWord; inline;
+  len4 := len and not integer(sizeof(uint32) - 1); { len div sizeof(uint32) * sizeof(uint32) }
+  e4 := p + len4;
+  nTail := len - len4;
+  while p < e4 do
     begin
     begin
-      result:=fphash(P,Len, 5381);
+      { If independence on endianness is desired, unaligned(pUint32(p)^) can be replaced with LEtoN(unaligned(pUint32(p)^)). }
+      h := RolDWord(h xor (RolDWord(unaligned(pUint32(p)^) * C1, 15) * C2), 13) * 5 + $e6546b64;
+      p := p + sizeof(uint32);
     end;
     end;
 
 
-    function FPHash(const s: shortstring): LongWord; inline;
+  if nTail > 0 then
     begin
     begin
-      result:=fphash(pchar(@s[1]),length(s));
+      { tail is 1 to 3 bytes }
+      case nTail of
+        3: tail := unaligned(pUint16(p)^) or uint32(p[2]) shl 16; { unaligned(pUint16(p^)) can be LEtoNed for portability }
+        2: tail := unaligned(pUint16(p)^); { unaligned(pUint16(p^)) can be LEtoNed for portability }
+        {1:} else tail := uint32(p^);
+      end;
+      h := h xor (RolDWord(tail * C1, 15) * C2);
     end;
     end;
 
 
-    function FPHash(const a: ansistring): LongWord; inline;
-    begin
-      result:=fphash(pchar(a),length(a));
-    end;
+  h := h xor uint32(len);
+  h := (h xor (h shr 16)) * $85ebca6b;
+  h := (h xor (h shr 13)) * $c2b2ae35;
+  result := h xor (h shr 16);
+{$pop}
+end;
+
+function FPHash(P: PChar; Len: Integer): LongWord; inline;
+begin
+  result:=fphash(P,Len, 0);
+end;
+
+
+function FPHash(const s: shortstring): LongWord; inline;
+begin
+  result:=fphash(pchar(@s[1]),length(s));
+end;
+
+
+function FPHash(const a: ansistring): LongWord; inline;
+begin
+  result:=fphash(pchar(a),length(a));
+end;
 
 
 
 
 procedure TFPHashList.RaiseIndexError(Index : Integer);
 procedure TFPHashList.RaiseIndexError(Index : Integer);

+ 9 - 0
compiler/cg64f32.pas

@@ -970,6 +970,8 @@ unit cg64f32;
                end;
                end;
              current_asmdata.getjumplabel(poslabel);
              current_asmdata.getjumplabel(poslabel);
 
 
+             cg.a_reg_alloc(list, NR_DEFAULTFLAGS);
+
              { check high dword, must be 0 (for positive numbers) }
              { check high dword, must be 0 (for positive numbers) }
              cg.a_cmp_const_reg_label(list,OS_32,OC_EQ,0,hreg,poslabel);
              cg.a_cmp_const_reg_label(list,OS_32,OC_EQ,0,hreg,poslabel);
 
 
@@ -983,6 +985,9 @@ unit cg64f32;
                { we do not have dynamic dfa, so avoid a warning below about the unused
                { we do not have dynamic dfa, so avoid a warning below about the unused
                  neglabel }
                  neglabel }
                neglabel:=nil;
                neglabel:=nil;
+
+             cg.a_reg_dealloc(list, NR_DEFAULTFLAGS);
+
              { For all other values we have a range check error }
              { For all other values we have a range check error }
              cg.a_call_name(list,'fpc_rangeerror',false);
              cg.a_call_name(list,'fpc_rangeerror',false);
 
 
@@ -1022,7 +1027,9 @@ unit cg64f32;
                    end;
                    end;
                  { get a new neglabel (JM) }
                  { get a new neglabel (JM) }
                  current_asmdata.getjumplabel(neglabel);
                  current_asmdata.getjumplabel(neglabel);
+                 cg.a_reg_alloc(list, NR_DEFAULTFLAGS);
                  cg.a_cmp_const_reg_label(list,OS_32,OC_LT,0,hreg,neglabel);
                  cg.a_cmp_const_reg_label(list,OS_32,OC_LT,0,hreg,neglabel);
+                 cg.a_reg_dealloc(list, NR_DEFAULTFLAGS);
 
 
                  cg.a_call_name(list,'fpc_rangeerror',false);
                  cg.a_call_name(list,'fpc_rangeerror',false);
 
 
@@ -1073,7 +1080,9 @@ unit cg64f32;
                      cg.a_load_ref_reg(list,l.size,OS_32,l.reference,hreg);
                      cg.a_load_ref_reg(list,l.size,OS_32,l.reference,hreg);
                  end;
                  end;
                current_asmdata.getjumplabel(poslabel);
                current_asmdata.getjumplabel(poslabel);
+               cg.a_reg_alloc(list, NR_DEFAULTFLAGS);
                cg.a_cmp_const_reg_label(list,opsize,OC_GTE,0,hreg,poslabel);
                cg.a_cmp_const_reg_label(list,opsize,OC_GTE,0,hreg,poslabel);
+               cg.a_reg_dealloc(list, NR_DEFAULTFLAGS);
 
 
                cg.a_call_name(list,'fpc_rangeerror',false);
                cg.a_call_name(list,'fpc_rangeerror',false);
                cg.a_label(list,poslabel);
                cg.a_label(list,poslabel);

+ 1 - 1
compiler/cgobj.pas

@@ -757,7 +757,7 @@ implementation
         if getsupreg(r)<first_int_imreg then
         if getsupreg(r)<first_int_imreg then
           internalerror(2013051401);
           internalerror(2013051401);
         if not has_next_reg[getsupreg(r)] then
         if not has_next_reg[getsupreg(r)] then
-          internalerror(2017091103);
+          internalerror(2017091104);
 {$endif AVR}
 {$endif AVR}
         if getregtype(r)<>R_INTREGISTER then
         if getregtype(r)<>R_INTREGISTER then
           internalerror(2017091101);
           internalerror(2017091101);

+ 0 - 3
compiler/cgutils.pas

@@ -168,9 +168,6 @@ unit cgutils;
                 { overlay a 64 Bit register type }
                 { overlay a 64 Bit register type }
                 2 : (register64 : tregister64);
                 2 : (register64 : tregister64);
 {$endif cpu64bitalu and not cpuhighleveltarget}
 {$endif cpu64bitalu and not cpuhighleveltarget}
-{$ifdef cpu8bitalu}
-                3 : (registers : array[0..3] of tregister);
-{$endif cpu8bitalu}
               );
               );
             LOC_SUBSETREG,
             LOC_SUBSETREG,
             LOC_CSUBSETREG : (
             LOC_CSUBSETREG : (

+ 25 - 14
compiler/comphook.pas

@@ -61,12 +61,14 @@ Const
 
 
 const
 const
   { RHIDE expect gcc like error output }
   { RHIDE expect gcc like error output }
-  fatalstr      : string[20] = 'Fatal:';
-  errorstr      : string[20] = 'Error:';
-  warningstr    : string[20] = 'Warning:';
-  notestr       : string[20] = 'Note:';
-  hintstr       : string[20] = 'Hint:';
-
+  fatalstr      : string[6] = 'Fatal:';
+  errorstr      : string[6] = 'Error:';
+  warningstr    : string[8] = 'Warning:';
+  notestr       : string[5] = 'Note:';
+  hintstr       : string[5] = 'Hint:';
+  warningerrorstr    : string[29] = 'Warning: (treated as error)';
+  noteerrorstr       : string[27] = 'Note: (treated as error)';
+  hinterrorstr       : string[27] = 'Hint: (treated as error)';
 type
 type
   PCompilerStatus = ^TCompilerStatus;
   PCompilerStatus = ^TCompilerStatus;
   TCompilerStatus = record
   TCompilerStatus = record
@@ -314,11 +316,20 @@ begin
   if not(status.use_gccoutput) then
   if not(status.use_gccoutput) then
     begin
     begin
       if (status.verbosity and Level)=V_Hint then
       if (status.verbosity and Level)=V_Hint then
-        MsgTypeStr:=hintstr;
+        if status.errorhint then
+          MsgTypeStr:=hinterrorstr
+        else
+          MsgTypeStr:=hintstr;
       if (status.verbosity and Level)=V_Note then
       if (status.verbosity and Level)=V_Note then
-        MsgTypeStr:=notestr;
+        if status.errornote then
+          MsgTypeStr:=noteerrorstr
+        else
+          MsgTypeStr:=notestr;
       if (status.verbosity and Level)=V_Warning then
       if (status.verbosity and Level)=V_Warning then
-        MsgTypeStr:=warningstr;
+        if status.errorwarning then
+          MsgTypeStr:=warningerrorstr
+        else
+          MsgTypeStr:=warningstr;
       if (status.verbosity and Level)=V_Error then
       if (status.verbosity and Level)=V_Error then
         MsgTypeStr:=errorstr;
         MsgTypeStr:=errorstr;
       if (status.verbosity and Level)=V_Fatal then
       if (status.verbosity and Level)=V_Fatal then
@@ -354,11 +365,6 @@ begin
             MsgLocStr:=gccfilename(status.currentsource)+':'+tostr(status.currentline)+':'+tostr(status.currentcolumn)+':'
             MsgLocStr:=gccfilename(status.currentsource)+':'+tostr(status.currentline)+':'+tostr(status.currentcolumn)+':'
           else
           else
             MsgLocStr:=status.currentsource+'('+tostr(status.currentline)+','+tostr(status.currentcolumn)+')';
             MsgLocStr:=status.currentsource+'('+tostr(status.currentline)+','+tostr(status.currentcolumn)+')';
-          if status.print_source_path then
-            if status.sources_avail then
-              MsgLocStr:=status.currentsourcepath+MsgLocStr
-            else
-              MsgLocStr:=status.currentsourceppufilename+':'+MsgLocStr;
         end
         end
       else
       else
         begin
         begin
@@ -367,6 +373,11 @@ begin
           else
           else
             MsgLocStr:=status.currentsource+'('+tostr(status.currentline)+')';
             MsgLocStr:=status.currentsource+'('+tostr(status.currentline)+')';
         end;
         end;
+      if status.print_source_path then
+        if status.sources_avail then
+          MsgLocStr:=status.currentsourcepath+MsgLocStr
+        else
+          MsgLocStr:=status.currentsourceppufilename+':'+MsgLocStr;
  {$else macos}
  {$else macos}
       { MPW style error }
       { MPW style error }
       if status.currentcolumn>0 then
       if status.currentcolumn>0 then

+ 2 - 2
compiler/compiler.pas

@@ -36,7 +36,7 @@ uses
 {$ifdef WATCOM}
 {$ifdef WATCOM}
   emu387,
   emu387,
 {$endif WATCOM}
 {$endif WATCOM}
-{$if defined(unix) and (FPC_FULLVERSION>20700)}
+{$if defined(unix)}
   { system code page stuff for unix }
   { system code page stuff for unix }
   unixcp,
   unixcp,
   fpwidestring,
   fpwidestring,
@@ -197,7 +197,7 @@ procedure InitCompiler(const cmd:TCmdStr);
 begin
 begin
   if CompilerInited then
   if CompilerInited then
    DoneCompiler;
    DoneCompiler;
-{$if defined(unix) and (FPC_FULLVERSION>20700)}
+{$if defined(unix)}
   { Set default code page for ansistrings on unix-like systems }
   { Set default code page for ansistrings on unix-like systems }
   DefaultSystemCodePage:=GetSystemCodePage;
   DefaultSystemCodePage:=GetSystemCodePage;
 {$endif}
 {$endif}

+ 0 - 3
compiler/cresstr.pas

@@ -32,9 +32,6 @@ implementation
 
 
 uses
 uses
    SysUtils,
    SysUtils,
-{$if FPC_FULLVERSION<20700}
-   ccharset,
-{$endif}
    cclasses,widestr,
    cclasses,widestr,
    cutils,globtype,globals,systems,
    cutils,globtype,globals,systems,
    symbase,symconst,symtype,symdef,symsym,symtable,
    symbase,symconst,symtype,symdef,symsym,symtable,

+ 2 - 2
compiler/cstreams.pas

@@ -95,7 +95,7 @@ type
     procedure WriteByte(b : Byte); {$ifdef USEINLINE}inline;{$endif}
     procedure WriteByte(b : Byte); {$ifdef USEINLINE}inline;{$endif}
     procedure WriteWord(w : Word); {$ifdef USEINLINE}inline;{$endif}
     procedure WriteWord(w : Word); {$ifdef USEINLINE}inline;{$endif}
     procedure WriteDWord(d : Cardinal); {$ifdef USEINLINE}inline;{$endif}
     procedure WriteDWord(d : Cardinal); {$ifdef USEINLINE}inline;{$endif}
-    Procedure WriteAnsiString (S : AnsiString);
+    Procedure WriteAnsiString (const S : AnsiString);
     property Position: Longint read GetPosition write SetPosition;
     property Position: Longint read GetPosition write SetPosition;
     property Size: Longint read GetSize write SetSize;
     property Size: Longint read GetSize write SetSize;
   end;
   end;
@@ -345,7 +345,7 @@ implementation
      end;
      end;
    end;
    end;
 
 
-  Procedure TCStream.WriteAnsiString (S : AnsiString);
+  Procedure TCStream.WriteAnsiString (const S : AnsiString);
 
 
   Var L : Longint;
   Var L : Longint;
 
 

+ 60 - 53
compiler/cutils.pas

@@ -95,6 +95,8 @@ interface
     function trimspace(const s:string):string;
     function trimspace(const s:string):string;
     function trimspace(const s:AnsiString):AnsiString;
     function trimspace(const s:AnsiString):AnsiString;
     function space (b : longint): string;
     function space (b : longint): string;
+    { returns the position of the first char of the set cs in s, if there is none, then it returns 0 }
+    function PosCharset(const cs : TCharSet;const s : ansistring) : integer;
     function PadSpace(const s:string;len:longint):string;
     function PadSpace(const s:string;len:longint):string;
     function PadSpace(const s:AnsiString;len:longint):AnsiString;
     function PadSpace(const s:AnsiString;len:longint):AnsiString;
     function GetToken(var s:string;endchar:char):string;
     function GetToken(var s:string;endchar:char):string;
@@ -115,8 +117,9 @@ interface
     {# Returns true if abs(value) is a power of 2, the actual
     {# Returns true if abs(value) is a power of 2, the actual
        exponent value is returned in power.
        exponent value is returned in power.
     }
     }
-    function isabspowerof2(const value : Tconstexprint;out power : longint) : boolean;
-    function nextpowerof2(value : int64; out power: longint) : int64;
+    function isabspowerof2(const value : Tconstexprint; out power : longint) : boolean;
+    { # Returns the power of 2 >= value }
+    function nextpowerof2(value : qword; out power: longint) : qword;
 
 
     function backspace_quote(const s:string;const qchars:Tcharset):string;
     function backspace_quote(const s:string;const qchars:Tcharset):string;
     function octal_quote(const s:string;const qchars:Tcharset):string;
     function octal_quote(const s:string;const qchars:Tcharset):string;
@@ -290,13 +293,15 @@ implementation
 
 
 
 
     function newalignment(oldalignment: longint; offset: int64): longint;
     function newalignment(oldalignment: longint; offset: int64): longint;
-      var
-        localoffset: longint;
       begin
       begin
-        localoffset:=longint(offset);
-        while (localoffset mod oldalignment)<>0 do
-          oldalignment:=oldalignment div 2;
-        newalignment:=oldalignment;
+        { oldalignment must be power of two.
+
+          Negating two's complement number keeps its tail '100...000' and complements all bits above.
+          "x and -x" extracts this tail of 'x'.
+          Said tail of "oldalignment or offset" is the desired answer. }
+
+        result:=oldalignment or longint(offset); { high part of offset won't matter as long as alignment is 32-bit }
+        result:=result and -result;
       end;
       end;
 
 
 
 
@@ -337,50 +342,45 @@ implementation
 
 
     function align(i,a:longint):longint;{$ifdef USEINLINE}inline;{$endif}
     function align(i,a:longint):longint;{$ifdef USEINLINE}inline;{$endif}
     {
     {
-      return value <i> aligned <a> boundary
+      return value <i> aligned <a> boundary. <a> must be power of two.
     }
     }
       begin
       begin
-        { for 0 and 1 no aligning is needed }
-        if a<=1 then
-          result:=i
-        else
-          begin
-            if i<0 then
-              result:=((i+1-a) div a) * a
-            else
-              result:=((i-1+a) div a) * a;
-          end;
+        { One-line formula for i >= 0 is
+          >>> (i + a - 1) and not (a - 1),
+          and for i < 0 is
+          >>> i and not (a - 1). }
+
+        if a>0 then
+          a:=a-1; { 'a' is decremented beforehand, this also allows a=0 as a synonym for a=1. }
+        if i>=0 then
+          i:=i+a;
+        result:=i and not a;
       end;
       end;
 
 
 
 
     function align(i,a:int64):int64;{$ifdef USEINLINE}inline;{$endif}
     function align(i,a:int64):int64;{$ifdef USEINLINE}inline;{$endif}
     {
     {
-      return value <i> aligned <a> boundary
+      return value <i> aligned <a> boundary. <a> must be power of two.
     }
     }
       begin
       begin
-        { for 0 and 1 no aligning is needed }
-        if a<=1 then
-          result:=i
-        else
-          begin
-            if i<0 then
-              result:=((i+1-a) div a) * a
-            else
-              result:=((i-1+a) div a) * a;
-          end;
+        { Copy of 'longint' version. }
+        if a>0 then
+          a:=a-1;
+        if i>=0 then
+          i:=i+a;
+        result:=i and not a;
       end;
       end;
 
 
 
 
     function align(i,a:qword):qword;{$ifdef USEINLINE}inline;{$endif}
     function align(i,a:qword):qword;{$ifdef USEINLINE}inline;{$endif}
     {
     {
-      return value <i> aligned <a> boundary
+      return value <i> aligned <a> boundary. <a> must be power of two.
     }
     }
       begin
       begin
-        { for 0 and 1 no aligning is needed }
-        if (a<=1) or (i=0) then
-          result:=i
-        else
-          result:=((i-1+a) div a) * a;
+        { No i < 0 case here. }
+        if a>0 then
+          a:=a-1;
+        result:=(i+a) and not a;
       end;
       end;
 
 
 
 
@@ -985,26 +985,18 @@ implementation
       end;
       end;
 
 
 
 
-    function nextpowerof2(value : int64; out power: longint) : int64;
-    {
-      returns the power of 2 >= value
-    }
-      var
-        i : longint;
+    function nextpowerof2(value : qword; out power: longint) : qword;
       begin
       begin
-        result := 0;
-        power := -1;
-        if ((value <= 0) or
-            (value >= $4000000000000000)) then
+        power:=-1;
+        result:=0;
+        if (value=0) or (value>qword($8000000000000000)) then
           exit;
           exit;
-        result := 1;
-        for i:=0 to 63 do
+
+        power:=BsrQWord(value);
+        result:=qword(1) shl power;
+        if (value and (value-1))<>0 then
           begin
           begin
-            if result>=value then
-              begin
-                power := i;
-                exit;
-              end;
+            inc(power);
             result:=result shl 1;
             result:=result shl 1;
           end;
           end;
       end;
       end;
@@ -1188,6 +1180,21 @@ implementation
          result^:=s;
          result^:=s;
       end;
       end;
 
 
+
+    function PosCharset(const cs : TCharSet;const s : ansistring) : integer;
+      var
+        i : integer;
+      begin
+        result:=0;
+        for i:=1 to length(s) do
+          if s[i] in cs then
+            begin
+              result:=i;
+              exit;
+            end;
+      end;
+
+
     function CompareStr(const S1, S2: string): Integer;
     function CompareStr(const S1, S2: string): Integer;
       var
       var
         count, count1, count2: integer;
         count, count1, count2: integer;

+ 3 - 0
compiler/dbgdwarf.pas

@@ -2307,6 +2307,9 @@ implementation
            not assigned(def.procstarttai) then
            not assigned(def.procstarttai) then
           exit;
           exit;
 
 
+        if df_generic in def.defoptions then
+          exit;
+
         { Procdefs are not handled by the regular def writing code, so
         { Procdefs are not handled by the regular def writing code, so
           dbg_state is not set/checked for them. Do it here.  }
           dbg_state is not set/checked for them. Do it here.  }
         if (def.dbg_state in [dbg_state_writing,dbg_state_written]) then
         if (def.dbg_state in [dbg_state_writing,dbg_state_written]) then

+ 6 - 1
compiler/defutil.pas

@@ -1588,7 +1588,12 @@ implementation
             else
             else
               result:=tfloat2tcgsize[tfloatdef(def).floattype];
               result:=tfloat2tcgsize[tfloatdef(def).floattype];
           recorddef :
           recorddef :
-            result:=int_cgsize(def.size);
+{$ifdef wasm32}
+            if (def.size in [4,8]) and (trecorddef(def).contains_float_field) then
+              result:=int_float_cgsize(def.size)
+            else
+{$endif wasm32}
+              result:=int_cgsize(def.size);
           arraydef :
           arraydef :
             begin
             begin
               if is_dynamic_array(def) or not is_special_array(def) then
               if is_dynamic_array(def) or not is_special_array(def) then

+ 1 - 1
compiler/fmodule.pas

@@ -335,7 +335,7 @@ implementation
         { set new module }
         { set new module }
         current_module:=p;
         current_module:=p;
         { restore previous module settings }
         { restore previous module settings }
-        Fillchar(current_filepos,0,sizeof(current_filepos));
+        Fillchar(current_filepos,sizeof(current_filepos),0);
         if assigned(current_module) then
         if assigned(current_module) then
           begin
           begin
             current_asmdata:=tasmdata(current_module.asmdata);
             current_asmdata:=tasmdata(current_module.asmdata);

+ 0 - 5
compiler/fpcdefs.inc

@@ -58,11 +58,6 @@
 
 
 {$define USEEXCEPT}
 {$define USEEXCEPT}
 
 
-{$ifdef VER3_0}
-  { fix bootstrapping dfa gives warnings on 3.2+ code due to changed case behaviour }
-  {$OPTIMIZATION NODFA}
-{$endif VER3_0}
-
 { This fake CPU is used to allow incorporation of globtype unit
 { This fake CPU is used to allow incorporation of globtype unit
   into utils/ppudump without any CPU specific code PM }
   into utils/ppudump without any CPU specific code PM }
 {$ifdef generic_cpu}
 {$ifdef generic_cpu}

+ 66 - 2
compiler/fpccrc.pas → compiler/fpchash.pas

@@ -1,7 +1,7 @@
 {
 {
     Copyright (c) 2000-2002 by Free Pascal Development Team
     Copyright (c) 2000-2002 by Free Pascal Development Team
 
 
-    Routines to compute CRC values
+    Routines to compute hash values
 
 
     This program is free software; you can redistribute it and/or modify
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
 
 
  ****************************************************************************
  ****************************************************************************
 }
 }
-Unit fpccrc;
+Unit fpchash;
 
 
 {$i fpcdefs.inc}
 {$i fpcdefs.inc}
 
 
@@ -30,6 +30,16 @@ Function UpdateCrc32(InitCrc:cardinal;const InBuf;InLen:integer):cardinal;
   The resulting string is guaranteed to be not longer than maxlen. }
   The resulting string is guaranteed to be not longer than maxlen. }
 function TrimStrCRC32(const s: ansistring; maxlen: longint): ansistring;
 function TrimStrCRC32(const s: ansistring; maxlen: longint): ansistring;
 
 
+{ calculate string hash using FNV Hash:
+  http://www.isthe.com/chongo/tech/comp/fnv/
+}
+function UpdateFnv64(const InitFnv: uint64; const InBuf; InLen: Integer): uint64;
+
+type
+  Base64OfUint64String = string[11];
+
+function Base64Mangle(const x: uint64): Base64OfUint64String;
+
 Implementation
 Implementation
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -92,4 +102,58 @@ begin
    end;
    end;
 end;
 end;
 
 
+{ calculate string hash using FNV Hash:
+  http://www.isthe.com/chongo/tech/comp/fnv/
+}
+{$push} {$rangechecks off} {$overflowchecks off}
+function UpdateFnv64(const InitFnv: uint64; const InBuf; InLen: Integer): uint64;
+const
+  M = uint64(1099511628211);
+  { Compiler yells at you for overflows in constants, even with disabled range checks,
+    so there are precalculated values for unrolled loop: M^2, M^3, M^4. }
+  Mp2 = uint64(956575116354345);
+  Mp3 = uint64(624165263380053675);
+  Mp4 = uint64(11527715348014283921);
+var
+  pp: pByte;
+begin
+  result := InitFnv;
+  pp := @InBuf;
+  while InLen >= 4 do
+   begin
+     result := (result + pp[0]) * Mp4 + pp[1] * Mp3 + pp[2] * Mp2 + pp[3] * M;
+     pp := pp + 4;
+     InLen := InLen - 4;
+   end;
+  while InLen > 0 do
+   begin
+     result := (result + pp^) * M;
+     pp := pp + 1;
+     InLen := InLen - 1;
+   end;
+end;
+{$pop}
+
+const
+  Base64Chars: array[0 .. 63] of char = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_$';
+
+function Base64Mangle(const x: uint64): Base64OfUint64String;
+var
+  b64chars: pChar;
+begin
+  b64chars := pChar(Base64Chars);
+  result[0] := #11;
+  result[1] := b64chars[x and $3f];
+  result[2] := b64chars[uint32(x) shr 6 and $3f];
+  result[3] := b64chars[uint32(x) shr 12 and $3f];
+  result[4] := b64chars[uint32(x) shr 18 and $3f];
+  result[5] := b64chars[uint32(x) shr 24 and $3f];
+  result[6] := b64chars[x shr 30 and $3f];
+  result[7] := b64chars[x shr 36 and $3f];
+  result[8] := b64chars[x shr 42 and $3f];
+  result[9] := b64chars[x shr 48 and $3f];
+  result[10] := b64chars[x shr 54 and $3f];
+  result[11] := b64chars[x shr 60];
+end;
+
 end.
 end.

+ 25 - 0
compiler/fppu.pas

@@ -341,6 +341,21 @@ var
               exit;
               exit;
             end;
             end;
 {$endif i8086}
 {$endif i8086}
+{$ifdef wasm}
+          { check WebAssembly exceptions mode flag }
+          if ((mf_wasm_no_exceptions in moduleflags) <>
+              (ts_wasm_no_exceptions in current_settings.targetswitches)) or
+             ((mf_wasm_bf_exceptions in moduleflags) <>
+              (ts_wasm_bf_exceptions in current_settings.targetswitches)) or
+             ((mf_wasm_js_exceptions in moduleflags) <>
+              (ts_wasm_js_exceptions in current_settings.targetswitches)) or
+             ((mf_wasm_native_exceptions in moduleflags) <>
+              (ts_wasm_native_exceptions in current_settings.targetswitches)) then
+            begin
+              Message(unit_u_ppu_invalid_wasm_exceptions_mode,@queuecomment);
+              exit;
+            end;
+{$endif}
           if {$ifdef llvm}not{$endif}(mf_llvm in moduleflags) then
           if {$ifdef llvm}not{$endif}(mf_llvm in moduleflags) then
             begin
             begin
               Message(unit_u_ppu_llvm_mismatch,@queuecomment);
               Message(unit_u_ppu_llvm_mismatch,@queuecomment);
@@ -1024,6 +1039,16 @@ var
         if current_settings.x86memorymodel in [mm_tiny,mm_small,mm_medium] then
         if current_settings.x86memorymodel in [mm_tiny,mm_small,mm_medium] then
           include(moduleflags,mf_i8086_ss_equals_ds);
           include(moduleflags,mf_i8086_ss_equals_ds);
 {$endif i8086}
 {$endif i8086}
+{$ifdef wasm}
+        if ts_wasm_no_exceptions in current_settings.targetswitches then
+          include(moduleflags,mf_wasm_no_exceptions);
+        if ts_wasm_native_exceptions in current_settings.targetswitches then
+          include(moduleflags,mf_wasm_native_exceptions);
+        if ts_wasm_js_exceptions in current_settings.targetswitches then
+          include(moduleflags,mf_wasm_js_exceptions);
+        if ts_wasm_bf_exceptions in current_settings.targetswitches then
+          include(moduleflags,mf_wasm_bf_exceptions);
+{$endif wasm}
 {$ifdef llvm}
 {$ifdef llvm}
         include(moduleflags,mf_llvm);
         include(moduleflags,mf_llvm);
 {$endif}
 {$endif}

+ 0 - 2
compiler/generic/cpuinfo.pas

@@ -24,13 +24,11 @@ Interface
 
 
 Type
 Type
    bestreal = extended;
    bestreal = extended;
-{$if FPC_FULLVERSION>20700}
 {$ifdef FPC_HAS_TYPE_EXTENDED}
 {$ifdef FPC_HAS_TYPE_EXTENDED}
    bestrealrec = TExtended80Rec;
    bestrealrec = TExtended80Rec;
 {$else}
 {$else}
    bestrealrec = TDoubleRec;
    bestrealrec = TDoubleRec;
 {$endif}
 {$endif}
-{$endif FPC_FULLVERSION>20700}
    ts32real = single;
    ts32real = single;
    ts64real = double;
    ts64real = double;
    ts80real = type extended;
    ts80real = type extended;

+ 17 - 15
compiler/globals.pas

@@ -207,16 +207,16 @@ interface
       private
       private
         itemcnt : longint;
         itemcnt : longint;
         fmap : Array Of TLinkRec;
         fmap : Array Of TLinkRec;
-        function  Lookup(key:Ansistring):longint;
+        function  Lookup(const key:Ansistring):longint;
         function getlinkrec(i:longint):TLinkRec;
         function getlinkrec(i:longint):TLinkRec;
       public
       public
-        procedure Add(key:ansistring;value:AnsiString='';weight:longint=LinkMapWeightDefault);
-        procedure addseries(keys:AnsiString;weight:longint=LinkMapWeightDefault);
-        function  AddDep(keyvalue:String):boolean;
-        function  AddWeight(keyvalue:String):boolean;
-        procedure SetValue(key:AnsiString;Weight:Integer);
+        procedure Add(const key:ansistring;const value:AnsiString='';weight:longint=LinkMapWeightDefault);
+        procedure addseries(const keys:AnsiString;weight:longint=LinkMapWeightDefault);
+        function  AddDep(const keyvalue:String):boolean;
+        function  AddWeight(const keyvalue:String):boolean;
+        procedure SetValue(const key:AnsiString;Weight:Integer);
         procedure SortonWeight;
         procedure SortonWeight;
-        function Find(key:AnsiString):AnsiString;
+        function Find(const key:AnsiString):AnsiString;
         procedure Expand(src:TCmdStrList;dest: TLinkStrMap);
         procedure Expand(src:TCmdStrList;dest: TLinkStrMap);
         procedure UpdateWeights(Weightmap:TLinkStrMap);
         procedure UpdateWeights(Weightmap:TLinkStrMap);
         constructor Create;
         constructor Create;
@@ -265,6 +265,8 @@ interface
 {$ifdef XTENSA}
 {$ifdef XTENSA}
        { specified with -Ff }
        { specified with -Ff }
        idfpath           : TPathStr;
        idfpath           : TPathStr;
+       { specified with }
+       idf_version       : longint;
 {$endif XTENSA}
 {$endif XTENSA}
        { external assembler extra option }
        { external assembler extra option }
        asmextraopt       : string;
        asmextraopt       : string;
@@ -699,7 +701,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TLinkStrMap.Add(key:ansistring;value:AnsiString='';weight:longint=LinkMapWeightDefault);
+    procedure TLinkStrMap.Add(const key:ansistring;const value:AnsiString='';weight:longint=LinkMapWeightDefault);
       begin
       begin
         if lookup(key)<>-1 Then
         if lookup(key)<>-1 Then
           exit;
           exit;
@@ -712,7 +714,7 @@ implementation
       end;
       end;
 
 
 
 
-    function  TLinkStrMap.AddDep(keyvalue:String):boolean;
+    function  TLinkStrMap.AddDep(const keyvalue:String):boolean;
       var
       var
         i : Longint;
         i : Longint;
       begin
       begin
@@ -725,7 +727,7 @@ implementation
       end;
       end;
 
 
 
 
-    function  TLinkStrMap.AddWeight(keyvalue:String):boolean;
+    function  TLinkStrMap.AddWeight(const keyvalue:String):boolean;
       var
       var
         i,j    : Longint;
         i,j    : Longint;
         Code : Word;
         Code : Word;
@@ -745,7 +747,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TLinkStrMap.addseries(keys:AnsiString;weight:longint);
+    procedure TLinkStrMap.addseries(const keys:AnsiString;weight:longint);
       var
       var
         i,j,k : longint;
         i,j,k : longint;
       begin
       begin
@@ -761,7 +763,7 @@ implementation
          end;
          end;
       end;
       end;
 
 
-    procedure TLinkStrMap.SetValue(Key:Ansistring;weight:Integer);
+    procedure TLinkStrMap.SetValue(const Key:Ansistring;weight:Integer);
       var
       var
         j : longint;
         j : longint;
       begin
       begin
@@ -771,7 +773,7 @@ implementation
       end;
       end;
 
 
 
 
-    function TLinkStrMap.find(key:Ansistring):Ansistring;
+    function TLinkStrMap.find(const key:Ansistring):Ansistring;
       var
       var
         j : longint;
         j : longint;
       begin
       begin
@@ -782,7 +784,7 @@ implementation
       end;
       end;
 
 
 
 
-    function TLinkStrMap.lookup(key:Ansistring):longint;
+    function TLinkStrMap.lookup(const key:Ansistring):longint;
       var
       var
         i : longint;
         i : longint;
       begin
       begin
@@ -1112,7 +1114,7 @@ implementation
         p: pbyte;
         p: pbyte;
       begin
       begin
         p := pbyte(@r);
         p := pbyte(@r);
-{$ifdef CPU_ARM}
+{$ifdef FPUARM_HAS_FPA}
         inc(p,4);
         inc(p,4);
 {$else}
 {$else}
 {$ifdef FPC_LITTLE_ENDIAN}
 {$ifdef FPC_LITTLE_ENDIAN}

+ 33 - 9
compiler/globtype.pas

@@ -171,7 +171,8 @@ interface
          { i8086 specific }
          { i8086 specific }
          cs_force_far_calls,
          cs_force_far_calls,
          cs_hugeptr_arithmetic_normalization,
          cs_hugeptr_arithmetic_normalization,
-         cs_hugeptr_comparison_normalization
+         cs_hugeptr_comparison_normalization,
+         cs_legacyifend
        );
        );
        tlocalswitches = set of tlocalswitch;
        tlocalswitches = set of tlocalswitch;
 
 
@@ -310,7 +311,16 @@ interface
            allows Windows to move code segments around (in order to defragment
            allows Windows to move code segments around (in order to defragment
            memory) and then walk through the stacks of all running programs and
            memory) and then walk through the stacks of all running programs and
            update the segment values of the segment that has moved. }
            update the segment values of the segment that has moved. }
-         ts_x86_far_procs_push_odd_bp
+         ts_x86_far_procs_push_odd_bp,
+         { no exception support. Raising an exception will abort the program. }
+         ts_wasm_no_exceptions,
+         { Branchful exceptions support. A global threadvar is checked after each function call. }
+         ts_wasm_bf_exceptions,
+         { JavaScript-based exception support }
+         ts_wasm_js_exceptions,
+         { native WebAssembly exceptions support:
+           https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md }
+         ts_wasm_native_exceptions
        );
        );
        ttargetswitches = set of ttargetswitch;
        ttargetswitches = set of ttargetswitch;
 
 
@@ -349,7 +359,9 @@ interface
          cs_opt_dead_store_eliminate,
          cs_opt_dead_store_eliminate,
          cs_opt_forcenostackframe,
          cs_opt_forcenostackframe,
          cs_opt_use_load_modify_store,
          cs_opt_use_load_modify_store,
-         cs_opt_unused_para
+         cs_opt_unused_para,
+         cs_opt_consts,
+         cs_opt_forloop
        );
        );
        toptimizerswitches = set of toptimizerswitch;
        toptimizerswitches = set of toptimizerswitch;
 
 
@@ -391,7 +403,11 @@ interface
          mf_package_deny,             { this unit must not be part of a package }
          mf_package_deny,             { this unit must not be part of a package }
          mf_package_weak,             { this unit may be completely contained in a package }
          mf_package_weak,             { this unit may be completely contained in a package }
          mf_llvm,                     { compiled for LLVM code generator, not compatible with regular compiler because of different nodes in inline functions }
          mf_llvm,                     { compiled for LLVM code generator, not compatible with regular compiler because of different nodes in inline functions }
-         mf_symansistr                { symbols are ansistrings (for ppudump) }
+         mf_symansistr,               { symbols are ansistrings (for ppudump) }
+         mf_wasm_no_exceptions,       { unit was compiled in WebAssembly 'no exceptions' mode }
+         mf_wasm_bf_exceptions,       { unit was compiled in WebAssembly 'branchful' exceptions mode }
+         mf_wasm_js_exceptions,       { unit was compiled in WebAssembly JavaScript-based exceptions mode }
+         mf_wasm_native_exceptions    { unit was compiled in WebAssembly native exceptions mode }
        );
        );
        tmoduleflags = set of tmoduleflag;
        tmoduleflags = set of tmoduleflag;
 
 
@@ -402,7 +418,7 @@ interface
           hasvalue: boolean;
           hasvalue: boolean;
           { target switch can be used only globally }
           { target switch can be used only globally }
           isglobal: boolean;
           isglobal: boolean;
-          define: string[25];
+          define: string[30];
        end;
        end;
 
 
     const
     const
@@ -414,7 +430,7 @@ interface
          'ORDERFIELDS','FASTMATH','DEADVALUES','REMOVEEMPTYPROCS',
          'ORDERFIELDS','FASTMATH','DEADVALUES','REMOVEEMPTYPROCS',
          'CONSTPROP',
          'CONSTPROP',
          'DEADSTORE','FORCENOSTACKFRAME','USELOADMODIFYSTORE',
          'DEADSTORE','FORCENOSTACKFRAME','USELOADMODIFYSTORE',
-         'UNUSEDPARA'
+         'UNUSEDPARA','CONSTS','FORLOOP'
        );
        );
        WPOptimizerSwitchStr : array [twpoptimizerswitch] of string[14] = (
        WPOptimizerSwitchStr : array [twpoptimizerswitch] of string[14] = (
          'DEVIRTCALLS','OPTVMTS','SYMBOLLIVENESS'
          'DEVIRTCALLS','OPTVMTS','SYMBOLLIVENESS'
@@ -434,13 +450,19 @@ interface
          (name: 'LOWERCASEPROCSTART';  hasvalue: false; isglobal: true ; define: ''),
          (name: 'LOWERCASEPROCSTART';  hasvalue: false; isglobal: true ; define: ''),
          (name: 'INITLOCALS';          hasvalue: false; isglobal: true ; define: ''),
          (name: 'INITLOCALS';          hasvalue: false; isglobal: true ; define: ''),
          (name: 'CLD';                 hasvalue: false; isglobal: true ; define: 'FPC_ENABLED_CLD'),
          (name: 'CLD';                 hasvalue: false; isglobal: true ; define: 'FPC_ENABLED_CLD'),
-         (name: 'FARPROCSPUSHODDBP';   hasvalue: false; isglobal: false; define: 'FPC_FAR_PROCS_PUSH_ODD_BP')
+         (name: 'FARPROCSPUSHODDBP';   hasvalue: false; isglobal: false; define: 'FPC_FAR_PROCS_PUSH_ODD_BP'),
+         (name: 'NOEXCEPTIONS';        hasvalue: false; isglobal: true ; define: 'FPC_WASM_NO_EXCEPTIONS'),
+         (name: 'BFEXCEPTIONS';        hasvalue: false; isglobal: true ; define: 'FPC_WASM_BRANCHFUL_EXCEPTIONS'),
+         (name: 'JSEXCEPTIONS';        hasvalue: false; isglobal: true ; define: 'FPC_WASM_JS_EXCEPTIONS'),
+         (name: 'WASMEXCEPTIONS';      hasvalue: false; isglobal: true ; define: 'FPC_WASM_NATIVE_EXCEPTIONS')
        );
        );
 
 
        { switches being applied to all CPUs at the given level }
        { switches being applied to all CPUs at the given level }
        genericlevel1optimizerswitches = [cs_opt_level1,cs_opt_peephole];
        genericlevel1optimizerswitches = [cs_opt_level1,cs_opt_peephole];
        genericlevel2optimizerswitches = [cs_opt_level2,cs_opt_remove_empty_proc,cs_opt_unused_para];
        genericlevel2optimizerswitches = [cs_opt_level2,cs_opt_remove_empty_proc,cs_opt_unused_para];
-       genericlevel3optimizerswitches = [cs_opt_level3,cs_opt_constant_propagate,cs_opt_nodedfa{$ifndef llvm},cs_opt_use_load_modify_store{$endif},cs_opt_loopunroll];
+       genericlevel3optimizerswitches = [cs_opt_level3,cs_opt_constant_propagate,cs_opt_nodedfa
+                                         {$ifndef llvm},cs_opt_use_load_modify_store{$endif},
+                                         cs_opt_loopunroll,cs_opt_forloop];
        genericlevel4optimizerswitches = [cs_opt_level4,cs_opt_reorder_fields,cs_opt_dead_values,cs_opt_fastmath];
        genericlevel4optimizerswitches = [cs_opt_level4,cs_opt_reorder_fields,cs_opt_dead_values,cs_opt_fastmath];
 
 
        { whole program optimizations whose information generation requires
        { whole program optimizations whose information generation requires
@@ -764,7 +786,9 @@ interface
          { subroutine uses get_frame }
          { subroutine uses get_frame }
          pi_uses_get_frame,
          pi_uses_get_frame,
          { x86 only: subroutine uses ymm registers, requires vzeroupper call }
          { x86 only: subroutine uses ymm registers, requires vzeroupper call }
-         pi_uses_ymm
+         pi_uses_ymm,
+         { set if no frame pointer is needed, the rules when this applies is target specific }
+         pi_no_framepointer_needed
        );
        );
        tprocinfoflags=set of tprocinfoflag;
        tprocinfoflags=set of tprocinfoflag;
 
 

+ 23 - 13
compiler/hlcgobj.pas

@@ -437,6 +437,14 @@ unit hlcgobj;
           }
           }
           procedure g_exception_reason_discard(list : TAsmList; size: tdef; href: treference); virtual;
           procedure g_exception_reason_discard(list : TAsmList; size: tdef; href: treference); virtual;
 
 
+          {#
+              This routine is called after g_call_system_proc to a system proc,
+              that might raise an exception. It is used on platforms, that need
+              to manually check an 'exception raised' flag, like WebAssembly in
+              branchful exceptions mode.
+          }
+          procedure g_maybe_checkforexceptions(list : TAsmList); virtual;
+
           {#
           {#
               Call when the current location should never be reached
               Call when the current location should never be reached
           }
           }
@@ -688,7 +696,8 @@ implementation
        fmodule,
        fmodule,
        verbose,defutil,paramgr,
        verbose,defutil,paramgr,
        symtable,
        symtable,
-       nbas,ncon,nld,ncgrtti,pass_2,
+       nbas,ncon,nld,nmem,
+       ncgrtti,pass_2,
        cgobj,cutils,procinfo,
        cgobj,cutils,procinfo,
 {$ifdef x86}
 {$ifdef x86}
        cgx86,
        cgx86,
@@ -3345,6 +3354,12 @@ implementation
     end;
     end;
 
 
 
 
+  procedure thlcgobj.g_maybe_checkforexceptions(list : TAsmList);
+    begin
+      { do nothing by default }
+    end;
+
+
   procedure thlcgobj.g_unreachable(list: TAsmList);
   procedure thlcgobj.g_unreachable(list: TAsmList);
     begin
     begin
       { nothing }
       { nothing }
@@ -3881,10 +3896,12 @@ implementation
         a_cmp_const_reg_label(list,OS_INT,OC_GTE,aint(hto-lto),hreg,neglabel)
         a_cmp_const_reg_label(list,OS_INT,OC_GTE,aint(hto-lto),hreg,neglabel)
       else
       else
       }
       }
+      cg.a_reg_alloc(list, NR_DEFAULTFLAGS);
       if qword(hto-lto)>qword(aintmax) then
       if qword(hto-lto)>qword(aintmax) then
         a_cmp_const_reg_label(list,maxdef,OC_BE,aintmax,hreg,neglabel)
         a_cmp_const_reg_label(list,maxdef,OC_BE,aintmax,hreg,neglabel)
       else
       else
         a_cmp_const_reg_label(list,maxdef,OC_BE,tcgint(int64(hto-lto)),hreg,neglabel);
         a_cmp_const_reg_label(list,maxdef,OC_BE,tcgint(int64(hto-lto)),hreg,neglabel);
+      cg.a_reg_dealloc(list, NR_DEFAULTFLAGS);
       g_call_system_proc(list,'fpc_rangeerror',[],nil).resetiftemp;
       g_call_system_proc(list,'fpc_rangeerror',[],nil).resetiftemp;
       a_label(list,neglabel);
       a_label(list,neglabel);
     end;
     end;
@@ -4652,6 +4669,11 @@ implementation
         inn,
         inn,
         asn,isn:
         asn,isn:
           result := fen_norecurse_false;
           result := fen_norecurse_false;
+        vecn:
+          { we cannot do SSA during partial writes to arrays which span multiple registers, see also tw39325 }
+          if (tvecnode(n).left.location.loc in [LOC_CREGISTER,LOC_CFPUREGISTER,LOC_CMMXREGISTER,LOC_CMMREGISTER]) and
+            (tcgsize2size[reg_cgsize(tvecnode(n).left.location.register)]<>tvecnode(n).left.resultdef.size) then
+            result := fen_norecurse_false;
         else
         else
           ;
           ;
       end;
       end;
@@ -4750,10 +4772,6 @@ implementation
       { initialises temp. ansi/wide string data }
       { initialises temp. ansi/wide string data }
       if (current_procinfo.procdef.proctypeoption<>potype_exceptfilter) then
       if (current_procinfo.procdef.proctypeoption<>potype_exceptfilter) then
         inittempvariables(list);
         inittempvariables(list);
-
-{$ifdef OLDREGVARS}
-      load_regvars(list,nil);
-{$endif OLDREGVARS}
     end;
     end;
 
 
   procedure thlcgobj.gen_finalize_code(list: TAsmList);
   procedure thlcgobj.gen_finalize_code(list: TAsmList);
@@ -4768,10 +4786,6 @@ implementation
           current_procinfo:=current_procinfo.parent;
           current_procinfo:=current_procinfo.parent;
         end;
         end;
 
 
-{$ifdef OLDREGVARS}
-      cleanup_regvars(list);
-{$endif OLDREGVARS}
-
       { finalize paras data }
       { finalize paras data }
       if assigned(current_procinfo.procdef.parast) and
       if assigned(current_procinfo.procdef.parast) and
          not(po_assembler in current_procinfo.procdef.procoptions) then
          not(po_assembler in current_procinfo.procdef.procoptions) then
@@ -4842,10 +4856,6 @@ implementation
        end;
        end;
 
 
       list.concat(Tai_force_line.Create);
       list.concat(Tai_force_line.Create);
-
-{$ifdef OLDREGVARS}
-      load_regvars(list,nil);
-{$endif OLDREGVARS}
     end;
     end;
 
 
   procedure thlcgobj.gen_exit_code(list: TAsmList);
   procedure thlcgobj.gen_exit_code(list: TAsmList);

+ 14 - 1
compiler/i386/aoptcpu.pas

@@ -24,7 +24,9 @@ unit aoptcpu;
 
 
 {$i fpcdefs.inc}
 {$i fpcdefs.inc}
 
 
-{ $define DEBUG_AOPTCPU}
+{$ifdef EXTDEBUG}
+{$define DEBUG_AOPTCPU}
+{$endif EXTDEBUG}
 
 
   Interface
   Interface
 
 
@@ -228,6 +230,12 @@ unit aoptcpu;
                 A_SHRX,
                 A_SHRX,
                 A_SHLX:
                 A_SHLX:
                   Result:=OptPass1SHXX(p);
                   Result:=OptPass1SHXX(p);
+                A_VMOVDQA,
+                A_VMOVDQU:
+                  Result:=OptPass1VMOVDQ(p);
+                A_VCVTSS2SD,
+                A_CVTSS2SD:
+                  Result:=OptPass1_V_Cvtss2sd(p);
                 else
                 else
                   ;
                   ;
               end;
               end;
@@ -357,6 +365,11 @@ unit aoptcpu;
                   Result:=PostPeepholeOptMOVSX(p);
                   Result:=PostPeepholeOptMOVSX(p);
                 A_SHR:
                 A_SHR:
                   Result:=PostPeepholeOptShr(p);
                   Result:=PostPeepholeOptShr(p);
+                A_ADD,
+                A_SUB:
+                  Result:=PostPeepholeOptADDSUB(p);
+                A_VPXOR:
+                  Result:=PostPeepholeOptVPXOR(p);
                 else
                 else
                   ;
                   ;
               end;
               end;

+ 0 - 2
compiler/i386/cpuinfo.pas

@@ -30,9 +30,7 @@ Interface
 
 
 Type
 Type
    bestreal = extended;
    bestreal = extended;
-{$if FPC_FULLVERSION>20700}
    bestrealrec = TExtended80Rec;
    bestrealrec = TExtended80Rec;
-{$endif FPC_FULLVERSION>20700}
    ts32real = single;
    ts32real = single;
    ts64real = double;
    ts64real = double;
    ts80real = extended;
    ts80real = extended;

+ 2 - 2
compiler/i386/cpupara.pas

@@ -299,8 +299,8 @@ unit cpupara;
 
 
     function tcpuparamanager.get_saved_registers_int(calloption : tproccalloption):tcpuregisterarray;
     function tcpuparamanager.get_saved_registers_int(calloption : tproccalloption):tcpuregisterarray;
       const
       const
-        saveregs : {$ifndef VER3_0}tcpuregisterarray{$else}array[0..3] of tsuperregister{$endif} = (RS_EBX,RS_ESI,RS_EDI,RS_EBP);
-        saveregs_oldfpccall : {$ifndef VER3_0}tcpuregisterarray{$else}array[0..0] of tsuperregister{$endif} = (RS_EBP);
+        saveregs : tcpuregisterarray = (RS_EBX,RS_ESI,RS_EDI,RS_EBP);
+        saveregs_oldfpccall : tcpuregisterarray = (RS_EBP);
       begin
       begin
         case calloption of
         case calloption of
           pocall_internproc,
           pocall_internproc,

+ 8 - 1
compiler/i386/i386att.inc

@@ -1435,5 +1435,12 @@
 'vpshrdvq',
 'vpshrdvq',
 'vpshrdvw',
 'vpshrdvw',
 'vpshrdw',
 'vpshrdw',
-'vpshufbitqmb'
+'vpshufbitqmb',
+'sha1rnds4',
+'sha1nexte',
+'sha1msg1',
+'sha1msg2',
+'sha256rnds2',
+'sha256msg1',
+'sha256msg2'
 );
 );

+ 19 - 12
compiler/i386/i386atts.inc

@@ -424,10 +424,10 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -539,14 +539,14 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
 attsufNONE,
 attsufNONE,
-attsufINT,
+attsufNONE,
+attsufMMS,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -789,8 +789,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufMMS,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufMMX,
 attsufMMX,
@@ -1222,8 +1222,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufMMX,
 attsufMMX,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufMMS,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1241,8 +1241,15 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufMMS,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,

+ 8 - 1
compiler/i386/i386int.inc

@@ -1435,5 +1435,12 @@
 'vpshrdvq',
 'vpshrdvq',
 'vpshrdvw',
 'vpshrdvw',
 'vpshrdw',
 'vpshrdw',
-'vpshufbitqmb'
+'vpshufbitqmb',
+'sha1rnds4',
+'sha1nexte',
+'sha1msg1',
+'sha1msg2',
+'sha256rnds2',
+'sha256msg1',
+'sha256msg2'
 );
 );

+ 1 - 1
compiler/i386/i386nop.inc

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

+ 8 - 1
compiler/i386/i386op.inc

@@ -1435,5 +1435,12 @@ A_VPSHRDVD,
 A_VPSHRDVQ,
 A_VPSHRDVQ,
 A_VPSHRDVW,
 A_VPSHRDVW,
 A_VPSHRDW,
 A_VPSHRDW,
-A_VPSHUFBITQMB
+A_VPSHUFBITQMB,
+A_SHA1RNDS4,
+A_SHA1NEXTE,
+A_SHA1MSG1,
+A_SHA1MSG2,
+A_SHA256RNDS2,
+A_SHA256MSG1,
+A_SHA256MSG2
 );
 );

+ 14 - 7
compiler/i386/i386prop.inc

@@ -169,7 +169,7 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_RWESP, Ch_WEBP]),
+(Ch: [Ch_RWESP, Ch_RWEBP]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: []),
 (Ch: []),
@@ -666,17 +666,17 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
-(Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2]),
+(Ch: [Ch_Wop3, Ch_Rop2]),
+(Ch: [Ch_Wop3, Ch_Rop2]),
+(Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Mop1, Ch_Rop2]),
 (Ch: [Ch_Mop1, Ch_Rop2]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
@@ -1435,5 +1435,12 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
-(Ch: [Ch_All])
+(Ch: [Ch_All]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1, Ch_RXMM0]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1])
 );
 );

+ 102 - 109
compiler/i386/i386tab.inc

@@ -10531,7 +10531,7 @@
   (
   (
     opcode  : A_VCVTPD2DQ;
     opcode  : A_VCVTPD2DQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #220#232#233#234#248#1#230#72;
     code    : #220#232#233#234#248#1#230#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -10542,13 +10542,6 @@
     code    : #220#232#233#234#248#1#230#72;
     code    : #220#232#233#234#248#1#230#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTPD2DQ;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #220#232#233#234#248#1#230#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTPD2PS;
     opcode  : A_VCVTPD2PS;
     ops     : 2;
     ops     : 2;
@@ -10587,7 +10580,7 @@
   (
   (
     opcode  : A_VCVTPD2PS;
     opcode  : A_VCVTPD2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #232#233#234#241#248#1#90#72;
     code    : #232#233#234#241#248#1#90#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -10598,13 +10591,6 @@
     code    : #232#233#234#241#248#1#90#72;
     code    : #232#233#234#241#248#1#90#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTPD2PS;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #232#233#234#241#248#1#90#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTPH2PS;
     opcode  : A_VCVTPH2PS;
     ops     : 2;
     ops     : 2;
@@ -10839,30 +10825,44 @@
   (
   (
     opcode  : A_VCVTSI2SD;
     opcode  : A_VCVTSI2SD;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
     code    : #220#232#242#248#1#42#61#80;
     code    : #220#232#242#248#1#42#61#80;
-    flags   : [if_avx,if_sandybridge,if_sd]
+    flags   : [if_avx,if_sandybridge]
   ),
   ),
   (
   (
     opcode  : A_VCVTSI2SD;
     opcode  : A_VCVTSI2SD;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg,ot_memory or ot_bits32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits32,ot_none);
     code    : #220#232#242#248#1#42#61#80;
     code    : #220#232#242#248#1#42#61#80;
-    flags   : [if_avx,if_sandybridge,if_sd,if_t1s]
+    flags   : [if_avx,if_sandybridge,if_t1s]
+  ),
+  (
+    opcode  : A_VCVTSI2SD;
+    ops     : 3;
+    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_t1s]
   ),
   ),
   (
   (
     opcode  : A_VCVTSI2SS;
     opcode  : A_VCVTSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
     code    : #219#232#242#248#1#42#61#80;
     code    : #219#232#242#248#1#42#61#80;
-    flags   : [if_avx,if_sandybridge,if_sd]
+    flags   : [if_avx,if_sandybridge]
   ),
   ),
   (
   (
     opcode  : A_VCVTSI2SS;
     opcode  : A_VCVTSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg,ot_memory or ot_bits32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits32,ot_none);
     code    : #219#232#242#248#1#42#61#80;
     code    : #219#232#242#248#1#42#61#80;
-    flags   : [if_avx,if_sandybridge,if_sd,if_t1s]
+    flags   : [if_avx,if_sandybridge,if_t1s]
+  ),
+  (
+    opcode  : A_VCVTSI2SS;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
+    code    : #219#232#234#242#243#248#1#42#61#80;
+    flags   : [if_avx,if_sandybridge,if_t1s]
   ),
   ),
   (
   (
     opcode  : A_VCVTSS2SD;
     opcode  : A_VCVTSS2SD;
@@ -10944,7 +10944,7 @@
   (
   (
     opcode  : A_VCVTTPD2DQ;
     opcode  : A_VCVTTPD2DQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_sae,ot_none,ot_none);
     code    : #232#233#234#241#248#1#230#72;
     code    : #232#233#234#241#248#1#230#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -10955,13 +10955,6 @@
     code    : #232#233#234#241#248#1#230#72;
     code    : #232#233#234#241#248#1#230#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTTPD2DQ;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_sae,ot_none,ot_none);
-    code    : #232#233#234#241#248#1#230#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTTPS2DQ;
     opcode  : A_VCVTTPS2DQ;
     ops     : 2;
     ops     : 2;
@@ -21301,13 +21294,6 @@
     code    : #232#233#234#241#248#1#123#72;
     code    : #232#233#234#241#248#1#123#72;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
-  (
-    opcode  : A_VCVTPD2UDQ;
-    ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
-    code    : #232#234#248#1#121#72;
-    flags   : [if_avx512,if_tfv]
-  ),
   (
   (
     opcode  : A_VCVTPD2UDQ;
     opcode  : A_VCVTPD2UDQ;
     ops     : 2;
     ops     : 2;
@@ -21318,9 +21304,9 @@
   (
   (
     opcode  : A_VCVTPD2UDQ;
     opcode  : A_VCVTPD2UDQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_none,ot_none);
     code    : #232#234#248#1#121#72;
     code    : #232#234#248#1#121#72;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_tfv]
   ),
   ),
   (
   (
     opcode  : A_VCVTPD2UDQ;
     opcode  : A_VCVTPD2UDQ;
@@ -21346,7 +21332,7 @@
   (
   (
     opcode  : A_VCVTPD2UDQ;
     opcode  : A_VCVTPD2UDQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #232#233#234#248#1#121#72;
     code    : #232#233#234#248#1#121#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -21357,13 +21343,6 @@
     code    : #232#233#234#248#1#121#72;
     code    : #232#233#234#248#1#121#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTPD2UDQ;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #232#233#234#248#1#121#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTPD2UQQ;
     opcode  : A_VCVTPD2UQQ;
     ops     : 2;
     ops     : 2;
@@ -21623,13 +21602,6 @@
     code    : #219#232#233#234#248#1#230#72;
     code    : #219#232#233#234#248#1#230#72;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
-  (
-    opcode  : A_VCVTQQ2PS;
-    ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
-    code    : #232#234#248#1#91#72;
-    flags   : [if_avx512,if_tfv]
-  ),
   (
   (
     opcode  : A_VCVTQQ2PS;
     opcode  : A_VCVTQQ2PS;
     ops     : 2;
     ops     : 2;
@@ -21640,9 +21612,9 @@
   (
   (
     opcode  : A_VCVTQQ2PS;
     opcode  : A_VCVTQQ2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_none,ot_none);
     code    : #232#234#248#1#91#72;
     code    : #232#234#248#1#91#72;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_tfv]
   ),
   ),
   (
   (
     opcode  : A_VCVTQQ2PS;
     opcode  : A_VCVTQQ2PS;
@@ -21668,7 +21640,7 @@
   (
   (
     opcode  : A_VCVTQQ2PS;
     opcode  : A_VCVTQQ2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #232#233#234#248#1#91#72;
     code    : #232#233#234#248#1#91#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -21679,13 +21651,6 @@
     code    : #232#233#234#248#1#91#72;
     code    : #232#233#234#248#1#91#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTQQ2PS;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #232#233#234#248#1#91#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTSD2USI;
     opcode  : A_VCVTSD2USI;
     ops     : 2;
     ops     : 2;
@@ -21791,13 +21756,6 @@
     code    : #232#233#234#241#248#1#122#72;
     code    : #232#233#234#241#248#1#122#72;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
-  (
-    opcode  : A_VCVTTPD2UDQ;
-    ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
-    code    : #232#234#248#1#120#72;
-    flags   : [if_avx512,if_tfv]
-  ),
   (
   (
     opcode  : A_VCVTTPD2UDQ;
     opcode  : A_VCVTTPD2UDQ;
     ops     : 2;
     ops     : 2;
@@ -21808,9 +21766,9 @@
   (
   (
     opcode  : A_VCVTTPD2UDQ;
     opcode  : A_VCVTTPD2UDQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_none,ot_none);
     code    : #232#234#248#1#120#72;
     code    : #232#234#248#1#120#72;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_tfv]
   ),
   ),
   (
   (
     opcode  : A_VCVTTPD2UDQ;
     opcode  : A_VCVTTPD2UDQ;
@@ -21836,7 +21794,7 @@
   (
   (
     opcode  : A_VCVTTPD2UDQ;
     opcode  : A_VCVTTPD2UDQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_sae,ot_none,ot_none);
     code    : #232#233#234#248#1#120#72;
     code    : #232#233#234#248#1#120#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -21847,13 +21805,6 @@
     code    : #232#233#234#248#1#120#72;
     code    : #232#233#234#248#1#120#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTTPD2UDQ;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_sae,ot_none,ot_none);
-    code    : #232#233#234#248#1#120#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTTPD2UQQ;
     opcode  : A_VCVTTPD2UQQ;
     ops     : 2;
     ops     : 2;
@@ -22274,13 +22225,6 @@
     code    : #219#232#233#234#248#1#122#72;
     code    : #219#232#233#234#248#1#122#72;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
-  (
-    opcode  : A_VCVTUQQ2PS;
-    ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
-    code    : #220#232#234#248#1#122#72;
-    flags   : [if_avx512,if_tfv]
-  ),
   (
   (
     opcode  : A_VCVTUQQ2PS;
     opcode  : A_VCVTUQQ2PS;
     ops     : 2;
     ops     : 2;
@@ -22291,9 +22235,9 @@
   (
   (
     opcode  : A_VCVTUQQ2PS;
     opcode  : A_VCVTUQQ2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_none,ot_none);
     code    : #220#232#234#248#1#122#72;
     code    : #220#232#234#248#1#122#72;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_tfv]
   ),
   ),
   (
   (
     opcode  : A_VCVTUQQ2PS;
     opcode  : A_VCVTUQQ2PS;
@@ -22319,7 +22263,7 @@
   (
   (
     opcode  : A_VCVTUQQ2PS;
     opcode  : A_VCVTUQQ2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #220#232#233#234#248#1#122#72;
     code    : #220#232#233#234#248#1#122#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -22331,45 +22275,45 @@
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
   (
   (
-    opcode  : A_VCVTUQQ2PS;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #220#232#233#234#248#1#122#72;
+    opcode  : A_VCVTUSI2SD;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    code    : #220#232#248#1#123#61#80;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
   (
   (
     opcode  : A_VCVTUSI2SD;
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
-    code    : #220#232#234#248#1#123#61#80;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits32,ot_none);
+    code    : #220#232#248#1#123#61#80;
     flags   : [if_avx512,if_t1s]
     flags   : [if_avx512,if_t1s]
   ),
   ),
   (
   (
     opcode  : A_VCVTUSI2SD;
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg64,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
     code    : #220#232#234#248#1#123#61#80;
     code    : #220#232#234#248#1#123#61#80;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_t1s]
   ),
   ),
   (
   (
-    opcode  : A_VCVTUSI2SD;
+    opcode  : A_VCVTUSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_rm_gpr or ot_bits32,ot_none);
-    code    : #220#232#248#1#123#61#80;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    code    : #219#232#248#1#123#61#80;
+    flags   : [if_avx512]
   ),
   ),
   (
   (
     opcode  : A_VCVTUSI2SS;
     opcode  : A_VCVTUSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_rm_gpr or ot_bits64,ot_none);
-    code    : #219#232#234#248#1#123#61#80;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits32,ot_none);
+    code    : #219#232#248#1#123#61#80;
     flags   : [if_avx512,if_t1s]
     flags   : [if_avx512,if_t1s]
   ),
   ),
   (
   (
     opcode  : A_VCVTUSI2SS;
     opcode  : A_VCVTUSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_rm_gpr or ot_bits32,ot_none);
-    code    : #219#232#248#1#123#61#80;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
+    code    : #219#232#234#248#1#123#61#80;
     flags   : [if_avx512,if_t1s]
     flags   : [if_avx512,if_t1s]
   ),
   ),
   (
   (
@@ -29203,5 +29147,54 @@
     optypes : (ot_kreg_m,ot_zmmreg,ot_zmmrm,ot_none);
     optypes : (ot_kreg_m,ot_zmmreg,ot_zmmrm,ot_none);
     code    : #232#233#241#249#1#143#61#80;
     code    : #232#233#241#249#1#143#61#80;
     flags   : [if_avx512,if_tfvm]
     flags   : [if_avx512,if_tfvm]
+  ),
+  (
+    opcode  : A_SHA1RNDS4;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_immediate,ot_none);
+    code    : #3#15#58#204#72#22;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA1NEXTE;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#200#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA1MSG1;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#201#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA1MSG2;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#12#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA256RNDS2;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#203#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA256MSG1;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#204#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA256MSG2;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#205#72;
+    flags   : [if_sha]
   )
   )
 );
 );

+ 18 - 4
compiler/i386/n386add.pas

@@ -168,6 +168,9 @@ interface
         { at this point, left.location.loc should be LOC_REGISTER }
         { at this point, left.location.loc should be LOC_REGISTER }
         if right.location.loc=LOC_REGISTER then
         if right.location.loc=LOC_REGISTER then
          begin
          begin
+           if mboverflow and needoverflowcheck then
+             cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
+
            { when swapped another result register }
            { when swapped another result register }
            if (nodetype=subn) and (nf_swapped in flags) then
            if (nodetype=subn) and (nf_swapped in flags) then
             begin
             begin
@@ -197,11 +200,18 @@ interface
               cg64.a_load64high_loc_reg(current_asmdata.CurrAsmList,right.location,r);
               cg64.a_load64high_loc_reg(current_asmdata.CurrAsmList,right.location,r);
               { the carry flag is still ok }
               { the carry flag is still ok }
               emit_reg_reg(op2,opsize,left.location.register64.reghi,r);
               emit_reg_reg(op2,opsize,left.location.register64.reghi,r);
-              cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
+
+              { We need to keep the FLAGS register allocated for overflow checks }
+              if not mboverflow or not needoverflowcheck then
+                cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
+
               emit_reg_reg(A_MOV,opsize,r,left.location.register64.reghi);
               emit_reg_reg(A_MOV,opsize,r,left.location.register64.reghi);
             end
             end
            else
            else
             begin
             begin
+              if mboverflow and needoverflowcheck then
+                cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
+
               cg64.a_op64_loc_reg(current_asmdata.CurrAsmList,op,location.size,right.location,
               cg64.a_op64_loc_reg(current_asmdata.CurrAsmList,op,location.size,right.location,
                 left.location.register64);
                 left.location.register64);
             end;
             end;
@@ -221,6 +231,8 @@ interface
                 cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4)
                 cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4)
               else
               else
                 cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NO,hl4);
                 cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NO,hl4);
+
+              cg.a_reg_dealloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS);
               cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false);
               cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false);
               cg.a_label(current_asmdata.CurrAsmList,hl4);
               cg.a_label(current_asmdata.CurrAsmList,hl4);
             end;
             end;
@@ -244,9 +256,6 @@ interface
            oldnodetype : tnodetype;
            oldnodetype : tnodetype;
 
 
         begin
         begin
-{$ifdef OLDREGVARS}
-           load_all_regvars(current_asmdata.CurrAsmList);
-{$endif OLDREGVARS}
            { the jump the sequence is a little bit hairy }
            { the jump the sequence is a little bit hairy }
            case nodetype of
            case nodetype of
               ltn,gtn:
               ltn,gtn:
@@ -511,6 +520,10 @@ interface
           hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,right.resultdef,osuinttype,right.location,NR_EAX);
           hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,right.resultdef,osuinttype,right.location,NR_EAX);
           { Also allocate EDX, since it is also modified by a mul (JM). }
           { Also allocate EDX, since it is also modified by a mul (JM). }
           cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
           cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
+
+          if needoverflowcheck then
+            cg.a_reg_alloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS);
+
           if use_ref then
           if use_ref then
             emit_ref(asmops[unsigned],S_L,ref)
             emit_ref(asmops[unsigned],S_L,ref)
           else
           else
@@ -521,6 +534,7 @@ interface
             begin
             begin
               current_asmdata.getjumplabel(hl4);
               current_asmdata.getjumplabel(hl4);
               cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4);
               cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4);
+              cg.a_reg_dealloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS);
               cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false);
               cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false);
               cg.a_label(current_asmdata.CurrAsmList,hl4);
               cg.a_label(current_asmdata.CurrAsmList,hl4);
             end;
             end;

+ 0 - 2
compiler/i8086/cpuinfo.pas

@@ -30,9 +30,7 @@ Interface
 
 
 Type
 Type
    bestreal = extended;
    bestreal = extended;
-{$if FPC_FULLVERSION>20700}
    bestrealrec = TExtended80Rec;
    bestrealrec = TExtended80Rec;
-{$endif FPC_FULLVERSION>20700}
    ts32real = single;
    ts32real = single;
    ts64real = double;
    ts64real = double;
    ts80real = extended;
    ts80real = extended;

+ 2 - 2
compiler/i8086/cpupara.pas

@@ -235,8 +235,8 @@ unit cpupara;
 
 
     function tcpuparamanager.get_saved_registers_int(calloption : tproccalloption):tcpuregisterarray;
     function tcpuparamanager.get_saved_registers_int(calloption : tproccalloption):tcpuregisterarray;
       const
       const
-        saveregs_cdecl: {$ifndef VER3_0}tcpuregisterarray{$else}array [0..2] of tsuperregister{$endif} = (RS_BP,RS_SI,RS_DI);
-        saveregs_pascal: {$ifndef VER3_0}tcpuregisterarray{$else}array [0..0] of tsuperregister{$endif} = (RS_BP);
+        saveregs_cdecl: tcpuregisterarray = (RS_BP,RS_SI,RS_DI);
+        saveregs_pascal: tcpuregisterarray = (RS_BP);
       begin
       begin
         case calloption of
         case calloption of
           pocall_register,
           pocall_register,

+ 8 - 1
compiler/i8086/i8086att.inc

@@ -1449,5 +1449,12 @@
 'vpshrdvq',
 'vpshrdvq',
 'vpshrdvw',
 'vpshrdvw',
 'vpshrdw',
 'vpshrdw',
-'vpshufbitqmb'
+'vpshufbitqmb',
+'sha1rnds4',
+'sha1nexte',
+'sha1msg1',
+'sha1msg2',
+'sha256rnds2',
+'sha256msg1',
+'sha256msg2'
 );
 );

+ 19 - 12
compiler/i8086/i8086atts.inc

@@ -424,10 +424,10 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -539,14 +539,14 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
 attsufNONE,
 attsufNONE,
-attsufINT,
+attsufNONE,
+attsufMMS,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -789,8 +789,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufMMS,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufMMX,
 attsufMMX,
@@ -1236,8 +1236,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufMMX,
 attsufMMX,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufMMS,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1255,8 +1255,15 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufMMS,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,

+ 8 - 1
compiler/i8086/i8086int.inc

@@ -1449,5 +1449,12 @@
 'vpshrdvq',
 'vpshrdvq',
 'vpshrdvw',
 'vpshrdvw',
 'vpshrdw',
 'vpshrdw',
-'vpshufbitqmb'
+'vpshufbitqmb',
+'sha1rnds4',
+'sha1nexte',
+'sha1msg1',
+'sha1msg2',
+'sha256rnds2',
+'sha256msg1',
+'sha256msg2'
 );
 );

+ 1 - 1
compiler/i8086/i8086nop.inc

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

+ 8 - 1
compiler/i8086/i8086op.inc

@@ -1449,5 +1449,12 @@ A_VPSHRDVD,
 A_VPSHRDVQ,
 A_VPSHRDVQ,
 A_VPSHRDVW,
 A_VPSHRDVW,
 A_VPSHRDW,
 A_VPSHRDW,
-A_VPSHUFBITQMB
+A_VPSHUFBITQMB,
+A_SHA1RNDS4,
+A_SHA1NEXTE,
+A_SHA1MSG1,
+A_SHA1MSG2,
+A_SHA256RNDS2,
+A_SHA256MSG1,
+A_SHA256MSG2
 );
 );

+ 14 - 7
compiler/i8086/i8086prop.inc

@@ -169,7 +169,7 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_RWESP, Ch_WEBP]),
+(Ch: [Ch_RWESP, Ch_RWEBP]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: []),
 (Ch: []),
@@ -666,17 +666,17 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
-(Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2]),
+(Ch: [Ch_Wop3, Ch_Rop2]),
+(Ch: [Ch_Wop3, Ch_Rop2]),
+(Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Mop1, Ch_Rop2]),
 (Ch: [Ch_Mop1, Ch_Rop2]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
@@ -1449,5 +1449,12 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
-(Ch: [Ch_All])
+(Ch: [Ch_All]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1, Ch_RXMM0]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1])
 );
 );

+ 102 - 109
compiler/i8086/i8086tab.inc

@@ -10559,7 +10559,7 @@
   (
   (
     opcode  : A_VCVTPD2DQ;
     opcode  : A_VCVTPD2DQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #220#232#233#234#248#1#230#72;
     code    : #220#232#233#234#248#1#230#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -10570,13 +10570,6 @@
     code    : #220#232#233#234#248#1#230#72;
     code    : #220#232#233#234#248#1#230#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTPD2DQ;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #220#232#233#234#248#1#230#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTPD2PS;
     opcode  : A_VCVTPD2PS;
     ops     : 2;
     ops     : 2;
@@ -10615,7 +10608,7 @@
   (
   (
     opcode  : A_VCVTPD2PS;
     opcode  : A_VCVTPD2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #232#233#234#241#248#1#90#72;
     code    : #232#233#234#241#248#1#90#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -10626,13 +10619,6 @@
     code    : #232#233#234#241#248#1#90#72;
     code    : #232#233#234#241#248#1#90#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTPD2PS;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #232#233#234#241#248#1#90#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTPH2PS;
     opcode  : A_VCVTPH2PS;
     ops     : 2;
     ops     : 2;
@@ -10867,30 +10853,44 @@
   (
   (
     opcode  : A_VCVTSI2SD;
     opcode  : A_VCVTSI2SD;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
     code    : #220#232#242#248#1#42#61#80;
     code    : #220#232#242#248#1#42#61#80;
-    flags   : [if_avx,if_sandybridge,if_sd]
+    flags   : [if_avx,if_sandybridge]
   ),
   ),
   (
   (
     opcode  : A_VCVTSI2SD;
     opcode  : A_VCVTSI2SD;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg,ot_memory or ot_bits32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits32,ot_none);
     code    : #220#232#242#248#1#42#61#80;
     code    : #220#232#242#248#1#42#61#80;
-    flags   : [if_avx,if_sandybridge,if_sd,if_t1s]
+    flags   : [if_avx,if_sandybridge,if_t1s]
+  ),
+  (
+    opcode  : A_VCVTSI2SD;
+    ops     : 3;
+    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_t1s]
   ),
   ),
   (
   (
     opcode  : A_VCVTSI2SS;
     opcode  : A_VCVTSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg,ot_reg32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
     code    : #219#232#242#248#1#42#61#80;
     code    : #219#232#242#248#1#42#61#80;
-    flags   : [if_avx,if_sandybridge,if_sd]
+    flags   : [if_avx,if_sandybridge]
   ),
   ),
   (
   (
     opcode  : A_VCVTSI2SS;
     opcode  : A_VCVTSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg,ot_memory or ot_bits32,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits32,ot_none);
     code    : #219#232#242#248#1#42#61#80;
     code    : #219#232#242#248#1#42#61#80;
-    flags   : [if_avx,if_sandybridge,if_sd,if_t1s]
+    flags   : [if_avx,if_sandybridge,if_t1s]
+  ),
+  (
+    opcode  : A_VCVTSI2SS;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
+    code    : #219#232#234#242#243#248#1#42#61#80;
+    flags   : [if_avx,if_sandybridge,if_t1s]
   ),
   ),
   (
   (
     opcode  : A_VCVTSS2SD;
     opcode  : A_VCVTSS2SD;
@@ -10972,7 +10972,7 @@
   (
   (
     opcode  : A_VCVTTPD2DQ;
     opcode  : A_VCVTTPD2DQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_sae,ot_none,ot_none);
     code    : #232#233#234#241#248#1#230#72;
     code    : #232#233#234#241#248#1#230#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -10983,13 +10983,6 @@
     code    : #232#233#234#241#248#1#230#72;
     code    : #232#233#234#241#248#1#230#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTTPD2DQ;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_sae,ot_none,ot_none);
-    code    : #232#233#234#241#248#1#230#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTTPS2DQ;
     opcode  : A_VCVTTPS2DQ;
     ops     : 2;
     ops     : 2;
@@ -21525,13 +21518,6 @@
     code    : #232#233#234#241#248#1#123#72;
     code    : #232#233#234#241#248#1#123#72;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
-  (
-    opcode  : A_VCVTPD2UDQ;
-    ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
-    code    : #232#234#248#1#121#72;
-    flags   : [if_avx512,if_tfv]
-  ),
   (
   (
     opcode  : A_VCVTPD2UDQ;
     opcode  : A_VCVTPD2UDQ;
     ops     : 2;
     ops     : 2;
@@ -21542,9 +21528,9 @@
   (
   (
     opcode  : A_VCVTPD2UDQ;
     opcode  : A_VCVTPD2UDQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_none,ot_none);
     code    : #232#234#248#1#121#72;
     code    : #232#234#248#1#121#72;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_tfv]
   ),
   ),
   (
   (
     opcode  : A_VCVTPD2UDQ;
     opcode  : A_VCVTPD2UDQ;
@@ -21570,7 +21556,7 @@
   (
   (
     opcode  : A_VCVTPD2UDQ;
     opcode  : A_VCVTPD2UDQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #232#233#234#248#1#121#72;
     code    : #232#233#234#248#1#121#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -21581,13 +21567,6 @@
     code    : #232#233#234#248#1#121#72;
     code    : #232#233#234#248#1#121#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTPD2UDQ;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #232#233#234#248#1#121#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTPD2UQQ;
     opcode  : A_VCVTPD2UQQ;
     ops     : 2;
     ops     : 2;
@@ -21847,13 +21826,6 @@
     code    : #219#232#233#234#248#1#230#72;
     code    : #219#232#233#234#248#1#230#72;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
-  (
-    opcode  : A_VCVTQQ2PS;
-    ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
-    code    : #232#234#248#1#91#72;
-    flags   : [if_avx512,if_tfv]
-  ),
   (
   (
     opcode  : A_VCVTQQ2PS;
     opcode  : A_VCVTQQ2PS;
     ops     : 2;
     ops     : 2;
@@ -21864,9 +21836,9 @@
   (
   (
     opcode  : A_VCVTQQ2PS;
     opcode  : A_VCVTQQ2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_none,ot_none);
     code    : #232#234#248#1#91#72;
     code    : #232#234#248#1#91#72;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_tfv]
   ),
   ),
   (
   (
     opcode  : A_VCVTQQ2PS;
     opcode  : A_VCVTQQ2PS;
@@ -21892,7 +21864,7 @@
   (
   (
     opcode  : A_VCVTQQ2PS;
     opcode  : A_VCVTQQ2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #232#233#234#248#1#91#72;
     code    : #232#233#234#248#1#91#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -21903,13 +21875,6 @@
     code    : #232#233#234#248#1#91#72;
     code    : #232#233#234#248#1#91#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTQQ2PS;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #232#233#234#248#1#91#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTSD2USI;
     opcode  : A_VCVTSD2USI;
     ops     : 2;
     ops     : 2;
@@ -22015,13 +21980,6 @@
     code    : #232#233#234#241#248#1#122#72;
     code    : #232#233#234#241#248#1#122#72;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
-  (
-    opcode  : A_VCVTTPD2UDQ;
-    ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
-    code    : #232#234#248#1#120#72;
-    flags   : [if_avx512,if_tfv]
-  ),
   (
   (
     opcode  : A_VCVTTPD2UDQ;
     opcode  : A_VCVTTPD2UDQ;
     ops     : 2;
     ops     : 2;
@@ -22032,9 +21990,9 @@
   (
   (
     opcode  : A_VCVTTPD2UDQ;
     opcode  : A_VCVTTPD2UDQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_none,ot_none);
     code    : #232#234#248#1#120#72;
     code    : #232#234#248#1#120#72;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_tfv]
   ),
   ),
   (
   (
     opcode  : A_VCVTTPD2UDQ;
     opcode  : A_VCVTTPD2UDQ;
@@ -22060,7 +22018,7 @@
   (
   (
     opcode  : A_VCVTTPD2UDQ;
     opcode  : A_VCVTTPD2UDQ;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_sae,ot_none,ot_none);
     code    : #232#233#234#248#1#120#72;
     code    : #232#233#234#248#1#120#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -22071,13 +22029,6 @@
     code    : #232#233#234#248#1#120#72;
     code    : #232#233#234#248#1#120#72;
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
-  (
-    opcode  : A_VCVTTPD2UDQ;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_sae,ot_none,ot_none);
-    code    : #232#233#234#248#1#120#72;
-    flags   : [if_avx512]
-  ),
   (
   (
     opcode  : A_VCVTTPD2UQQ;
     opcode  : A_VCVTTPD2UQQ;
     ops     : 2;
     ops     : 2;
@@ -22498,13 +22449,6 @@
     code    : #219#232#233#234#248#1#122#72;
     code    : #219#232#233#234#248#1#122#72;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
-  (
-    opcode  : A_VCVTUQQ2PS;
-    ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_memory or ot_bits128,ot_none,ot_none);
-    code    : #220#232#234#248#1#122#72;
-    flags   : [if_avx512,if_tfv]
-  ),
   (
   (
     opcode  : A_VCVTUQQ2PS;
     opcode  : A_VCVTUQQ2PS;
     ops     : 2;
     ops     : 2;
@@ -22515,9 +22459,9 @@
   (
   (
     opcode  : A_VCVTUQQ2PS;
     opcode  : A_VCVTUQQ2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_xmmreg_mz,ot_xmmreg,ot_none,ot_none);
+    optypes : (ot_xmmreg_mz,ot_xmmrm,ot_none,ot_none);
     code    : #220#232#234#248#1#122#72;
     code    : #220#232#234#248#1#122#72;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_tfv]
   ),
   ),
   (
   (
     opcode  : A_VCVTUQQ2PS;
     opcode  : A_VCVTUQQ2PS;
@@ -22543,7 +22487,7 @@
   (
   (
     opcode  : A_VCVTUQQ2PS;
     opcode  : A_VCVTUQQ2PS;
     ops     : 2;
     ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_memory or ot_bits512,ot_none,ot_none);
+    optypes : (ot_ymmreg_mz,ot_zmmrm_er,ot_none,ot_none);
     code    : #220#232#233#234#248#1#122#72;
     code    : #220#232#233#234#248#1#122#72;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
@@ -22555,45 +22499,45 @@
     flags   : [if_avx512,if_bcst8,if_tfv]
     flags   : [if_avx512,if_bcst8,if_tfv]
   ),
   ),
   (
   (
-    opcode  : A_VCVTUQQ2PS;
-    ops     : 2;
-    optypes : (ot_ymmreg_mz,ot_zmmreg_er,ot_none,ot_none);
-    code    : #220#232#233#234#248#1#122#72;
+    opcode  : A_VCVTUSI2SD;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    code    : #220#232#248#1#123#61#80;
     flags   : [if_avx512]
     flags   : [if_avx512]
   ),
   ),
   (
   (
     opcode  : A_VCVTUSI2SD;
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
-    code    : #220#232#234#248#1#123#61#80;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits32,ot_none);
+    code    : #220#232#248#1#123#61#80;
     flags   : [if_avx512,if_t1s]
     flags   : [if_avx512,if_t1s]
   ),
   ),
   (
   (
     opcode  : A_VCVTUSI2SD;
     opcode  : A_VCVTUSI2SD;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg64,ot_none);
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
     code    : #220#232#234#248#1#123#61#80;
     code    : #220#232#234#248#1#123#61#80;
-    flags   : [if_avx512]
+    flags   : [if_avx512,if_t1s]
   ),
   ),
   (
   (
-    opcode  : A_VCVTUSI2SD;
+    opcode  : A_VCVTUSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_rm_gpr or ot_bits32,ot_none);
-    code    : #220#232#248#1#123#61#80;
-    flags   : [if_avx512,if_t1s]
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_reg32,ot_none);
+    code    : #219#232#248#1#123#61#80;
+    flags   : [if_avx512]
   ),
   ),
   (
   (
     opcode  : A_VCVTUSI2SS;
     opcode  : A_VCVTUSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_rm_gpr or ot_bits64,ot_none);
-    code    : #219#232#234#248#1#123#61#80;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits32,ot_none);
+    code    : #219#232#248#1#123#61#80;
     flags   : [if_avx512,if_t1s]
     flags   : [if_avx512,if_t1s]
   ),
   ),
   (
   (
     opcode  : A_VCVTUSI2SS;
     opcode  : A_VCVTUSI2SS;
     ops     : 3;
     ops     : 3;
-    optypes : (ot_xmmreg,ot_xmmreg_er,ot_rm_gpr or ot_bits32,ot_none);
-    code    : #219#232#248#1#123#61#80;
+    optypes : (ot_xmmreg,ot_xmmreg_er,ot_memory or ot_bits64,ot_none);
+    code    : #219#232#234#248#1#123#61#80;
     flags   : [if_avx512,if_t1s]
     flags   : [if_avx512,if_t1s]
   ),
   ),
   (
   (
@@ -29427,5 +29371,54 @@
     optypes : (ot_kreg_m,ot_zmmreg,ot_zmmrm,ot_none);
     optypes : (ot_kreg_m,ot_zmmreg,ot_zmmrm,ot_none);
     code    : #232#233#241#249#1#143#61#80;
     code    : #232#233#241#249#1#143#61#80;
     flags   : [if_avx512,if_tfvm]
     flags   : [if_avx512,if_tfvm]
+  ),
+  (
+    opcode  : A_SHA1RNDS4;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_immediate,ot_none);
+    code    : #3#15#58#204#72#22;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA1NEXTE;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#200#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA1MSG1;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#201#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA1MSG2;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#12#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA256RNDS2;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#203#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA256MSG1;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#204#72;
+    flags   : [if_sha]
+  ),
+  (
+    opcode  : A_SHA256MSG2;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #3#15#56#205#72;
+    flags   : [if_sha]
   )
   )
 );
 );

+ 11 - 9
compiler/i8086/n8086add.pas

@@ -264,6 +264,9 @@ interface
             end;
             end;
          end;
          end;
 
 
+        if mboverflow and needoverflowcheck then
+          cg.a_reg_alloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS);
+
         { at this point, left.location.loc should be LOC_REGISTER }
         { at this point, left.location.loc should be LOC_REGISTER }
         if right.location.loc=LOC_REGISTER then
         if right.location.loc=LOC_REGISTER then
          begin
          begin
@@ -322,6 +325,7 @@ interface
                 cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4)
                 cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4)
               else
               else
                 cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NO,hl4);
                 cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NO,hl4);
+              cg.a_reg_dealloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS);
               cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false);
               cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false);
               cg.a_label(current_asmdata.CurrAsmList,hl4);
               cg.a_label(current_asmdata.CurrAsmList,hl4);
             end;
             end;
@@ -548,9 +552,6 @@ interface
            oldnodetype : tnodetype;
            oldnodetype : tnodetype;
 
 
         begin
         begin
-{$ifdef OLDREGVARS}
-           load_all_regvars(current_asmdata.CurrAsmList);
-{$endif OLDREGVARS}
            { the jump the sequence is a little bit hairy }
            { the jump the sequence is a little bit hairy }
            case nodetype of
            case nodetype of
               ltn,gtn:
               ltn,gtn:
@@ -592,9 +593,6 @@ interface
            oldnodetype : tnodetype;
            oldnodetype : tnodetype;
 
 
         begin
         begin
-{$ifdef OLDREGVARS}
-           load_all_regvars(current_asmdata.CurrAsmList);
-{$endif OLDREGVARS}
            { the jump the sequence is a little bit hairy }
            { the jump the sequence is a little bit hairy }
            case nodetype of
            case nodetype of
               ltn,gtn:
               ltn,gtn:
@@ -775,9 +773,6 @@ interface
            oldnodetype : tnodetype;
            oldnodetype : tnodetype;
 
 
         begin
         begin
-{$ifdef OLDREGVARS}
-           load_all_regvars(current_asmdata.CurrAsmList);
-{$endif OLDREGVARS}
            { the jump the sequence is a little bit hairy }
            { the jump the sequence is a little bit hairy }
            case nodetype of
            case nodetype of
               ltn,gtn:
               ltn,gtn:
@@ -1047,6 +1042,12 @@ interface
       hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,right.resultdef,osuinttype,right.location,NR_AX);
       hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,right.resultdef,osuinttype,right.location,NR_AX);
       {Also allocate DX, since it is also modified by a mul (JM).}
       {Also allocate DX, since it is also modified by a mul (JM).}
       cg.getcpuregister(current_asmdata.CurrAsmList,NR_DX);
       cg.getcpuregister(current_asmdata.CurrAsmList,NR_DX);
+
+      if overflowcheck and
+        { 16->32 bit cannot overflow }
+        (not is_32bitint(resultdef)) then
+        cg.a_reg_alloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS);
+
       if use_ref then
       if use_ref then
         emit_ref(asmops[unsigned],S_W,ref)
         emit_ref(asmops[unsigned],S_W,ref)
       else
       else
@@ -1057,6 +1058,7 @@ interface
         begin
         begin
           current_asmdata.getjumplabel(hl4);
           current_asmdata.getjumplabel(hl4);
           cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4);
           cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4);
+          cg.a_reg_dealloc(current_asmdata.CurrAsmList, NR_DEFAULTFLAGS);
           cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false);
           cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false);
           cg.a_label(current_asmdata.CurrAsmList,hl4);
           cg.a_label(current_asmdata.CurrAsmList,hl4);
         end;
         end;

+ 4 - 0
compiler/jvm/cpubase.pas

@@ -247,6 +247,10 @@ uses
       NR_FPU_RESULT_REG = NR_NO;
       NR_FPU_RESULT_REG = NR_NO;
       NR_MM_RESULT_REG = NR_NO;
       NR_MM_RESULT_REG = NR_NO;
 
 
+      { No default flags }
+      NR_DEFAULTFLAGS = NR_NO;
+      RS_DEFAULTFLAGS = RS_NO;
+
 
 
 {*****************************************************************************
 {*****************************************************************************
                        GCC /ABI linking information
                        GCC /ABI linking information

+ 0 - 2
compiler/jvm/cpuinfo.pas

@@ -23,9 +23,7 @@ Interface
 
 
 Type
 Type
    bestreal = double;
    bestreal = double;
-{$if FPC_FULLVERSION>20700}
    bestrealrec = TDoubleRec;
    bestrealrec = TDoubleRec;
-{$endif FPC_FULLVERSION>20700}
    ts32real = single;
    ts32real = single;
    ts64real = double;
    ts64real = double;
    ts80real = extended;
    ts80real = extended;

+ 1 - 1
compiler/jvm/cpupara.pas

@@ -75,7 +75,7 @@ implementation
     function tcpuparamanager.get_saved_registers_int(calloption: tproccalloption): tcpuregisterarray;
     function tcpuparamanager.get_saved_registers_int(calloption: tproccalloption): tcpuregisterarray;
       const
       const
         { dummy, not used for JVM }
         { dummy, not used for JVM }
-        saved_regs: {$ifndef VER3_0}tcpuregisterarray{$else}array [0..0] of tsuperregister{$endif} = (RS_NO);
+        saved_regs: tcpuregisterarray = (RS_NO);
       begin
       begin
         result:=saved_regs;
         result:=saved_regs;
       end;
       end;

+ 112 - 2
compiler/link.pas

@@ -24,6 +24,8 @@ unit link;
 
 
 {$i fpcdefs.inc}
 {$i fpcdefs.inc}
 
 
+{ $define DEBUG_MACHO_INFO}
+
 interface
 interface
 
 
     uses
     uses
@@ -93,9 +95,10 @@ interface
          Function UniqueName(const str:TCmdStr): TCmdStr;
          Function UniqueName(const str:TCmdStr): TCmdStr;
 
 
          function PostProcessELFExecutable(const fn: string; isdll: boolean): boolean;
          function PostProcessELFExecutable(const fn: string; isdll: boolean): boolean;
+         function PostProcessMachExecutable(const fn: string; isdll: boolean): boolean;
        end;
        end;
 
 
-      TBooleanArray = array [1..1024] of boolean;
+      TBooleanArray = array [1..100000] of boolean;
       PBooleanArray = ^TBooleanArray;
       PBooleanArray = ^TBooleanArray;
 
 
       TInternalLinker = class(TLinker)
       TInternalLinker = class(TLinker)
@@ -170,7 +173,7 @@ Implementation
 {$ifdef hasUnix}
 {$ifdef hasUnix}
       baseunix,
       baseunix,
 {$endif hasUnix}
 {$endif hasUnix}
-      cscript,globals,verbose,comphook,ppu,fpccrc,
+      cscript,globals,verbose,comphook,ppu,fpchash,
       aasmbase,aasmcpu,
       aasmbase,aasmcpu,
       ogmap;
       ogmap;
 
 
@@ -1282,6 +1285,113 @@ Implementation
           ;
           ;
         Result:=true;
         Result:=true;
       end;
       end;
+
+
+    function TExternalLinker.PostProcessMachExecutable(const fn : string;isdll:boolean):boolean;
+      type
+        TMachHeader=record
+          magic       : longword;
+          cputype     : integer;
+          cpusubtype  : integer;
+          filetype    : longword;
+          ncmds       : longword;
+          sizeofcmds  : longword;
+          flags       : longword;
+          reserved    : longword;
+        end;
+
+        TMachLoadCommand = record
+          cmd : longword;
+          cmdsize : longword;
+        end;
+
+        TMachSegmentCommand64 = record
+          segname  : array[0..15] of char;
+          vmaddr   : qword;
+          vmsize   : qword;
+          fileoff  : qword;
+          filesize : qword;
+          maxprot  : integer;
+          initprot : integer;
+          nsects   : dword;
+          flags    : dword;
+        end;
+
+      var
+        f : file;
+        machheader : TMachHeader;
+        machloadcmd : TMachLoadCommand;
+        machsegmentcommand64 :TMachSegmentCommand64;
+        i : longint;
+      begin
+        Result:=false;
+        { open file }
+        assign(f,fn);
+        {$push}{$I-}
+        reset(f,1);
+        if ioresult<>0 then
+          Message1(execinfo_f_cant_open_executable,fn);
+
+{$ifdef DEBUG_MACHO_INFO}
+        writeln('Start reading Mach-O file');
+{$endif DEBUG_MACHO_INFO}
+        blockread(f,machheader,sizeof(TMachHeader));
+        if machheader.magic<>$feedfacf then
+          Exit;
+
+{$ifdef DEBUG_MACHO_INFO}
+        writeln('Magic header recognized (64 Bit, Little Endian)');
+        writeln('Reading ',machheader.ncmds,' commands');
+{$endif DEBUG_MACHO_INFO}
+
+        for i:=1 to machheader.ncmds do
+          begin
+            blockread(f,machloadcmd,sizeof(machloadcmd));
+            case machloadcmd.cmd of
+              $19:
+                begin
+                  blockread(f,machsegmentcommand64,sizeof(machsegmentcommand64));
+{$ifdef DEBUG_MACHO_INFO}
+                  writeln('Found SegmentCommand64: Name = ',StrPas(@machsegmentcommand64.segname),
+                    '; VMSize = $',hexstr(machsegmentcommand64.vmsize,8),
+                    '; FileSize = $',hexstr(machsegmentcommand64.filesize,8));
+{$endif DEBUG_MACHO_INFO}
+                  case StrPas(@machsegmentcommand64.segname) of
+                    '__TEXT':
+                      begin
+                        Message1(execinfo_x_codesize,tostr(machsegmentcommand64.vmsize));
+                        status.codesize:=machsegmentcommand64.vmsize;
+                      end;
+                    '__DATA_CONST':
+                      begin
+                        Message1(execinfo_x_initdatasize,tostr(machsegmentcommand64.vmsize));
+                        inc(status.datasize,machsegmentcommand64.vmsize);
+                      end;
+                    '__DATA':
+                      begin
+                        Message1(execinfo_x_uninitdatasize,tostr(machsegmentcommand64.vmsize));
+                        inc(status.datasize,machsegmentcommand64.vmsize);
+                      end;
+                  end;
+                  Seek(f,FilePos(f)+machloadcmd.cmdsize-sizeof(machloadcmd)-sizeof(machsegmentcommand64));
+                end;
+              else
+                begin
+{$ifdef DEBUG_MACHO_INFO}
+                  writeln('Found Load Command: $',hexstr(machloadcmd.cmd,4),', skipping');
+{$endif DEBUG_MACHO_INFO}
+                  Seek(f,FilePos(f)+machloadcmd.cmdsize-sizeof(machloadcmd));
+                end;
+            end;
+          end;
+        close(f);
+        {$pop}
+        if ioresult<>0 then
+          ;
+        Result:=true;
+      end;
+
+
 {*****************************************************************************
 {*****************************************************************************
                               TINTERNALLINKER
                               TINTERNALLINKER
 *****************************************************************************}
 *****************************************************************************}

+ 0 - 2
compiler/m68k/cpuinfo.pas

@@ -23,9 +23,7 @@ Interface
 
 
 Type
 Type
    bestreal = double;
    bestreal = double;
-{$if FPC_FULLVERSION>20700}
    bestrealrec = TDoubleRec;
    bestrealrec = TDoubleRec;
-{$endif FPC_FULLVERSION>20700}
    ts32real = single;
    ts32real = single;
    ts64real = double;
    ts64real = double;
    ts80real = extended;
    ts80real = extended;

+ 3 - 3
compiler/m68k/cpupara.pas

@@ -106,21 +106,21 @@ unit cpupara;
 
 
     function tcpuparamanager.get_saved_registers_int(calloption:tproccalloption):tcpuregisterarray;
     function tcpuparamanager.get_saved_registers_int(calloption:tproccalloption):tcpuregisterarray;
       const
       const
-        saved_regs: {$ifndef VER3_0}tcpuregisterarray{$else}array[0..5] of tsuperregister{$endif} = (RS_D2,RS_D3,RS_D4,RS_D5,RS_D6,RS_D7);
+        saved_regs: tcpuregisterarray = (RS_D2,RS_D3,RS_D4,RS_D5,RS_D6,RS_D7);
       begin
       begin
         result:=saved_regs;
         result:=saved_regs;
       end;
       end;
 
 
     function tcpuparamanager.get_saved_registers_address(calloption:tproccalloption):tcpuregisterarray;
     function tcpuparamanager.get_saved_registers_address(calloption:tproccalloption):tcpuregisterarray;
       const
       const
-        saved_addr_regs: {$ifndef VER3_0}tcpuregisterarray{$else}array[0..4] of tsuperregister{$endif} = (RS_A2,RS_A3,RS_A4,RS_A5,RS_A6);
+        saved_addr_regs: tcpuregisterarray = (RS_A2,RS_A3,RS_A4,RS_A5,RS_A6);
       begin
       begin
         result:=saved_addr_regs;
         result:=saved_addr_regs;
       end;
       end;
 
 
     function tcpuparamanager.get_saved_registers_fpu(calloption:tproccalloption):tcpuregisterarray;
     function tcpuparamanager.get_saved_registers_fpu(calloption:tproccalloption):tcpuregisterarray;
       const
       const
-        saved_fpu_regs: {$ifndef VER3_0}tcpuregisterarray{$else}array[0..5] of tsuperregister{$endif} = (RS_FP2,RS_FP3,RS_FP4,RS_FP5,RS_FP6,RS_FP7);
+        saved_fpu_regs: tcpuregisterarray = (RS_FP2,RS_FP3,RS_FP4,RS_FP5,RS_FP6,RS_FP7);
       begin
       begin
         result:=saved_fpu_regs;
         result:=saved_fpu_regs;
       end;
       end;

+ 1 - 0
compiler/m68k/rgcpu.pas

@@ -146,6 +146,7 @@ unit rgcpu;
                 begin
                 begin
                   { source can be replaced if dest is register... }
                   { source can be replaced if dest is register... }
                   if ((instr.oper[1]^.typ=top_reg) and
                   if ((instr.oper[1]^.typ=top_reg) and
+                      (getregtype(instr.oper[1]^.reg)=regtype) and
                       (get_alias(getsupreg(instr.oper[1]^.reg))<>orgreg) and
                       (get_alias(getsupreg(instr.oper[1]^.reg))<>orgreg) and
                      ((instr.opcode=A_MOVE) or (instr.opcode=A_ADD) or (instr.opcode=A_SUB) or
                      ((instr.opcode=A_MOVE) or (instr.opcode=A_ADD) or (instr.opcode=A_SUB) or
                       (instr.opcode=A_AND) or (instr.opcode=A_OR) or (instr.opcode=A_CMP))) or
                       (instr.opcode=A_AND) or (instr.opcode=A_OR) or (instr.opcode=A_CMP))) or

+ 0 - 2
compiler/mips/cpuinfo.pas

@@ -23,9 +23,7 @@ Interface
 
 
 Type
 Type
    bestreal = double;
    bestreal = double;
-{$if FPC_FULLVERSION>20700}
    bestrealrec = TDoubleRec;
    bestrealrec = TDoubleRec;
-{$endif FPC_FULLVERSION>20700}
    ts32real = single;
    ts32real = single;
    ts64real = double;
    ts64real = double;
    ts80real = type double;
    ts80real = type double;

+ 1 - 1
compiler/mips/cpupara.pas

@@ -109,7 +109,7 @@ implementation
 
 
     function tcpuparamanager.get_saved_registers_int(calloption : tproccalloption):TCpuRegisterArray;
     function tcpuparamanager.get_saved_registers_int(calloption : tproccalloption):TCpuRegisterArray;
       const
       const
-        saved_regs : {$ifndef VER3_0}tcpuregisterarray{$else}array[0..0] of tsuperregister{$endif} =
+        saved_regs : tcpuregisterarray =
           (RS_NO);
           (RS_NO);
       begin
       begin
         result:=saved_regs;
         result:=saved_regs;

+ 2 - 2
compiler/mips/rgcpu.pas

@@ -150,7 +150,7 @@ implementation
             else
             else
               InternalError(2013061003);
               InternalError(2013061003);
           end;
           end;
-        if get_alias(getsupreg(instr.oper[1]^.reg))=orgreg then
+        if (getregtype(instr.oper[1]^.reg)=regtype) and  (get_alias(getsupreg(instr.oper[1]^.reg))=orgreg) then
           begin
           begin
             case instr.opcode of
             case instr.opcode of
               A_MOVE:  instr.opcode:=A_LW;
               A_MOVE:  instr.opcode:=A_LW;
@@ -160,7 +160,7 @@ implementation
               InternalError(2013061004);
               InternalError(2013061004);
             end;
             end;
           end
           end
-        else if get_alias(getsupreg(instr.oper[0]^.reg))=orgreg then
+        else if (getregtype(instr.oper[0]^.reg)=regtype) and  (get_alias(getsupreg(instr.oper[0]^.reg))=orgreg) then
           begin
           begin
             case instr.opcode of
             case instr.opcode of
               A_MOVE:  instr.opcode:=A_SW;
               A_MOVE:  instr.opcode:=A_SW;

+ 1 - 1
compiler/msg/errorct.msg

@@ -1510,7 +1510,7 @@ asmr_d_finish_reading=07001_DL_S'ha finalitzat l'analizaci
 asmr_e_none_label_contain_at=07002_E_Un patró que no és una etiqueta conté @
 asmr_e_none_label_contain_at=07002_E_Un patró que no és una etiqueta conté @
 % A identifier which isn't a label can't contain a @.
 % A identifier which isn't a label can't contain a @.
 asmr_e_building_record_offset=07004_E_S'ha produït un error mentre es muntava el desplaçament del registre
 asmr_e_building_record_offset=07004_E_S'ha produït un error mentre es muntava el desplaçament del registre
-% There has an error occured while building the offset of a record/object
+% An error occurred while building the offset of a record/object
 % structure, this can happend when there is no field specified at all or
 % structure, this can happend when there is no field specified at all or
 % an unknown field identifier is used.
 % an unknown field identifier is used.
 asmr_e_offset_without_identifier=07005_E_S'està utilitzant OFFSET sense identificador
 asmr_e_offset_without_identifier=07005_E_S'està utilitzant OFFSET sense identificador

+ 79 - 19
compiler/msg/errord.msg

@@ -3,7 +3,7 @@
 #   Latest updates contributed by Karl-Michael Schindler aka mischi
 #   Latest updates contributed by Karl-Michael Schindler aka mischi
 #   <karl-michael.schindler at web.de>
 #   <karl-michael.schindler at web.de>
 #
 #
-#   Based on errore.msg of SVN revision 45316
+#   Based on errore.msg of git commit ce1f9cce, 27 Jun, 2021
 #
 #
 #   This file is part of the Free Pascal Compiler
 #   This file is part of the Free Pascal Compiler
 #   Copyright (c) 1998-2021 by the Free Pascal Development team
 #   Copyright (c) 1998-2021 by the Free Pascal Development team
@@ -442,6 +442,7 @@ scan_w_setpeosversion_not_support=02103_W_SETPEOSVERSION wird vom Zielbetriebssy
 scan_w_setpesubsysversion_not_support=02104_W_SETPESUBSYSVERSION wird vom Zielbetriebssystem nicht unterst�tzt
 scan_w_setpesubsysversion_not_support=02104_W_SETPESUBSYSVERSION wird vom Zielbetriebssystem nicht unterst�tzt
 % The \var{\{\$SETPESUBSYSVERSION\}} directive is not supported by the target OS.
 % The \var{\{\$SETPESUBSYSVERSION\}} directive is not supported by the target OS.
 scan_n_changecputype=02105_N_Ge„nderter Prozessortyp muss zum angegebenen Controller passen
 scan_n_changecputype=02105_N_Ge„nderter Prozessortyp muss zum angegebenen Controller passen
+scan_e_emptymacroname=02106_E_Der Name einer macro/compiler-Variablen kann nicht leer sein
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -449,7 +450,7 @@ scan_n_changecputype=02105_N_Ge
 #
 #
 # Parser
 # Parser
 #
 #
-# 03355 is the last used one
+# 03360 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 %
 %
@@ -1091,8 +1092,9 @@ parser_e_paraloc_only_one_para=03197_E_Jedes Argument muss seine eigene "locatio
 parser_e_paraloc_all_paras=03198_E_Jedes Argument muss seine explizite "location" haben
 parser_e_paraloc_all_paras=03198_E_Jedes Argument muss seine explizite "location" haben
 % If one argument has an explicit argument location, all arguments of a procedure
 % If one argument has an explicit argument location, all arguments of a procedure
 % must have one.
 % must have one.
-parser_e_illegal_explicit_paraloc=03199_E_"location" des Arguments unbekannt
-% The location specified for an argument isn't recognized by the compiler.
+parser_e_illegal_explicit_paraloc=03199_E_Ung�ltiger expliziter Parameter "location" spezifiziert
+% Syscalls specific: the specified explicit location string for this parameter cannot be parsed, invalid,
+% or the location specified for an argument isn't recognized by the compiler.
 parser_e_32bitint_or_pointer_variable_expected=03200_E_32 Bit-Integer oder Zeiger-Variable erwartet
 parser_e_32bitint_or_pointer_variable_expected=03200_E_32 Bit-Integer oder Zeiger-Variable erwartet
 % The libbase for MorphOS/AmigaOS can be given only as \var{longint}, \var{dword} or any pointer variable.
 % The libbase for MorphOS/AmigaOS can be given only as \var{longint}, \var{dword} or any pointer variable.
 parser_e_goto_outside_proc=03201_E_Goto Statements zwischen verschiedenen Prozeduren sind nicht erlaubt
 parser_e_goto_outside_proc=03201_E_Goto Statements zwischen verschiedenen Prozeduren sind nicht erlaubt
@@ -1263,7 +1265,8 @@ parser_n_ignore_lower_visibility=03250_N_Die virtuelle Methode "$1" hat eine nie
 % The virtual method overrides an method that is declared with a higher visibility. This might give
 % The virtual method overrides an method that is declared with a higher visibility. This might give
 % unexpected results. E.g., in case the new visibility is private then a call to ``inherited'' in a
 % unexpected results. E.g., in case the new visibility is private then a call to ``inherited'' in a
 % new child class will call the higher-visible method in a parent class and ignores the private method.
 % new child class will call the higher-visible method in a parent class and ignores the private method.
-parser_e_field_not_allowed_here=03251_E_Felder sind nach der Definition einer Methode oder Eigenschaft nicht erlaubt. Beginne vorher eine neue Sichtbarkeitssektion
+parser_e_field_not_allowed_here=03251_E_Felder sind nach der Definition einer Methode oder Eigenschaft nicht erlaubt. Beginne vorher eine neue Sichtbarkeits
+
 % Once a method or property has been defined in a class or object, you cannot define any fields afterwards
 % Once a method or property has been defined in a class or object, you cannot define any fields afterwards
 % without starting a new visibility section (such as \var{public}, \var{private}, etc.). The reason is
 % without starting a new visibility section (such as \var{public}, \var{private}, etc.). The reason is
 % that otherwise the source code can appear ambiguous to the compiler, since it is possible to use modifiers
 % that otherwise the source code can appear ambiguous to the compiler, since it is possible to use modifiers
@@ -1569,7 +1572,7 @@ parser_w_ptr_type_ignored=03338_W_Zeigertyp "$1" ignoriert
 % The specified pointer type modifier is ignored, because it is not supported on
 % The specified pointer type modifier is ignored, because it is not supported on
 % the current platform. This happens, for example, when a far pointer is
 % the current platform. This happens, for example, when a far pointer is
 % declared on a non-x86 platform.
 % declared on a non-x86 platform.
-parser_e_global_generic_references_static=03339_E_Ein globales, generisches Templat referenziert eine statische Symboltabelle
+parser_e_global_generic_references_static=03339_E_Ein generisches Templat im Interface-Bereich referenziert ein Symbol des Implementation-Bereichs
 % A generic declared in the interface section of a unit must not reference symbols that belong
 % A generic declared in the interface section of a unit must not reference symbols that belong
 % solely to the implementation section of that unit.
 % solely to the implementation section of that unit.
 parser_u_already_compiled=03340_UL_Die Unit $1 wurde inzwischen bereits kompiliert.
 parser_u_already_compiled=03340_UL_Die Unit $1 wurde inzwischen bereits kompiliert.
@@ -1628,6 +1631,16 @@ parser_e_method_for_type_in_other_unit=03354_E_Implementierung einer Methods f
 parser_e_generic_constraints_not_allowed_here=03355_E_Eine generische Einschr„nkung ist hier nicht erlaubt
 parser_e_generic_constraints_not_allowed_here=03355_E_Eine generische Einschr„nkung ist hier nicht erlaubt
 % At the current location specifying a constraint is not allowed. For example
 % At the current location specifying a constraint is not allowed. For example
 % in delphi mode, a constraint might not be specified in the header of the implementation.
 % in delphi mode, a constraint might not be specified in the header of the implementation.
+parser_e_location_size_too_small=03356_E_Die explizite "location" ist zu klein f�r den Parameter
+% AmigaOS/MorphOS syscall specific: for int64/qword parameter only a single register location is specified
+parser_e_location_size_too_large=03357_E_Die GrӇe der expliziten "location" ist grӇer als vom Parameter verlangt
+% AmigaOS/MorphOS syscall specific: for a parameter which is smaller than 64bit, a register pair is specified
+parser_e_location_regpair_only_data=03358_E_Nur Daten-Register werden f�r explizite "location" Registerpaare unterst�tzt
+% AmigaOS/MorphOS syscall specific: for 64bit register pairs, only data registers are supported
+parser_e_location_regpair_only_consecutive=03359_E_Nur aufeinander folgende Register werden f�r explizite "location" Registerpaare unterst�tzt
+% MorphOS syscall specific: only consecutive (f.e.: d1-d2) registers are supported for 64bit register pairs
+parser_e_constructurs_cannot_take_type_parameters=03360_E_Konstruktoren k”nnen keine Type-Parameter �bernehmen
+% The use of type parameters in constructors is not allowed.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -1635,7 +1648,7 @@ parser_e_generic_constraints_not_allowed_here=03355_E_Eine generische Einschr
 #
 #
 # Type Checking
 # Type Checking
 #
 #
-# 04128 is the last used one
+# 04130 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 %
 %
@@ -2084,6 +2097,11 @@ type_e_forward_interface_type_does_not_match=04127_E_Der Interfacetyp der Vorw
 type_e_generic_const_type_not_allowed=04128_E_Typ ist f�r generische, konstante Parameter nicht erlaubt: $1
 type_e_generic_const_type_not_allowed=04128_E_Typ ist f�r generische, konstante Parameter nicht erlaubt: $1
 % Only types that can also be used (indirectly) for untyped constants can be used as a
 % Only types that can also be used (indirectly) for untyped constants can be used as a
 % type for a generic constant parameter.
 % type for a generic constant parameter.
+type_e_cant_read_write_type_in_iso_mode=04129_E_Kann Variablen diesen Typs im ISO-Modus nicht lesen oder schreiben
+% You are trying to \var{read} or \var{write} a variable from or to a
+% file of type text, which doesn't support that variable's type in the selected language mode (iso mode).
+type_w_array_size_does_not_match_size_of_constant_string=04130_W_Die L„nge der konstanten Zeichenkette (die L„nge ist $1) muss so groá wie die Anzahl der Array-Elemente sein ($2 Elemente)
+% ISO Pascal requires that string constants have the same length as the array to which them they are assigned.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2595,7 +2613,7 @@ cg_w_interrupt_does_not_save_registers=06062_W_Der Zielprozessor unterst
 #
 #
 # Assembler reader
 # Assembler reader
 #
 #
-# 07141 is the last used one
+# 07145 is the last used one
 #
 #
 asmr_d_start_reading=07000_DL_Starte $1 Stil Assembler Parsen
 asmr_d_start_reading=07000_DL_Starte $1 Stil Assembler Parsen
 % This informs you that an assembler block is being parsed
 % This informs you that an assembler block is being parsed
@@ -2935,6 +2953,10 @@ asmr_e_multiple_segment_overrides=07139_E_Kann "multiple segment overrides" nich
 asmr_w_multiple_segment_overrides=07140_W_"Multiple segment overrides" (nur das letzte wird beachtet)
 asmr_w_multiple_segment_overrides=07140_W_"Multiple segment overrides" (nur das letzte wird beachtet)
 asmr_w_segment_override_ignored_in_64bit_mode=07141_W_Segment-Basis $1 wird erzeugt, aber von der CPU im 64-Bit-Modus ignoriert
 asmr_w_segment_override_ignored_in_64bit_mode=07141_W_Segment-Basis $1 wird erzeugt, aber von der CPU im 64-Bit-Modus ignoriert
 asmr_e_mismatch_broadcasting_elements=07142_E_Broadcasting-Elemente passen nicht (erwartet: {$1} gefunden: {$2})
 asmr_e_mismatch_broadcasting_elements=07142_E_Broadcasting-Elemente passen nicht (erwartet: {$1} gefunden: {$2})
+asmr_e_invalid_arrangement=07143_E_Ung�ltige Anordnung "$1"
+asmr_e_a64_invalid_regset=07144_E_Register in einem Register-Set m�ssen aufeinander folgen
+asmr_e_unknown_field=07145_E_Unbekannter Feld-Bezeichner
+% The internal assembler read cannot find the passed field identifier.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2942,7 +2964,7 @@ asmr_e_mismatch_broadcasting_elements=07142_E_Broadcasting-Elemente passen nicht
 #
 #
 # Assembler/binary writers
 # Assembler/binary writers
 #
 #
-# 08035 is the last used one
+# 08036 is the last used one
 #
 #
 asmw_f_too_many_asm_files=08000_F_Zu viele Assembler-Dateien
 asmw_f_too_many_asm_files=08000_F_Zu viele Assembler-Dateien
 % With smartlinking enabled, there are too many assembler
 % With smartlinking enabled, there are too many assembler
@@ -2999,6 +3021,7 @@ asmw_e_instruction_not_supported_by_cpu=08032_E_Befehl wird vom ausgew
 asmw_e_brxx_out_of_range=08033_E_Asm: Das Ziel des bedingten Zweigs ist auáerhalb des Bereichs
 asmw_e_brxx_out_of_range=08033_E_Asm: Das Ziel des bedingten Zweigs ist auáerhalb des Bereichs
 asmw_e_illegal_use_of_rip=08034_E_Asm: RIP kann nicht als Indexregister oder mit einem anderen Register in einer Referenz verwendet werden
 asmw_e_illegal_use_of_rip=08034_E_Asm: RIP kann nicht als Indexregister oder mit einem anderen Register in einer Referenz verwendet werden
 asmw_e_seh_invalid_data_size=08035_F_Ung�ltige Funktionsgr”áe einer SEH-Funktion
 asmw_e_seh_invalid_data_size=08035_F_Ung�ltige Funktionsgr”áe einer SEH-Funktion
+asmw_e_illegal_use_of_sp=08036_E_Asm: ESP/RSP kann nicht als Indexregister verwendet werden
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -3449,7 +3472,7 @@ unit_u_ppu_llvm_mismatch=10067_U_
 #
 #
 # Options
 # Options
 #
 #
-# 11061 is the last used one
+# 11063 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 %
 %
@@ -3605,6 +3628,9 @@ option_features_only_for_system_unit=11060_E_Feature-Schalter werden nur beim 
 % To selected a certain feature, the system unit must be compiled with this feature enabled. All other units inherited the features set by the
 % 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.
 % system unit through the ppu of the system unit.
 option_debug_info_requires_external_linker=11061_N_Das ausgew„hlte Debug-Format wird vom internen Linker nicht unterst�tzt, schalte um auf externen Linker
 option_debug_info_requires_external_linker=11061_N_Das ausgew„hlte Debug-Format wird vom internen Linker nicht unterst�tzt, schalte um auf externen Linker
+option_valgrind_heaptrc_mismatch=11062_E_Die beiden Optionen ($1) ($2) k”nnen nicht gleichzeitig verwendet werden
+option_unsupported_fpu=11063_F_Der ausgew„hlte FPU-Typ "$1" wird vom ausgew„hlten Befehlssatz "$2" nicht unterst�tzt
+% Not all instruction sets support all FPU types. For example on ARM, Thumb(-1) supports no FPU/VFP instruction set
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -3896,6 +3922,7 @@ F*0*_Es werden nur Optionen aufgelistet, die f
 **1A<x>_Ausgabe Format:
 **1A<x>_Ausgabe Format:
 **2Adefault_Benutze den "default" Assembler
 **2Adefault_Benutze den "default" Assembler
 3*2Aas_Assembliere mit Hilfe von GNU AS
 3*2Aas_Assembliere mit Hilfe von GNU AS
+3*2Aas-darwin_Assembliere Darwin Mach-O mit Hilfe von GNU GAS
 3*2Amacho_Mach-O (Darwin, Intel 32 bit) mit Hilfe des internen Schreibers
 3*2Amacho_Mach-O (Darwin, Intel 32 bit) mit Hilfe des internen Schreibers
 8*2Anasm_Assembliere mit Hilfe von Nasm
 8*2Anasm_Assembliere mit Hilfe von Nasm
 8*2Anasmobj_Assembliere mit Hilfe von Nasm
 8*2Anasmobj_Assembliere mit Hilfe von Nasm
@@ -3916,6 +3943,7 @@ F*0*_Es werden nur Optionen aufgelistet, die f
 4*2Aas_Assembliere mit Hilfe von GNU AS
 4*2Aas_Assembliere mit Hilfe von GNU AS
 4*2Agas_Assembliere mit Hilfe von GNU GAS
 4*2Agas_Assembliere mit Hilfe von GNU GAS
 4*2Agas-darwin_Assembliere darwin Mach-O64 mit Hilfe von GNU GAS
 4*2Agas-darwin_Assembliere darwin Mach-O64 mit Hilfe von GNU GAS
+4*2Aas-darwin_Assembliere Darwin Mach-O64 mit Hilfe von GNU GAS
 4*2Amasm_Win64 Objektdatei mit Hilfe von ml64 (Microsoft)
 4*2Amasm_Win64 Objektdatei mit Hilfe von ml64 (Microsoft)
 4*2Apecoff_PE-COFF (Win64) mit Hilfe des internen Schreibers
 4*2Apecoff_PE-COFF (Win64) mit Hilfe des internen Schreibers
 4*2Aelf_ELF (Linux-64bit) mit Hilfe des internen Schreibers
 4*2Aelf_ELF (Linux-64bit) mit Hilfe des internen Schreibers
@@ -3930,10 +3958,23 @@ F*0*_Es werden nur Optionen aufgelistet, die f
 6*2Amot_Standard Motorola Assembler
 6*2Amot_Standard Motorola Assembler
 6*2Avasm_Assembliere mit Hilfe von vasm
 6*2Avasm_Assembliere mit Hilfe von vasm
 A*2Aas_Assembliere mit Hilfe von GNU AS
 A*2Aas_Assembliere mit Hilfe von GNU AS
+A*2Aas-darwin_Assembliere mit Hilfe von GNU AS f�r Darwin Zielsysteme
+A*2Aclang_Assembliere mit Hilfe von clang
+A*2Aelf_Assembliere mit Hilfe des internen ELF-Schreibers
+a*2Aas_Assembliere mit Hilfe von GNU AS
+a*2Aclang_Assembliere mit Hilfe von clang f�r Darwin/iOS Zielsysteme
+a*2Aas-clang_AAssembliere mit Hilfe von clang f�r andere Zielsysteme 
 P*2Aas_Assembliere mit Hilfe von GNU AS
 P*2Aas_Assembliere mit Hilfe von GNU AS
 S*2Aas_Assembliere mit Hilfe von GNU AS
 S*2Aas_Assembliere mit Hilfe von GNU AS
+s*2Aas_Assembliere mit Hilfe von GNU AS
+v*2Aas_Assembliere mit Hilfe von GNU AS
+W*2Abinaryen_Assembliere mit Hilfe von GNU AS f�r wasm32 (wasm-as)
+W*2Allvm-mc_Assembliere mit Hilfe von llvm-mc
+W*2Awabt_Assembliere mit Hilfe von wasa
+x*2Aas_Assembliere mit Hilfe von GNU AS
 Z*2Asdcc-sdasz80_Assembliere mit Hilfe von SDCC-SDASZ80
 Z*2Asdcc-sdasz80_Assembliere mit Hilfe von SDCC-SDASZ80
 Z*2Az80asm_Assembliere mit Hilfe von z80asm
 Z*2Az80asm_Assembliere mit Hilfe von z80asm
+Z*2Avasm_Assembliere mit Hilfe von Vasm
 # Used only internally by IDE
 # Used only internally by IDE
 **1b_Erzeuge Browser-Info
 **1b_Erzeuge Browser-Info
 **2bl_Erzeuge Info zu lokalen Symbolen
 **2bl_Erzeuge Info zu lokalen Symbolen
@@ -3994,7 +4035,9 @@ A*2CV<x>_Setze das Section-Threadvar-Modell auf <x>
 **2CX_Benutze Smartlinking
 **2CX_Benutze Smartlinking
 **1d<x>_Definiere das Symbol <x>
 **1d<x>_Definiere das Symbol <x>
 **1D_Erzeuge eine DEF-Datei
 **1D_Erzeuge eine DEF-Datei
+**2DD<x>_Setze die von %DATE% zur�ck gegebene Datums-Zeichenkette auf x, ohne šberpr�fung auf G�ltigkeit
 **2Dd<x>_Setze Beschreibung zu <x>
 **2Dd<x>_Setze Beschreibung zu <x>
+**2DT<x>_Setze die von %TIME% zur�ck gegebene Zeit-Zeichenkette auf x, ohne šberpr�fung auf G�ltigkeit
 **2Dv<x>_Setze DLL Version zu <x>
 **2Dv<x>_Setze DLL Version zu <x>
 *O2Dw_Erzeuge PM-Anwendung
 *O2Dw_Erzeuge PM-Anwendung
 **1e<x>_Setze Pfad zur ausf�hrbaren Datei
 **1e<x>_Setze Pfad zur ausf�hrbaren Datei
@@ -4007,8 +4050,9 @@ A*2CV<x>_Setze das Section-Threadvar-Modell auf <x>
 **2Fd_Schalte den internen Verzeichnis-Cache des Compilers aus
 **2Fd_Schalte den internen Verzeichnis-Cache des Compilers aus
 **2FD<x>_Setze das Verzeichnis f�r die Compiler-Hilfsprogramme
 **2FD<x>_Setze das Verzeichnis f�r die Compiler-Hilfsprogramme
 **2Fe<x>_Leite die Fehlerausgabe um nach <x>
 **2Fe<x>_Leite die Fehlerausgabe um nach <x>
-**2Ff<x>_Erg„nze <x> zum Framework-Pfad (nur Darwin)
 **2FE<x>_Setze den Pfad f�r Exe/Unit-Dateien auf <x>
 **2FE<x>_Setze den Pfad f�r Exe/Unit-Dateien auf <x>
+**2Ff<x>_Erg„nze <x> zum Framework-Pfad (nur Darwin), oder setze IDF-Pfad auf <x> (Xtensa-FreeRTOS)
+**2FF_Benutze fpcres als šbersetzer von RC nach RES anstelle von windres oder gorc
 **2Fi<x>_Erg„nze <x> zum Include-Pfad
 **2Fi<x>_Erg„nze <x> zum Include-Pfad
 **2Fl<x>_Erg„nze <x> zum Bibliotheks-Pfad
 **2Fl<x>_Erg„nze <x> zum Bibliotheks-Pfad
 **2FL<x>_Benutze <x> als dynamischen Linker
 **2FL<x>_Benutze <x> als dynamischen Linker
@@ -4122,6 +4166,7 @@ F*2P<x>_Setze den Zielprozessor (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel
 **2SI<x>_Setze den Stil des Interface zu <x>
 **2SI<x>_Setze den Stil des Interface zu <x>
 **3SIcom_COM kompatibles Interface (Voreinstellung)
 **3SIcom_COM kompatibles Interface (Voreinstellung)
 **3SIcorba_CORBA kompatibles Interface
 **3SIcorba_CORBA kompatibles Interface
+**2sT_Erzeuge nur Skript, um auf dem Zielsystem zu linken
 **2Sm_Unterst�tze Makros wie in C (global)
 **2Sm_Unterst�tze Makros wie in C (global)
 **2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
 **2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
 **2Sr_Transparente Dateinamen im ISO-Modus
 **2Sr_Transparente Dateinamen im ISO-Modus
@@ -4130,8 +4175,8 @@ F*2P<x>_Setze den Zielprozessor (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel
 **2Sx_Exception Schl�sselw”rter einschalten (Voreinstellung in Delphi/ObjFPC Moden)
 **2Sx_Exception Schl�sselw”rter einschalten (Voreinstellung in Delphi/ObjFPC Moden)
 **2Sy_@<pointer> gibt einen typisierten Zeiger zur�ck, genau wie $T+
 **2Sy_@<pointer> gibt einen typisierten Zeiger zur�ck, genau wie $T+
 **1s_Rufe weder Assembler noch Linker auf (nur mit -a)
 **1s_Rufe weder Assembler noch Linker auf (nur mit -a)
-**2sh_Erzeuge Script um auf dem Host zu linken
-**2st_Erzeuge Script um auf dem Zielsystem zu linken
+**2sh_Erzeuge Skript, um auf dem Host zu linken
+**2st_Erzeuge Skript, um auf dem Zielsystem zu assemblieren und zu linken
 **2sr_šberspringe die Phase der "register allocation" (mit -alr benutzen)
 **2sr_šberspringe die Phase der "register allocation" (mit -alr benutzen)
 **1T<x>_Zielbetriebssystem::
 **1T<x>_Zielbetriebssystem::
 # i386 targets
 # i386 targets
@@ -4178,7 +4223,9 @@ F*2P<x>_Setze den Zielprozessor (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel
 6*2Tlinux_Linux
 6*2Tlinux_Linux
 6*2Tnetbsd_NetBSD
 6*2Tnetbsd_NetBSD
 6*2Tmacos_Mac OS
 6*2Tmacos_Mac OS
+6*2Tmacosclassic_Classic Mac OS
 6*2Tpalmos_PalmOS
 6*2Tpalmos_PalmOS
+6*2Tsinclairql_Sinclair QL
 # i8086 targets
 # i8086 targets
 8*2Tembedded_Embedded
 8*2Tembedded_Embedded
 8*2Tmsdos_MS-DOS (und kompatible)
 8*2Tmsdos_MS-DOS (und kompatible)
@@ -4186,10 +4233,10 @@ F*2P<x>_Setze den Zielprozessor (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel
 # arm targets
 # arm targets
 A*2Tandroid_Android
 A*2Tandroid_Android
 A*2Taros_AROS
 A*2Taros_AROS
-A*2Tdarwin_Darwin/iPhoneOS/iOS
 A*2Tembedded_Embedded
 A*2Tembedded_Embedded
 A*2Tfreertos_FreeRTOS
 A*2Tfreertos_FreeRTOS
 A*2Tgba_Game Boy Advance
 A*2Tgba_Game Boy Advance
+A*2Tios_iOS
 A*2Tlinux_Linux
 A*2Tlinux_Linux
 A*2Tnds_Nintendo DS
 A*2Tnds_Nintendo DS
 A*2Tnetbsd_NetBSD
 A*2Tnetbsd_NetBSD
@@ -4198,7 +4245,9 @@ A*2Tsymbian_Symbian
 A*2Twince_Windows CE
 A*2Twince_Windows CE
 # aarch64 targets
 # aarch64 targets
 a*2Tandroid_Android
 a*2Tandroid_Android
-a*2Tdarwin_Darwin/iOS
+a*2Tdarwin_Darwin/Mac OS X
+a*2Tfreebsd_FreeBSD
+a*2Tios_iOS
 a*2Tlinux_Linux
 a*2Tlinux_Linux
 a*2Twin64_Windows 64
 a*2Twin64_Windows 64
 # jvm targets
 # jvm targets
@@ -4218,6 +4267,7 @@ P*2Tdarwin_Darwin und macOS
 P*2Tembedded_Embedded
 P*2Tembedded_Embedded
 P*2Tlinux_Linux
 P*2Tlinux_Linux
 P*2Tmacos_Mac OS (classic)
 P*2Tmacos_Mac OS (classic)
+P*2Tmacosclassic_Classic Mac OS
 P*2Tmorphos_MorphOS
 P*2Tmorphos_MorphOS
 P*2Tnetbsd_NetBSD
 P*2Tnetbsd_NetBSD
 P*2Twii_Wii
 P*2Twii_Wii
@@ -4247,6 +4297,10 @@ x*2Tlinux_Linux
 # z80 targets
 # z80 targets
 Z*2Tembedded_Embedded
 Z*2Tembedded_Embedded
 Z*2Tzxspectrum_ZX Spectrum
 Z*2Tzxspectrum_ZX Spectrum
+Z*2Tmsxdos_MSX-DOS
+# wasm32 targets
+W*2Tembedded_Embedded
+W*2Twasi_Das WebAssembly System Interface (WASI)
 # end of targets section
 # end of targets section
 **1u<x>_Entferne die Definition f�r das Symbol <x>
 **1u<x>_Entferne die Definition f�r das Symbol <x>
 **1U<x>_Unit-Optionen:
 **1U<x>_Unit-Optionen:
@@ -4281,9 +4335,10 @@ A*2Wb_Erzeuge statt einer Bibliothek ein Bundle (Darwin)
 3*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
 3*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
 3*2WB<x>_Setze die Imagebasis auf <x> (Windows, Symbian)
 3*2WB<x>_Setze die Imagebasis auf <x> (Windows, Symbian)
 4*2WB_Erzeuge ein relozierbares Image (Windows)
 4*2WB_Erzeuge ein relozierbares Image (Windows)
-4*2WB<x>_Setze die Imagebasis auf <x> (Windows, Symbian)
+4*2WB<x>_Setze die Imagebasis auf <x> (Windows)
 A*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
 A*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
-A*2WB<x>_Setze die Imagebasis auf <x> (Windows)
+A*2WB<x>_Setze die Imagebasis auf <x> (Windows, Symbian)
+Z*2WB<x>_Setze die Imagebasis auf <x> (ZX Spectrum)
 3*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
 3*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
 4*2WC_Spezifiziere "console type application" (Windows)
 4*2WC_Spezifiziere "console type application" (Windows)
 A*2WC_Spezifiziere "console type application" (Windows)
 A*2WC_Spezifiziere "console type application" (Windows)
@@ -4341,10 +4396,14 @@ A*2WR_Erzeuge "relocation code" (Windows)
 8*2Wt<x>_Setze das Format der Ziel-Executable
 8*2Wt<x>_Setze das Format der Ziel-Executable
 8*3Wtexe_Erzeuge eine DOS .EXE Datei (Voreinstellung)
 8*3Wtexe_Erzeuge eine DOS .EXE Datei (Voreinstellung)
 8*3Wtcom_Erzeuge eine DOS .COM Datei (erfordert das winzige (tiny) Speichermodell)
 8*3Wtcom_Erzeuge eine DOS .COM Datei (erfordert das winzige (tiny) Speichermodell)
-P*2WF_Spezifiziere "MPW tool type application" (Classic Mac OS)
+P*2WT_Spezifiziere "MPW tool type application" (Classic Mac OS)
+6*2WQ<x>_Setze das "executable" Metadata-Format (Sinclair QL)
+6*3WQqhdr_Setze Metadata auf QDOS Datei-Header Stil (Voreinstellung)
+6*3WQxtcc_Setze Metadata auf XTcc Stil
 **2WX_Erm”gliche den executable stack (Linux)
 **2WX_Erm”gliche den executable stack (Linux)
 **1X_Programm-Optionen:
 **1X_Programm-Optionen:
 **2X9_Erzeuge Linkerscript f�r GNU Binutils ld „lter als Version 2.19.1 (Linux)
 **2X9_Erzeuge Linkerscript f�r GNU Binutils ld „lter als Version 2.19.1 (Linux)
+**2Xa_Erzeuge Code, der auf 64-Bit Zielsystemen mehr als 2 GB statische Daten erlaubt (Linux)
 **2Xc_šbergebe --shared an den Linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xc_šbergebe --shared an den Linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xd_Den Standard Bibliotheks-Suchpfad NICHT nutzen (ben”tigt f�r cross compile, wenn nicht -XR verwendet wird)
 **2Xd_Den Standard Bibliotheks-Suchpfad NICHT nutzen (ben”tigt f�r cross compile, wenn nicht -XR verwendet wird)
 **2Xe_Verwende den externen Linker
 **2Xe_Verwende den externen Linker
@@ -4360,12 +4419,13 @@ L*2XlS<x>_Suffix der LLVM-Programme (z. B. -7, wenn clang clang-7 hei
 **2XM<x>_Setze den Namen der 'main' Programm-Routine (Voreinstellung ist 'main')
 **2XM<x>_Setze den Namen der 'main' Programm-Routine (Voreinstellung ist 'main')
 **2Xn_Nutze den plattformeigenen Linker des Zielsystem anstelle des GNU ld (Solaris, AIX)
 **2Xn_Nutze den plattformeigenen Linker des Zielsystem anstelle des GNU ld (Solaris, AIX)
 F*2Xp<x>_Suche nach der Compilerbinary zuerst im Verzeichnis <x>
 F*2Xp<x>_Suche nach der Compilerbinary zuerst im Verzeichnis <x>
-**2XP<x>_Stelle dem Namen der Compiler-Hilfsprogramme (binutils) den Prefix <x> voran
+**2XP<x>_Stelle den Namen der Compiler-Hilfsprogramme (binutils) den Prefix <x> voran
 **2Xr<x>_Setze den rlink-Pfad des Linker zu <x> (ben”tigt f�r cross compile, siehe ld-Manual f�r mehr Informationen) (BeOS, Linux)
 **2Xr<x>_Setze den rlink-Pfad des Linker zu <x> (ben”tigt f�r cross compile, siehe ld-Manual f�r mehr Informationen) (BeOS, Linux)
 **2XR<x>_Stelle allen Linker-Suchpfaden den Namen <x> voran (BeOS, Darwin, FreeBSD, Linux, Mac OS, Solaris)
 **2XR<x>_Stelle allen Linker-Suchpfaden den Namen <x> voran (BeOS, Darwin, FreeBSD, Linux, Mac OS, Solaris)
 **2Xs_Entferne alle Symbole aus der ausf�hrbaren Datei
 **2Xs_Entferne alle Symbole aus der ausf�hrbaren Datei
 **2XS_Versuche Units statisch zu linken (default)    (definiert FPC_LINK_STATIC)
 **2XS_Versuche Units statisch zu linken (default)    (definiert FPC_LINK_STATIC)
 **2Xt_Linke mit statischen Bibliotheken              (-static wird an den Linker �bergeben)
 **2Xt_Linke mit statischen Bibliotheken              (-static wird an den Linker �bergeben)
+**2Xu_Erzeuge ausf�hrbares Program im UF2-Format     (nur embedded-Zielsysteme)
 **2Xv_Erzeuge eine Tabelle mit den virtuellen Entry-Aufrufen
 **2Xv_Erzeuge eine Tabelle mit den virtuellen Entry-Aufrufen
 **2XV_Benutze VLink als externen linker              (Voreinstellung f�r Amiga, MorphOS)
 **2XV_Benutze VLink als externen linker              (Voreinstellung f�r Amiga, MorphOS)
 **2XX_Versuche Units smart zu linken                 (definiert FPC_LINK_SMART)
 **2XX_Versuche Units smart zu linken                 (definiert FPC_LINK_SMART)

+ 1 - 1
compiler/msg/errorda.msg

@@ -2555,7 +2555,7 @@ asmr_d_finish_reading=07001_DL_Afslutter assembler-parsing ($1)
 asmr_e_none_label_contain_at=07002_E_Ikke-label navn indeholder @
 asmr_e_none_label_contain_at=07002_E_Ikke-label navn indeholder @
 % A identifier which isn't a label can't contain a @.
 % A identifier which isn't a label can't contain a @.
 asmr_e_building_record_offset=07004_E_Fejl under opbygning af struktur-offset
 asmr_e_building_record_offset=07004_E_Fejl under opbygning af struktur-offset
-% There has an error occured while building the offset of a record/object
+% An error occurred while building the offset of a record/object
 % structure, this can happend when there is no field specified at all or
 % structure, this can happend when there is no field specified at all or
 % an unknown field identifier is used.
 % an unknown field identifier is used.
 asmr_e_offset_without_identifier=07005_E_OFFSET brugt uden navn
 asmr_e_offset_without_identifier=07005_E_OFFSET brugt uden navn

+ 78 - 19
compiler/msg/errordu.msg

@@ -3,7 +3,7 @@
 #   Latest updates contributed by Karl-Michael Schindler aka mischi
 #   Latest updates contributed by Karl-Michael Schindler aka mischi
 #   <karl-michael.schindler at web.de>
 #   <karl-michael.schindler at web.de>
 #
 #
-#   Based on errore.msg of SVN revision 45316
+#   Based on errore.msg of git commit ce1f9cce, 27 Jun, 2021
 #
 #
 #   This file is part of the Free Pascal Compiler
 #   This file is part of the Free Pascal Compiler
 #   Copyright (c) 1998-2021 by the Free Pascal Development team
 #   Copyright (c) 1998-2021 by the Free Pascal Development team
@@ -442,6 +442,7 @@ scan_w_setpeosversion_not_support=02103_W_SETPEOSVERSION wird vom Zielbetriebssy
 scan_w_setpesubsysversion_not_support=02104_W_SETPESUBSYSVERSION wird vom Zielbetriebssystem nicht unterstützt
 scan_w_setpesubsysversion_not_support=02104_W_SETPESUBSYSVERSION wird vom Zielbetriebssystem nicht unterstützt
 % The \var{\{\$SETPESUBSYSVERSION\}} directive is not supported by the target OS.
 % The \var{\{\$SETPESUBSYSVERSION\}} directive is not supported by the target OS.
 scan_n_changecputype=02105_N_Geänderter Prozessortyp muss zum angegebenen Controller passen
 scan_n_changecputype=02105_N_Geänderter Prozessortyp muss zum angegebenen Controller passen
+scan_e_emptymacroname=02106_E_Der Name einer macro/compiler-Variablen kann nicht leer sein
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -449,7 +450,7 @@ scan_n_changecputype=02105_N_Geänderter Prozessortyp muss zum angegebenen Contr
 #
 #
 # Parser
 # Parser
 #
 #
-# 03355 is the last used one
+# 03360 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 %
 %
@@ -1091,8 +1092,9 @@ parser_e_paraloc_only_one_para=03197_E_Jedes Argument muss seine eigene "locatio
 parser_e_paraloc_all_paras=03198_E_Jedes Argument muss seine explizite "location" haben
 parser_e_paraloc_all_paras=03198_E_Jedes Argument muss seine explizite "location" haben
 % If one argument has an explicit argument location, all arguments of a procedure
 % If one argument has an explicit argument location, all arguments of a procedure
 % must have one.
 % must have one.
-parser_e_illegal_explicit_paraloc=03199_E_"location" des Arguments unbekannt
-% The location specified for an argument isn't recognized by the compiler.
+parser_e_illegal_explicit_paraloc=03199_E_Ungültiger expliziter Parameter "location" spezifiziert
+% Syscalls specific: the specified explicit location string for this parameter cannot be parsed, invalid,
+% or the location specified for an argument isn't recognized by the compiler.
 parser_e_32bitint_or_pointer_variable_expected=03200_E_32 Bit-Integer oder Zeiger-Variable erwartet
 parser_e_32bitint_or_pointer_variable_expected=03200_E_32 Bit-Integer oder Zeiger-Variable erwartet
 % The libbase for MorphOS/AmigaOS can be given only as \var{longint}, \var{dword} or any pointer variable.
 % The libbase for MorphOS/AmigaOS can be given only as \var{longint}, \var{dword} or any pointer variable.
 parser_e_goto_outside_proc=03201_E_Goto Statements zwischen verschiedenen Prozeduren sind nicht erlaubt
 parser_e_goto_outside_proc=03201_E_Goto Statements zwischen verschiedenen Prozeduren sind nicht erlaubt
@@ -1569,7 +1571,7 @@ parser_w_ptr_type_ignored=03338_W_Zeigertyp "$1" ignoriert
 % The specified pointer type modifier is ignored, because it is not supported on
 % The specified pointer type modifier is ignored, because it is not supported on
 % the current platform. This happens, for example, when a far pointer is
 % the current platform. This happens, for example, when a far pointer is
 % declared on a non-x86 platform.
 % declared on a non-x86 platform.
-parser_e_global_generic_references_static=03339_E_Ein globales, generisches Templat referenziert eine statische Symboltabelle
+parser_e_global_generic_references_static=03339_E_Ein generisches Templat im Interface-Bereich referenziert ein Symbol des Implementation-Bereichs
 % A generic declared in the interface section of a unit must not reference symbols that belong
 % A generic declared in the interface section of a unit must not reference symbols that belong
 % solely to the implementation section of that unit.
 % solely to the implementation section of that unit.
 parser_u_already_compiled=03340_UL_Die Unit $1 wurde inzwischen bereits kompiliert.
 parser_u_already_compiled=03340_UL_Die Unit $1 wurde inzwischen bereits kompiliert.
@@ -1628,6 +1630,16 @@ parser_e_method_for_type_in_other_unit=03354_E_Implementierung einer Methods fü
 parser_e_generic_constraints_not_allowed_here=03355_E_Eine generische Einschränkung ist hier nicht erlaubt
 parser_e_generic_constraints_not_allowed_here=03355_E_Eine generische Einschränkung ist hier nicht erlaubt
 % At the current location specifying a constraint is not allowed. For example
 % At the current location specifying a constraint is not allowed. For example
 % in delphi mode, a constraint might not be specified in the header of the implementation.
 % in delphi mode, a constraint might not be specified in the header of the implementation.
+parser_e_location_size_too_small=03356_E_Die explizite "location" ist zu klein für den Parameter
+% AmigaOS/MorphOS syscall specific: for int64/qword parameter only a single register location is specified
+parser_e_location_size_too_large=03357_E_Die Größe der expliziten "location" ist größer als vom Parameter verlangt
+% AmigaOS/MorphOS syscall specific: for a parameter which is smaller than 64bit, a register pair is specified
+parser_e_location_regpair_only_data=03358_E_Nur Daten-Register werden für explizite "location" Registerpaare unterstützt
+% AmigaOS/MorphOS syscall specific: for 64bit register pairs, only data registers are supported
+parser_e_location_regpair_only_consecutive=03359_E_Nur aufeinander folgende Register werden für explizite "location" Registerpaare unterstützt
+% MorphOS syscall specific: only consecutive (f.e.: d1-d2) registers are supported for 64bit register pairs
+parser_e_constructurs_cannot_take_type_parameters=03360_E_Konstruktoren können keine Type-Parameter übernehmen
+% The use of type parameters in constructors is not allowed.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -1635,7 +1647,7 @@ parser_e_generic_constraints_not_allowed_here=03355_E_Eine generische Einschrän
 #
 #
 # Type Checking
 # Type Checking
 #
 #
-# 04128 is the last used one
+# 04130 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 %
 %
@@ -2084,6 +2096,11 @@ type_e_forward_interface_type_does_not_match=04127_E_Der Interfacetyp der Vorwä
 type_e_generic_const_type_not_allowed=04128_E_Typ ist für generische, konstante Parameter nicht erlaubt: $1
 type_e_generic_const_type_not_allowed=04128_E_Typ ist für generische, konstante Parameter nicht erlaubt: $1
 % Only types that can also be used (indirectly) for untyped constants can be used as a
 % Only types that can also be used (indirectly) for untyped constants can be used as a
 % type for a generic constant parameter.
 % type for a generic constant parameter.
+type_e_cant_read_write_type_in_iso_mode=04129_E_Kann Variablen diesen Typs im ISO-Modus nicht lesen oder schreiben
+% You are trying to \var{read} or \var{write} a variable from or to a
+% file of type text, which doesn't support that variable's type in the selected language mode (iso mode).
+type_w_array_size_does_not_match_size_of_constant_string=04130_W_Die Länge der konstanten Zeichenkette (die Länge ist $1) muss so groß wie die Anzahl der Array-Elemente sein ($2 Elemente)
+% ISO Pascal requires that string constants have the same length as the array to which them they are assigned.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2595,7 +2612,7 @@ cg_w_interrupt_does_not_save_registers=06062_W_Der Zielprozessor unterstützt es
 #
 #
 # Assembler reader
 # Assembler reader
 #
 #
-# 07141 is the last used one
+# 07145 is the last used one
 #
 #
 asmr_d_start_reading=07000_DL_Starte $1 Stil Assembler Parsen
 asmr_d_start_reading=07000_DL_Starte $1 Stil Assembler Parsen
 % This informs you that an assembler block is being parsed
 % This informs you that an assembler block is being parsed
@@ -2935,6 +2952,10 @@ asmr_e_multiple_segment_overrides=07139_E_Kann "multiple segment overrides" nich
 asmr_w_multiple_segment_overrides=07140_W_"Multiple segment overrides" (nur das letzte wird beachtet)
 asmr_w_multiple_segment_overrides=07140_W_"Multiple segment overrides" (nur das letzte wird beachtet)
 asmr_w_segment_override_ignored_in_64bit_mode=07141_W_Segment-Basis $1 wird erzeugt, aber von der CPU im 64-Bit-Modus ignoriert
 asmr_w_segment_override_ignored_in_64bit_mode=07141_W_Segment-Basis $1 wird erzeugt, aber von der CPU im 64-Bit-Modus ignoriert
 asmr_e_mismatch_broadcasting_elements=07142_E_Broadcasting-Elemente passen nicht (erwartet: {$1} gefunden: {$2})
 asmr_e_mismatch_broadcasting_elements=07142_E_Broadcasting-Elemente passen nicht (erwartet: {$1} gefunden: {$2})
+asmr_e_invalid_arrangement=07143_E_Ungültige Anordnung "$1"
+asmr_e_a64_invalid_regset=07144_E_Register in einem Register-Set müssen aufeinander folgen
+asmr_e_unknown_field=07145_E_Unbekannter Feld-Bezeichner
+% The internal assembler read cannot find the passed field identifier.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2942,7 +2963,7 @@ asmr_e_mismatch_broadcasting_elements=07142_E_Broadcasting-Elemente passen nicht
 #
 #
 # Assembler/binary writers
 # Assembler/binary writers
 #
 #
-# 08035 is the last used one
+# 08036 is the last used one
 #
 #
 asmw_f_too_many_asm_files=08000_F_Zu viele Assembler-Dateien
 asmw_f_too_many_asm_files=08000_F_Zu viele Assembler-Dateien
 % With smartlinking enabled, there are too many assembler
 % With smartlinking enabled, there are too many assembler
@@ -2999,6 +3020,7 @@ asmw_e_instruction_not_supported_by_cpu=08032_E_Befehl wird vom ausgewählten Be
 asmw_e_brxx_out_of_range=08033_E_Asm: Das Ziel des bedingten Zweigs ist außerhalb des Bereichs
 asmw_e_brxx_out_of_range=08033_E_Asm: Das Ziel des bedingten Zweigs ist außerhalb des Bereichs
 asmw_e_illegal_use_of_rip=08034_E_Asm: RIP kann nicht als Indexregister oder mit einem anderen Register in einer Referenz verwendet werden
 asmw_e_illegal_use_of_rip=08034_E_Asm: RIP kann nicht als Indexregister oder mit einem anderen Register in einer Referenz verwendet werden
 asmw_e_seh_invalid_data_size=08035_F_Ungültige Funktionsgröße einer SEH-Funktion
 asmw_e_seh_invalid_data_size=08035_F_Ungültige Funktionsgröße einer SEH-Funktion
+asmw_e_illegal_use_of_sp=08036_E_Asm: ESP/RSP kann nicht als Indexregister verwendet werden
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -3449,7 +3471,7 @@ unit_u_ppu_llvm_mismatch=10067_U_Überspringe die Unit, PPU und Compiler müssen
 #
 #
 # Options
 # Options
 #
 #
-# 11061 is the last used one
+# 11063 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 %
 %
@@ -3605,6 +3627,9 @@ option_features_only_for_system_unit=11060_E_Feature-Schalter werden nur beim Ü
 % To selected a certain feature, the system unit must be compiled with this feature enabled. All other units inherited the features set by the
 % 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.
 % system unit through the ppu of the system unit.
 option_debug_info_requires_external_linker=11061_N_Das ausgewählte Debug-Format wird vom internen Linker nicht unterstützt, schalte um auf externen Linker
 option_debug_info_requires_external_linker=11061_N_Das ausgewählte Debug-Format wird vom internen Linker nicht unterstützt, schalte um auf externen Linker
+option_valgrind_heaptrc_mismatch=11062_E_Die beiden Optionen ($1) ($2) können nicht gleichzeitig verwendet werden
+option_unsupported_fpu=11063_F_Der ausgewählte FPU-Typ "$1" wird vom ausgewählten Befehlssatz "$2" nicht unterstützt
+% Not all instruction sets support all FPU types. For example on ARM, Thumb(-1) supports no FPU/VFP instruction set
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -3896,6 +3921,7 @@ F*0*_Es werden nur Optionen aufgelistet, die für die voreingestellte oder ausge
 **1A<x>_Ausgabe Format:
 **1A<x>_Ausgabe Format:
 **2Adefault_Benutze den "default" Assembler
 **2Adefault_Benutze den "default" Assembler
 3*2Aas_Assembliere mit Hilfe von GNU AS
 3*2Aas_Assembliere mit Hilfe von GNU AS
+3*2Aas-darwin_Assembliere Darwin Mach-O mit Hilfe von GNU GAS
 3*2Amacho_Mach-O (Darwin, Intel 32 bit) mit Hilfe des internen Schreibers
 3*2Amacho_Mach-O (Darwin, Intel 32 bit) mit Hilfe des internen Schreibers
 8*2Anasm_Assembliere mit Hilfe von Nasm
 8*2Anasm_Assembliere mit Hilfe von Nasm
 8*2Anasmobj_Assembliere mit Hilfe von Nasm
 8*2Anasmobj_Assembliere mit Hilfe von Nasm
@@ -3915,7 +3941,8 @@ F*0*_Es werden nur Optionen aufgelistet, die für die voreingestellte oder ausge
 3*2Ayasm_Assembliere mit Hilfe von Yasm (experimentell)
 3*2Ayasm_Assembliere mit Hilfe von Yasm (experimentell)
 4*2Aas_Assembliere mit Hilfe von GNU AS
 4*2Aas_Assembliere mit Hilfe von GNU AS
 4*2Agas_Assembliere mit Hilfe von GNU GAS
 4*2Agas_Assembliere mit Hilfe von GNU GAS
-4*2Agas-darwin_Assembliere darwin Mach-O64 mit Hilfe von GNU GAS
+4*2Agas-darwin_Assembliere Darwin Mach-O64 mit Hilfe von GNU GAS
+4*2Aas-darwin_Assembliere Darwin Mach-O64 mit Hilfe von GNU GAS
 4*2Amasm_Win64 Objektdatei mit Hilfe von ml64 (Microsoft)
 4*2Amasm_Win64 Objektdatei mit Hilfe von ml64 (Microsoft)
 4*2Apecoff_PE-COFF (Win64) mit Hilfe des internen Schreibers
 4*2Apecoff_PE-COFF (Win64) mit Hilfe des internen Schreibers
 4*2Aelf_ELF (Linux-64bit) mit Hilfe des internen Schreibers
 4*2Aelf_ELF (Linux-64bit) mit Hilfe des internen Schreibers
@@ -3930,10 +3957,23 @@ F*0*_Es werden nur Optionen aufgelistet, die für die voreingestellte oder ausge
 6*2Amot_Standard Motorola Assembler
 6*2Amot_Standard Motorola Assembler
 6*2Avasm_Assembliere mit Hilfe von vasm
 6*2Avasm_Assembliere mit Hilfe von vasm
 A*2Aas_Assembliere mit Hilfe von GNU AS
 A*2Aas_Assembliere mit Hilfe von GNU AS
+A*2Aas-darwin_Assembliere mit Hilfe von GNU AS für Darwin Zielsysteme
+A*2Aclang_Assembliere mit Hilfe von clang
+A*2Aelf_Assembliere mit Hilfe des internen ELF-Schreibers
+a*2Aas_Assembliere mit Hilfe von GNU AS
+a*2Aclang_Assembliere mit Hilfe von clang für Darwin/iOS Zielsysteme
+a*2Aas-clang_AAssembliere mit Hilfe von clang für andere Zielsysteme 
 P*2Aas_Assembliere mit Hilfe von GNU AS
 P*2Aas_Assembliere mit Hilfe von GNU AS
 S*2Aas_Assembliere mit Hilfe von GNU AS
 S*2Aas_Assembliere mit Hilfe von GNU AS
+s*2Aas_Assembliere mit Hilfe von GNU AS
+v*2Aas_Assembliere mit Hilfe von GNU AS
+W*2Abinaryen_Assembliere mit Hilfe von GNU AS für wasm32 (wasm-as)
+W*2Allvm-mc_Assembliere mit Hilfe von llvm-mc
+W*2Awabt_Assembliere mit Hilfe von wasa
+x*2Aas_Assembliere mit Hilfe von GNU AS
 Z*2Asdcc-sdasz80_Assembliere mit Hilfe von SDCC-SDASZ80
 Z*2Asdcc-sdasz80_Assembliere mit Hilfe von SDCC-SDASZ80
 Z*2Az80asm_Assembliere mit Hilfe von z80asm
 Z*2Az80asm_Assembliere mit Hilfe von z80asm
+Z*2Avasm_Assembliere mit Hilfe von Vasm
 # Used only internally by IDE
 # Used only internally by IDE
 **1b_Erzeuge Browser-Info
 **1b_Erzeuge Browser-Info
 **2bl_Erzeuge Info zu lokalen Symbolen
 **2bl_Erzeuge Info zu lokalen Symbolen
@@ -3994,7 +4034,9 @@ A*2CV<x>_Setze das Section-Threadvar-Modell auf <x>
 **2CX_Benutze Smartlinking
 **2CX_Benutze Smartlinking
 **1d<x>_Definiere das Symbol <x>
 **1d<x>_Definiere das Symbol <x>
 **1D_Erzeuge eine DEF-Datei
 **1D_Erzeuge eine DEF-Datei
+**2DD<x>_Setze die von %DATE% zurück gegebene Datums-Zeichenkette auf x, ohne Überprüfung auf Gültigkeit
 **2Dd<x>_Setze Beschreibung zu <x>
 **2Dd<x>_Setze Beschreibung zu <x>
+**2DT<x>_Setze die von %TIME% zurück gegebene Zeit-Zeichenkette auf x, ohne Überprüfung auf Gültigkeit
 **2Dv<x>_Setze DLL Version zu <x>
 **2Dv<x>_Setze DLL Version zu <x>
 *O2Dw_Erzeuge PM-Anwendung
 *O2Dw_Erzeuge PM-Anwendung
 **1e<x>_Setze Pfad zur ausführbaren Datei
 **1e<x>_Setze Pfad zur ausführbaren Datei
@@ -4007,8 +4049,9 @@ A*2CV<x>_Setze das Section-Threadvar-Modell auf <x>
 **2Fd_Schalte den internen Verzeichnis-Cache des Compilers aus
 **2Fd_Schalte den internen Verzeichnis-Cache des Compilers aus
 **2FD<x>_Setze das Verzeichnis für die Compiler-Hilfsprogramme
 **2FD<x>_Setze das Verzeichnis für die Compiler-Hilfsprogramme
 **2Fe<x>_Leite die Fehlerausgabe um nach <x>
 **2Fe<x>_Leite die Fehlerausgabe um nach <x>
-**2Ff<x>_Ergänze <x> zum Framework-Pfad (nur Darwin)
 **2FE<x>_Setze den Pfad für Exe/Unit-Dateien auf <x>
 **2FE<x>_Setze den Pfad für Exe/Unit-Dateien auf <x>
+**2Ff<x>_Ergänze <x> zum Framework-Pfad (nur Darwin), oder setze IDF-Pfad auf <x> (Xtensa-FreeRTOS)
+**2FF_Benutze fpcres als Übersetzer von RC nach RES anstelle von windres oder gorc
 **2Fi<x>_Ergänze <x> zum Include-Pfad
 **2Fi<x>_Ergänze <x> zum Include-Pfad
 **2Fl<x>_Ergänze <x> zum Bibliotheks-Pfad
 **2Fl<x>_Ergänze <x> zum Bibliotheks-Pfad
 **2FL<x>_Benutze <x> als dynamischen Linker
 **2FL<x>_Benutze <x> als dynamischen Linker
@@ -4122,6 +4165,7 @@ F*2P<x>_Setze den Zielprozessor (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel
 **2SI<x>_Setze den Stil des Interface zu <x>
 **2SI<x>_Setze den Stil des Interface zu <x>
 **3SIcom_COM kompatibles Interface (Voreinstellung)
 **3SIcom_COM kompatibles Interface (Voreinstellung)
 **3SIcorba_CORBA kompatibles Interface
 **3SIcorba_CORBA kompatibles Interface
+**2sT_Erzeuge nur Skript, um auf dem Zielsystem zu linken
 **2Sm_Unterstütze Makros wie in C (global)
 **2Sm_Unterstütze Makros wie in C (global)
 **2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
 **2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
 **2Sr_Transparente Dateinamen im ISO-Modus
 **2Sr_Transparente Dateinamen im ISO-Modus
@@ -4130,8 +4174,8 @@ F*2P<x>_Setze den Zielprozessor (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel
 **2Sx_Exception Schlüsselwörter einschalten (Voreinstellung in Delphi/ObjFPC Moden)
 **2Sx_Exception Schlüsselwörter einschalten (Voreinstellung in Delphi/ObjFPC Moden)
 **2Sy_@<pointer> gibt einen typisierten Zeiger zurück, genau wie $T+
 **2Sy_@<pointer> gibt einen typisierten Zeiger zurück, genau wie $T+
 **1s_Rufe weder Assembler noch Linker auf (nur mit -a)
 **1s_Rufe weder Assembler noch Linker auf (nur mit -a)
-**2sh_Erzeuge Script um auf dem Host zu linken
-**2st_Erzeuge Script um auf dem Zielsystem zu linken
+**2sh_Erzeuge Skript, um auf dem Host zu linken
+**2st_Erzeuge Skript, um auf dem Zielsystem zu assemblieren und zu linken
 **2sr_Überspringe die Phase der "register allocation" (mit -alr benutzen)
 **2sr_Überspringe die Phase der "register allocation" (mit -alr benutzen)
 **1T<x>_Zielbetriebssystem::
 **1T<x>_Zielbetriebssystem::
 # i386 targets
 # i386 targets
@@ -4178,7 +4222,9 @@ F*2P<x>_Setze den Zielprozessor (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel
 6*2Tlinux_Linux
 6*2Tlinux_Linux
 6*2Tnetbsd_NetBSD
 6*2Tnetbsd_NetBSD
 6*2Tmacos_Mac OS
 6*2Tmacos_Mac OS
+6*2Tmacosclassic_Classic Mac OS
 6*2Tpalmos_PalmOS
 6*2Tpalmos_PalmOS
+6*2Tsinclairql_Sinclair QL
 # i8086 targets
 # i8086 targets
 8*2Tembedded_Embedded
 8*2Tembedded_Embedded
 8*2Tmsdos_MS-DOS (und kompatible)
 8*2Tmsdos_MS-DOS (und kompatible)
@@ -4186,10 +4232,10 @@ F*2P<x>_Setze den Zielprozessor (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel
 # arm targets
 # arm targets
 A*2Tandroid_Android
 A*2Tandroid_Android
 A*2Taros_AROS
 A*2Taros_AROS
-A*2Tdarwin_Darwin/iPhoneOS/iOS
 A*2Tembedded_Embedded
 A*2Tembedded_Embedded
 A*2Tfreertos_FreeRTOS
 A*2Tfreertos_FreeRTOS
 A*2Tgba_Game Boy Advance
 A*2Tgba_Game Boy Advance
+A*2Tios_iOS
 A*2Tlinux_Linux
 A*2Tlinux_Linux
 A*2Tnds_Nintendo DS
 A*2Tnds_Nintendo DS
 A*2Tnetbsd_NetBSD
 A*2Tnetbsd_NetBSD
@@ -4198,7 +4244,9 @@ A*2Tsymbian_Symbian
 A*2Twince_Windows CE
 A*2Twince_Windows CE
 # aarch64 targets
 # aarch64 targets
 a*2Tandroid_Android
 a*2Tandroid_Android
-a*2Tdarwin_Darwin/iOS
+a*2Tdarwin_Darwin/Mac OS X
+a*2Tfreebsd_FreeBSD
+a*2Tios_iOS
 a*2Tlinux_Linux
 a*2Tlinux_Linux
 a*2Twin64_Windows 64
 a*2Twin64_Windows 64
 # jvm targets
 # jvm targets
@@ -4218,6 +4266,7 @@ P*2Tdarwin_Darwin und macOS
 P*2Tembedded_Embedded
 P*2Tembedded_Embedded
 P*2Tlinux_Linux
 P*2Tlinux_Linux
 P*2Tmacos_Mac OS (classic)
 P*2Tmacos_Mac OS (classic)
+P*2Tmacosclassic_Classic Mac OS
 P*2Tmorphos_MorphOS
 P*2Tmorphos_MorphOS
 P*2Tnetbsd_NetBSD
 P*2Tnetbsd_NetBSD
 P*2Twii_Wii
 P*2Twii_Wii
@@ -4247,6 +4296,10 @@ x*2Tlinux_Linux
 # z80 targets
 # z80 targets
 Z*2Tembedded_Embedded
 Z*2Tembedded_Embedded
 Z*2Tzxspectrum_ZX Spectrum
 Z*2Tzxspectrum_ZX Spectrum
+Z*2Tmsxdos_MSX-DOS
+# wasm32 targets
+W*2Tembedded_Embedded
+W*2Twasi_Das WebAssembly System Interface (WASI)
 # end of targets section
 # end of targets section
 **1u<x>_Entferne die Definition für das Symbol <x>
 **1u<x>_Entferne die Definition für das Symbol <x>
 **1U<x>_Unit-Optionen:
 **1U<x>_Unit-Optionen:
@@ -4281,9 +4334,10 @@ A*2Wb_Erzeuge statt einer Bibliothek ein Bundle (Darwin)
 3*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
 3*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
 3*2WB<x>_Setze die Imagebasis auf <x> (Windows, Symbian)
 3*2WB<x>_Setze die Imagebasis auf <x> (Windows, Symbian)
 4*2WB_Erzeuge ein relozierbares Image (Windows)
 4*2WB_Erzeuge ein relozierbares Image (Windows)
-4*2WB<x>_Setze die Imagebasis auf <x> (Windows, Symbian)
+4*2WB<x>_Setze die Imagebasis auf <x> (Windows)
 A*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
 A*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
-A*2WB<x>_Setze die Imagebasis auf <x> (Windows)
+A*2WB<x>_Setze die Imagebasis auf <x> (Windows, Symbian)
+Z*2WB<x>_Setze die Imagebasis auf <x> (ZX Spectrum)
 3*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
 3*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
 4*2WC_Spezifiziere "console type application" (Windows)
 4*2WC_Spezifiziere "console type application" (Windows)
 A*2WC_Spezifiziere "console type application" (Windows)
 A*2WC_Spezifiziere "console type application" (Windows)
@@ -4341,10 +4395,14 @@ A*2WR_Erzeuge "relocation code" (Windows)
 8*2Wt<x>_Setze das Format der Ziel-Executable
 8*2Wt<x>_Setze das Format der Ziel-Executable
 8*3Wtexe_Erzeuge eine DOS .EXE Datei (Voreinstellung)
 8*3Wtexe_Erzeuge eine DOS .EXE Datei (Voreinstellung)
 8*3Wtcom_Erzeuge eine DOS .COM Datei (erfordert das winzige (tiny) Speichermodell)
 8*3Wtcom_Erzeuge eine DOS .COM Datei (erfordert das winzige (tiny) Speichermodell)
-P*2WF_Spezifiziere "MPW tool type application" (Classic Mac OS)
+P*2WT_Spezifiziere "MPW tool type application" (Classic Mac OS)
+6*2WQ<x>_Setze das "executable" Metadata-Format (Sinclair QL)
+6*3WQqhdr_Setze Metadata auf QDOS Datei-Header Stil (Voreinstellung)
+6*3WQxtcc_Setze Metadata auf XTcc Stil
 **2WX_Ermögliche den executable stack (Linux)
 **2WX_Ermögliche den executable stack (Linux)
 **1X_Programm-Optionen:
 **1X_Programm-Optionen:
 **2X9_Erzeuge Linkerscript für GNU Binutils ld älter als Version 2.19.1 (Linux)
 **2X9_Erzeuge Linkerscript für GNU Binutils ld älter als Version 2.19.1 (Linux)
+**2Xa_Erzeuge Code, der auf 64-Bit Zielsystemen mehr als 2 GB statische Daten erlaubt (Linux)
 **2Xc_Übergebe --shared an den Linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xc_Übergebe --shared an den Linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xd_Den Standard Bibliotheks-Suchpfad NICHT nutzen (benötigt für cross compile, wenn nicht -XR verwendet wird)
 **2Xd_Den Standard Bibliotheks-Suchpfad NICHT nutzen (benötigt für cross compile, wenn nicht -XR verwendet wird)
 **2Xe_Verwende den externen Linker
 **2Xe_Verwende den externen Linker
@@ -4360,12 +4418,13 @@ L*2XlS<x>_Suffix der LLVM-Programme (z. B. -7, wenn clang clang-7 heißt)
 **2XM<x>_Setze den Namen der 'main' Programm-Routine (Voreinstellung ist 'main')
 **2XM<x>_Setze den Namen der 'main' Programm-Routine (Voreinstellung ist 'main')
 **2Xn_Nutze den plattformeigenen Linker des Zielsystem anstelle des GNU ld (Solaris, AIX)
 **2Xn_Nutze den plattformeigenen Linker des Zielsystem anstelle des GNU ld (Solaris, AIX)
 F*2Xp<x>_Suche nach der Compilerbinary zuerst im Verzeichnis <x>
 F*2Xp<x>_Suche nach der Compilerbinary zuerst im Verzeichnis <x>
-**2XP<x>_Stelle dem Namen der Compiler-Hilfsprogramme (binutils) den Prefix <x> voran
+**2XP<x>_Stelle den Namen der Compiler-Hilfsprogramme (binutils) den Prefix <x> voran
 **2Xr<x>_Setze den rlink-Pfad des Linker zu <x> (benötigt für cross compile, siehe ld-Manual für mehr Informationen) (BeOS, Linux)
 **2Xr<x>_Setze den rlink-Pfad des Linker zu <x> (benötigt für cross compile, siehe ld-Manual für mehr Informationen) (BeOS, Linux)
 **2XR<x>_Stelle allen Linker-Suchpfaden den Namen <x> voran (BeOS, Darwin, FreeBSD, Linux, Mac OS, Solaris)
 **2XR<x>_Stelle allen Linker-Suchpfaden den Namen <x> voran (BeOS, Darwin, FreeBSD, Linux, Mac OS, Solaris)
 **2Xs_Entferne alle Symbole aus der ausführbaren Datei
 **2Xs_Entferne alle Symbole aus der ausführbaren Datei
 **2XS_Versuche Units statisch zu linken (default)    (definiert FPC_LINK_STATIC)
 **2XS_Versuche Units statisch zu linken (default)    (definiert FPC_LINK_STATIC)
 **2Xt_Linke mit statischen Bibliotheken              (-static wird an den Linker übergeben)
 **2Xt_Linke mit statischen Bibliotheken              (-static wird an den Linker übergeben)
+**2Xu_Erzeuge ausführbares Program im UF2-Format     (nur embedded-Zielsysteme)
 **2Xv_Erzeuge eine Tabelle mit den virtuellen Entry-Aufrufen
 **2Xv_Erzeuge eine Tabelle mit den virtuellen Entry-Aufrufen
 **2XV_Benutze VLink als externen linker              (Voreinstellung für Amiga, MorphOS)
 **2XV_Benutze VLink als externen linker              (Voreinstellung für Amiga, MorphOS)
 **2XX_Versuche Units smart zu linken                 (definiert FPC_LINK_SMART)
 **2XX_Versuche Units smart zu linken                 (definiert FPC_LINK_SMART)

+ 97 - 75
compiler/msg/errore.msg

@@ -146,7 +146,7 @@ general_t_unitscope=01027_T_Using unit scope: $1
 #
 #
 # Scanner
 # Scanner
 #
 #
-# 02105 is the last used one
+# 02107 is the last used one
 #
 #
 % \section{Scanner messages.}
 % \section{Scanner messages.}
 % This section lists the messages that the scanner emits. The scanner takes
 % This section lists the messages that the scanner emits. The scanner takes
@@ -433,6 +433,14 @@ scan_w_setpesubsysversion_not_support=02104_W_SETPESUBSYSVERSION is not supporte
 % The \var{\{\$SETPESUBSYSVERSION\}} directive is not supported by the target OS.
 % The \var{\{\$SETPESUBSYSVERSION\}} directive is not supported by the target OS.
 scan_n_changecputype=02105_N_Changed CPU type to be consistent with specified controller
 scan_n_changecputype=02105_N_Changed CPU type to be consistent with specified controller
 scan_e_emptymacroname=02106_E_A macro/compiler variable name cannot be empty
 scan_e_emptymacroname=02106_E_A macro/compiler variable name cannot be empty
+scan_e_unexpected_ifend=02107_E_$IFEND directive found without a matching $IF directive
+% When legacy ifend is turned on by the directive \var{\$LEGACYIFEND}, then the
+% \var{\$IF} directive must be closed by the \var{\$IFEND} directive and the
+% \var{\$IFDEF} directive must be closed by the \var{\$ENDIF} directive.
+scan_e_unexpected_endif=02108_E_$ENDIF directive found without a matching $IF(N)DEF directive
+% When legacy ifend is turned on by the directive \var{\$LEGACYIFEND}, then the
+% \var{\$IF} directive must be closed by the \var{\$IFEND} directive and the
+% \var{\$IFDEF} directive must be closed by the \var{\$ENDIF} directive.
 % \end{description}
 % \end{description}
 #
 #
 # Parser
 # Parser
@@ -2582,7 +2590,7 @@ cg_w_interrupt_does_not_save_registers=06062_W_The target CPU does not support p
 #
 #
 # Assembler reader
 # Assembler reader
 #
 #
-# 07145 is the last used one
+# 07147 is the last used one
 #
 #
 asmr_d_start_reading=07000_DL_Starting $1 styled assembler parsing
 asmr_d_start_reading=07000_DL_Starting $1 styled assembler parsing
 % This informs you that an assembler block is being parsed
 % This informs you that an assembler block is being parsed
@@ -2926,6 +2934,8 @@ asmr_e_invalid_arrangement=07143_E_Invalid arrangement specifier "$1"
 asmr_e_a64_invalid_regset=07144_E_Registers in a register set must be consecutive.
 asmr_e_a64_invalid_regset=07144_E_Registers in a register set must be consecutive.
 asmr_e_unknown_field=07145_E_Unknown field identifier
 asmr_e_unknown_field=07145_E_Unknown field identifier
 % The internal assembler read cannot find the passed field identifier.
 % The internal assembler read cannot find the passed field identifier.
+asmr_e_not_supported_combination_attsuffix_memrefsize_type=07146_E_Not supported combination opcode: $1 - att-suffix-type {$2} and memrefsize-type {$3}
+asmr_e_a64_regset_too_large=07147_E_Too many registers in register set.
 #
 #
 # Assembler/binary writers
 # Assembler/binary writers
 #
 #
@@ -2990,7 +3000,7 @@ asmw_e_illegal_use_of_sp=08036_E_Asm: ESP/RSP cannot be used as index register
 #
 #
 # Executing linker/assembler
 # Executing linker/assembler
 #
 #
-# 09035 is the last used one
+# 09036 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 %
 %
@@ -3051,9 +3061,6 @@ exec_e_exe_not_supported=09018_E_Creation of Executables not supported
 exec_e_dll_not_supported=09019_E_Creation of Dynamic/Shared Libraries not supported
 exec_e_dll_not_supported=09019_E_Creation of Dynamic/Shared Libraries not supported
 % Creating dynamically loadable libraries is not supported for this platform, because it was
 % Creating dynamically loadable libraries is not supported for this platform, because it was
 % not yet implemented in the compiler.
 % not yet implemented in the compiler.
-exec_e_static_lib_not_supported=09035_E_Creation of Static Libraries not supported
-% Creating static libraries is not supported for this platform, because it was
-% not yet implemented in the compiler.
 exec_i_closing_script=09020_I_Closing script $1
 exec_i_closing_script=09020_I_Closing script $1
 % Informational message showing when writing of the external assembling and linking script is finished.
 % Informational message showing when writing of the external assembling and linking script is finished.
 exec_e_res_not_found=09021_E_Resource compiler "$1" not found, switching to external mode
 exec_e_res_not_found=09021_E_Resource compiler "$1" not found, switching to external mode
@@ -3091,6 +3098,12 @@ exec_w_init_file_not_found=09034_W_"$1" not found, this will probably cause a li
 % If the system has gcc installed, running \var{gcc --print-file-name <filename>} might return the path to the file.
 % If the system has gcc installed, running \var{gcc --print-file-name <filename>} might return the path to the file.
 % Add this path in your \var{fpc.cfg} using the switch \var{-Fl} to fix this error. This requires though,
 % Add this path in your \var{fpc.cfg} using the switch \var{-Fl} to fix this error. This requires though,
 % that gcc targets the same target as FPC.
 % that gcc targets the same target as FPC.
+exec_e_static_lib_not_supported=09035_E_Creation of Static Libraries not supported
+% Creating static libraries is not supported for this platform, because it was
+% not yet implemented in the compiler.
+exec_f_controllertype_expected=09036_F_To generate the correct linker call, a controller type must be set by the directive -Wp
+% Xtensa micro controller require a detailed specification linker command which depends on the target controller.
+% If no target controller is set, this command cannot be build and thus linking cannot be carried out.
 %
 %
 %\end{description}
 %\end{description}
 # EndOfTeX
 # EndOfTeX
@@ -3196,7 +3209,7 @@ link_e_undefined_symbol=09222_E_Undefined symbol: $1
 #
 #
 # Unit loading
 # Unit loading
 #
 #
-# 10064 is the last used one
+# 10068 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 % \section{Unit loading messages.}
 % \section{Unit loading messages.}
@@ -3421,13 +3434,15 @@ cg_f_internal_type_does_not_match=10066_F_Internal type "$1" does not look as ex
 unit_u_ppu_llvm_mismatch=10067_U_Skipping unit, PPU and compiler have to be both compiled with or without LLVM support
 unit_u_ppu_llvm_mismatch=10067_U_Skipping unit, PPU and compiler have to be both compiled with or without LLVM support
 % Units compiled by a compiler built with the LLVM code generator cannot be used with a regular compiler,
 % Units compiled by a compiler built with the LLVM code generator cannot be used with a regular compiler,
 % and vice versa.
 % and vice versa.
+unit_u_ppu_invalid_wasm_exceptions_mode=10068_U_PPU is compiled for another WebAssembly exceptions mode
+% This unit file was compiled for a different WebAssembly exceptions mode.
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
 
 
 #
 #
 #  Options
 #  Options
 #
 #
-# 11063 is the last used one
+# 11064 is the last used one
 #
 #
 option_usage=11000_O_$1 [options] <inputfile> [options]
 option_usage=11000_O_$1 [options] <inputfile> [options]
 # BeginOfTeX
 # BeginOfTeX
@@ -3586,6 +3601,8 @@ option_debug_info_requires_external_linker=11061_N_The selected debug format is
 option_valgrind_heaptrc_mismatch=11062_E_You can not use both options ($1) ($2) at same time.
 option_valgrind_heaptrc_mismatch=11062_E_You can not use both options ($1) ($2) at same time.
 option_unsupported_fpu=11063_F_The selected FPU type "$1" is not supported by the selected instruction set "$2"
 option_unsupported_fpu=11063_F_The selected FPU type "$1" is not supported by the selected instruction set "$2"
 % Not all instruction sets support all FPU types. For example on ARM, Thumb(-1) supports no FPU/VFP instruction set
 % Not all instruction sets support all FPU types. For example on ARM, Thumb(-1) supports no FPU/VFP instruction set
+option_too_many_exception_modes=11064_E_Only one WebAssembly exception support mode can be specified.
+% Only one WebAssembly exception support mode (NOEXCEPTIONS, JSEXCEPTIONS, BFEXCEPTIONS or NATIVEEXCEPTIONS) can be specified.
 %\end{description}
 %\end{description}
 # EndOfTeX
 # EndOfTeX
 
 
@@ -3862,7 +3879,7 @@ F*0*_Only options valid for the default or selected platform are listed.
 **0*_Put + after a boolean switch option to enable it, - to disable it.
 **0*_Put + after a boolean switch option to enable it, - to disable it.
 **1@<x>_Read compiler options from <x> in addition to the default fpc.cfg
 **1@<x>_Read compiler options from <x> in addition to the default fpc.cfg
 # Assembler related options
 # Assembler related options
-**1a_The compiler does not delete the generated assembler file
+**1a_The compiler does not delete the generated assembler file, automatically switches to external assembler writer
 **2a5_Don't generate Big Obj COFF files for GNU Binutils older than 2.25 (Windows, NativeNT)
 **2a5_Don't generate Big Obj COFF files for GNU Binutils older than 2.25 (Windows, NativeNT)
 **2al_List sourcecode lines in assembler file
 **2al_List sourcecode lines in assembler file
 **2an_List node info in assembler file (-dEXTDEBUG compiler)
 **2an_List node info in assembler file (-dEXTDEBUG compiler)
@@ -3875,46 +3892,46 @@ F*0*_Only options valid for the default or selected platform are listed.
 **2Adefault_Use default assembler
 **2Adefault_Use default assembler
 3*2Aas_Assemble using GNU AS
 3*2Aas_Assemble using GNU AS
 3*2Aas-darwin_Assemble Darwin Mach-O using GNU GAS
 3*2Aas-darwin_Assemble Darwin Mach-O using GNU GAS
+3*2Acoff_COFF (Go32v2) using internal writer
+3*2Aelf_ELF (Linux) using internal writer
 3*2Amacho_Mach-O (Darwin, Intel 32 bit) using internal writer
 3*2Amacho_Mach-O (Darwin, Intel 32 bit) using internal writer
-8*2Anasm_Assemble using Nasm
-8*2Anasmobj_Assemble using Nasm
+3*2Amasm_Obj file using Masm (Microsoft)
 3*2Anasm_Assemble using Nasm
 3*2Anasm_Assemble using Nasm
 3*2Anasmcoff_COFF (Go32v2) file using Nasm
 3*2Anasmcoff_COFF (Go32v2) file using Nasm
-3*2Anasmelf_ELF32 (Linux) file using Nasm
-3*2Anasmwin32_Win32 object file using Nasm
-3*2Anasmwdosx_Win32/WDOSX object file using Nasm
 3*2Anasmdarwin_macho32 object file using Nasm (experimental)
 3*2Anasmdarwin_macho32 object file using Nasm (experimental)
-3*2Awasm_Obj file using Wasm (Watcom)
+3*2Anasmelf_ELF32 (Linux) file using Nasm
 3*2Anasmobj_Obj file using Nasm
 3*2Anasmobj_Obj file using Nasm
-3*2Amasm_Obj file using Masm (Microsoft)
-3*2Atasm_Obj file using Tasm (Borland)
-3*2Aelf_ELF (Linux) using internal writer
-3*2Acoff_COFF (Go32v2) using internal writer
+3*2Anasmwdosx_Win32/WDOSX object file using Nasm
+3*2Anasmwin32_Win32 object file using Nasm
 3*2Apecoff_PE-COFF (Win32) using internal writer
 3*2Apecoff_PE-COFF (Win32) using internal writer
+3*2Atasm_Obj file using Tasm (Borland)
+3*2Awasm_Obj file using Wasm (Watcom)
 3*2Ayasm_Assemble using Yasm (experimental)
 3*2Ayasm_Assemble using Yasm (experimental)
 4*2Aas_Assemble using GNU AS
 4*2Aas_Assemble using GNU AS
-4*2Agas_Assemble using GNU GAS
 4*2Aas-darwin_Assemble Darwin Mach-O using GNU GAS
 4*2Aas-darwin_Assemble Darwin Mach-O using GNU GAS
-4*2Amasm_Win64 object file using ml64 (Microsoft)
-4*2Apecoff_PE-COFF (Win64) using internal writer
 4*2Aelf_ELF (Linux-64bit) using internal writer
 4*2Aelf_ELF (Linux-64bit) using internal writer
-4*2Ayasm_Assemble using Yasm (experimental)
+4*2Agas_Assemble using GNU GAS
+4*2Amasm_Win64 object file using ml64 (Microsoft)
 4*2Anasm_Assemble using Nasm (experimental)
 4*2Anasm_Assemble using Nasm (experimental)
-4*2Anasmwin64_Assemble Win64 object file using Nasm (experimental)
-4*2Anasmelf_Assemble Linux-64bit object file using Nasm (experimental)
 4*2Anasmdarwin_Assemble darwin macho64 object file using Nasm (experimental)
 4*2Anasmdarwin_Assemble darwin macho64 object file using Nasm (experimental)
+4*2Anasmelf_Assemble Linux-64bit object file using Nasm (experimental)
+4*2Anasmwin64_Assemble Win64 object file using Nasm (experimental)
+4*2Apecoff_PE-COFF (Win64) using internal writer
+4*2Ayasm_Assemble using Yasm (experimental)
 6*2Aas_Unix o-file using GNU AS
 6*2Aas_Unix o-file using GNU AS
 6*2Agas_GNU Motorola assembler
 6*2Agas_GNU Motorola assembler
 6*2Amit_MIT Syntax (old GAS)
 6*2Amit_MIT Syntax (old GAS)
 6*2Amot_Standard Motorola assembler
 6*2Amot_Standard Motorola assembler
 6*2Avasm_Use vasm to assemble
 6*2Avasm_Use vasm to assemble
+8*2Anasm_Assemble using Nasm
+8*2Anasmobj_Assemble using Nasm
 A*2Aas_Assemble using GNU AS
 A*2Aas_Assemble using GNU AS
 A*2Aas-darwin_Assemble using GNU AS for Darwin targets
 A*2Aas-darwin_Assemble using GNU AS for Darwin targets
 A*2Aclang_Assemble using clang
 A*2Aclang_Assemble using clang
 A*2Aelf_Assemble using internal ELF writer
 A*2Aelf_Assemble using internal ELF writer
 a*2Aas_Assemble using GNU AS
 a*2Aas_Assemble using GNU AS
+a*2Aas-clang_Assemble using clang for other targets
 a*2Aclang_Assemble using clang for darwin/ios targets
 a*2Aclang_Assemble using clang for darwin/ios targets
-a*2Aas-clang_Assemble using clang for other targets 
 P*2Aas_Assemble using GNU AS
 P*2Aas_Assemble using GNU AS
 S*2Aas_Assemble using GNU AS
 S*2Aas_Assemble using GNU AS
 s*2Aas_Assemble using GNU AS
 s*2Aas_Assemble using GNU AS
@@ -3924,8 +3941,8 @@ W*2Allvm-mc_Assemble using llvm-mc
 W*2Awabt_Assemble using wasa
 W*2Awabt_Assemble using wasa
 x*2Aas_Assemble using GNU AS
 x*2Aas_Assemble using GNU AS
 Z*2Asdcc-sdasz80_Assemble using SDCC-SDASZ80
 Z*2Asdcc-sdasz80_Assemble using SDCC-SDASZ80
-Z*2Az80asm_Assemble using z80asm
 Z*2Avasm_Assemble using Vasm
 Z*2Avasm_Assemble using Vasm
+Z*2Az80asm_Assemble using z80asm
 # Used only internally by IDE
 # Used only internally by IDE
 **1b_Generate browser info
 **1b_Generate browser info
 **2bl_Generate local symbol info
 **2bl_Generate local symbol info
@@ -3954,9 +3971,9 @@ P*2CN_Generate nil-pointer checks (AIX-only)
 **2CO_Check for possible overflow of integer operations
 **2CO_Check for possible overflow of integer operations
 **2Cp<x>_Select instruction set; see fpc -i or fpc -ic for possible values
 **2Cp<x>_Select instruction set; see fpc -i or fpc -ic for possible values
 **2CP<x>=<y>_ packing settings
 **2CP<x>=<y>_ packing settings
-**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 and 8
 **3CPPACKENUM=<y>_ <y> enum packing: 0, 1, 2 and 4 or DEFAULT or NORMAL
 **3CPPACKENUM=<y>_ <y> enum packing: 0, 1, 2 and 4 or DEFAULT or NORMAL
 **3CPPACKRECORD=<y>_ <y> record packing: 0 or DEFAULT or NORMAL, 1, 2, 4, 8, 16 and 32
 **3CPPACKRECORD=<y>_ <y> record packing: 0 or DEFAULT or NORMAL, 1, 2, 4, 8, 16 and 32
+**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 and 8
 **2Cr_Range checking
 **2Cr_Range checking
 **2CR_Verify object method call validity
 **2CR_Verify object method call validity
 **2Cs<n>_Set stack checking size to <n>
 **2Cs<n>_Set stack checking size to <n>
@@ -3968,6 +3985,7 @@ p*2CT<x>_Target-specific code generation options
 P*2CT<x>_Target-specific code generation options
 P*2CT<x>_Target-specific code generation options
 J*2CT<x>_Target-specific code generation options
 J*2CT<x>_Target-specific code generation options
 A*2CT<x>_Target-specific code generation options
 A*2CT<x>_Target-specific code generation options
+W*2CT<x>_Target-specific code generation options
 p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
 p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
 P*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
 P*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
 J*3CTautogetterprefix=X_  Automatically create getters for properties with prefix X (empty string disables)
 J*3CTautogetterprefix=X_  Automatically create getters for properties with prefix X (empty string disables)
@@ -3981,13 +3999,17 @@ J*3CTenumfieldinit_       Initialize enumeration fields in constructors to enumt
 J*3CTinitlocals_          Initialize local variables that trigger a JVM bytecode verification error if used uninitialized (slows down code)
 J*3CTinitlocals_          Initialize local variables that trigger a JVM bytecode verification error if used uninitialized (slows down code)
 J*3CTlowercaseprocstart_  Lowercase the first character of procedure/function/method names
 J*3CTlowercaseprocstart_  Lowercase the first character of procedure/function/method names
 A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possible
 A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possible
+W*3CTnoexceptions_        Disable the exception support. Raising an exception will abort the program.
+W*3CTbfexceptions_        Enable the branchful exception support for WebAssembly
+W*3CTjsexceptions_        Enable the JavaScript-based exception support for WebAssembly
+W*3CTwasmexceptions_      Enable the native WebAssembly exceptions support
 J*2Cv_Var/out parameter copy-out checking
 J*2Cv_Var/out parameter copy-out checking
 A*2CV<x>_Set section threadvar model to <x>
 A*2CV<x>_Set section threadvar model to <x>
 **2CX_Create also smartlinked library
 **2CX_Create also smartlinked library
 **1d<x>_Defines the symbol <x>
 **1d<x>_Defines the symbol <x>
 **1D_Generate a DEF file
 **1D_Generate a DEF file
-**2DD<x>_Set the date string returned by %DATE% to x, it is not checked for being a valid date string
 **2Dd<x>_Set description to <x>
 **2Dd<x>_Set description to <x>
+**2DD<x>_Set the date string returned by %DATE% to x, it is not checked for being a valid date string
 **2DT<x>_Set the time string returned by %TIME% to x, it is not checked for being a valid time string
 **2DT<x>_Set the time string returned by %TIME% to x, it is not checked for being a valid time string
 **2Dv<x>_Set DLL version to <x>
 **2Dv<x>_Set DLL version to <x>
 *O2Dw_PM application
 *O2Dw_PM application
@@ -4015,19 +4037,19 @@ A*2CV<x>_Set section threadvar model to <x>
 **2FR<x>_Set resource (.res) linker to <x>
 **2FR<x>_Set resource (.res) linker to <x>
 **2Fu<x>_Add <x> to unit path
 **2Fu<x>_Add <x> to unit path
 **2FU<x>_Set unit output path to <x>, overrides -FE
 **2FU<x>_Set unit output path to <x>, overrides -FE
-**2FW<x>_Store generated whole-program optimization feedback in <x>
 **2Fw<x>_Load previously stored whole-program optimization feedback from <x>
 **2Fw<x>_Load previously stored whole-program optimization feedback from <x>
+**2FW<x>_Store generated whole-program optimization feedback in <x>
 *g1g_Generate debug information (default format for target)
 *g1g_Generate debug information (default format for target)
 *g2gc_Generate checks for pointers (experimental, only available on some targets, might generate false positive)
 *g2gc_Generate checks for pointers (experimental, only available on some targets, might generate false positive)
 *g2gh_Use heaptrace unit (for memory leak/corruption debugging)
 *g2gh_Use heaptrace unit (for memory leak/corruption debugging)
 *g2gl_Use line info unit (show more info with backtraces)
 *g2gl_Use line info unit (show more info with backtraces)
 *g2gm_Generate Microsoft CodeView debug information (experimental)
 *g2gm_Generate Microsoft CodeView debug information (experimental)
 *g2go<x>_Set debug information options
 *g2go<x>_Set debug information options
-*g3godwarfsets_ Enable DWARF 'set' type debug information (breaks gdb < 6.5)
-*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs
-*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class name
 *g3godwarfcpp_ Simulate C++ debug information in DWARF
 *g3godwarfcpp_ Simulate C++ debug information in DWARF
+*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class name
 *g3godwarfomflinnum_ Generate line number information in OMF LINNUM records in MS LINK format in addition to the DWARF debug information (Open Watcom Debugger/Linker compatibility)
 *g3godwarfomflinnum_ Generate line number information in OMF LINNUM records in MS LINK format in addition to the DWARF debug information (Open Watcom Debugger/Linker compatibility)
+*g3godwarfsets_ Enable DWARF 'set' type debug information (breaks gdb < 6.5)
+*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs
 *g2gp_Preserve case in stabs symbol names
 *g2gp_Preserve case in stabs symbol names
 *g2gs_Generate Stabs debug information
 *g2gs_Generate Stabs debug information
 *g2gt_Trash local variables (to detect uninitialized uses; multiple 't' changes the trashing value)
 *g2gt_Trash local variables (to detect uninitialized uses; multiple 't' changes the trashing value)
@@ -4037,36 +4059,36 @@ A*2CV<x>_Set section threadvar model to <x>
 *g2gw3_Generate DWARFv3 debug information
 *g2gw3_Generate DWARFv3 debug information
 *g2gw4_Generate DWARFv4 debug information (experimental)
 *g2gw4_Generate DWARFv4 debug information (experimental)
 **1i_Information
 **1i_Information
-**2iD_Return compiler date
-**2iSO_Return compiler OS
-**2iSP_Return compiler host processor
-**2iTO_Return target OS
-**2iTP_Return target processor
-**2iV_Return short compiler version
-**2iW_Return full compiler version
 **2ia_Return list of supported ABI targets
 **2ia_Return list of supported ABI targets
 **2ib_Return the used code generation backend type
 **2ib_Return the used code generation backend type
 **2ic_Return list of supported CPU instruction sets
 **2ic_Return list of supported CPU instruction sets
+**2iD_Return compiler date
 **2if_Return list of supported FPU instruction sets
 **2if_Return list of supported FPU instruction sets
 **2ii_Return list of supported inline assembler modes
 **2ii_Return list of supported inline assembler modes
 **2im_Return list of supported modeswitches
 **2im_Return list of supported modeswitches
 **2io_Return list of supported optimizations
 **2io_Return list of supported optimizations
 **2ir_Return list of recognized compiler and RTL features
 **2ir_Return list of recognized compiler and RTL features
+**2iSO_Return compiler OS
+**2iSP_Return compiler host processor
 **2it_Return list of supported targets
 **2it_Return list of supported targets
+**2iTO_Return target OS
+**2iTP_Return target processor
 **2iu_Return list of supported microcontroller types
 **2iu_Return list of supported microcontroller types
+**2iV_Return short compiler version
 **2iw_Return list of supported whole program optimizations
 **2iw_Return list of supported whole program optimizations
+**2iW_Return full compiler version
 **1I<x>_Add <x> to include path
 **1I<x>_Add <x> to include path
 **1k<x>_Pass <x> to the linker
 **1k<x>_Pass <x> to the linker
 **1l_Write logo
 **1l_Write logo
 **1M<x>_Set language mode to <x> / enable modeswitch <x> (see option -im)
 **1M<x>_Set language mode to <x> / enable modeswitch <x> (see option -im)
+**2Mdelphi_Delphi 7 compatibility mode
+**2Mdelphiunicode_Delphi 2009 and later compatibility mode
+**2Mextendedpascal_ISO 10206 mode
 **2Mfpc_Free Pascal dialect (default)
 **2Mfpc_Free Pascal dialect (default)
+**2Miso_ISO 7185 mode
+**2Mmacpas_Macintosh Pascal dialects compatibility mode
 **2Mobjfpc_FPC mode with Object Pascal support
 **2Mobjfpc_FPC mode with Object Pascal support
-**2Mdelphi_Delphi 7 compatibility mode
 **2Mtp_TP/BP 7.0 compatibility mode
 **2Mtp_TP/BP 7.0 compatibility mode
-**2Mmacpas_Macintosh Pascal dialects compatibility mode
-**2Miso_ISO 7185 mode
-**2Mextendedpascal_ISO 10206 mode
-**2Mdelphiunicode_Delphi 2009 and later compatibility mode
 **2*_Each mode (as listed above) enables its default set of modeswitches.
 **2*_Each mode (as listed above) enables its default set of modeswitches.
 **2*_Other modeswitches are disabled and need to be enabled one by another.
 **2*_Other modeswitches are disabled and need to be enabled one by another.
 **1M<x>-_Disable modeswitch <x> (see option -im)
 **1M<x>-_Disable modeswitch <x> (see option -im)
@@ -4081,9 +4103,9 @@ A*2CV<x>_Set section threadvar model to <x>
 **2Oa<x>=<y>_Set alignment
 **2Oa<x>=<y>_Set alignment
 **2Oo[NO]<x>_Enable or disable optimizations; see fpc -i or fpc -io for possible values
 **2Oo[NO]<x>_Enable or disable optimizations; see fpc -i or fpc -io for possible values
 **2Op<x>_Set target cpu for optimizing; see fpc -i or fpc -ic for possible values
 **2Op<x>_Set target cpu for optimizing; see fpc -i or fpc -ic for possible values
-**2OW<x>_Generate whole-program optimization feedback for optimization <x>; see fpc -i or fpc -iw for possible values
-**2Ow<x>_Perform whole-program optimization <x>; see fpc -i or fpc -iw for possible values
 **2Os_Optimize for size rather than speed
 **2Os_Optimize for size rather than speed
+**2Ow<x>_Perform whole-program optimization <x>; see fpc -i or fpc -iw for possible values
+**2OW<x>_Generate whole-program optimization feedback for optimization <x>; see fpc -i or fpc -iw for possible values
 **1pg_Generate profile code for gprof (defines FPC_PROFILE)
 **1pg_Generate profile code for gprof (defines FPC_PROFILE)
 F*1P<x>_Target CPU / compiler related options:
 F*1P<x>_Target CPU / compiler related options:
 F*2PB_Show default compiler binary
 F*2PB_Show default compiler binary
@@ -4098,26 +4120,30 @@ F*2P<x>_Set target CPU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel,powerpc,
 8*2Ratt_Read AT&T style assembler
 8*2Ratt_Read AT&T style assembler
 8*2Rintel_Read Intel style assembler
 8*2Rintel_Read Intel style assembler
 6*2RMOT_Read Motorola style assembler
 6*2RMOT_Read Motorola style assembler
+**1s_Do not call assembler and linker
+**2sh_Generate script to link on host, automatically switches to external assembler writer
+**2sr_Skip register allocation phase (use with -alr), automatically switches to external assembler writer
+**2st_Generate script to assemble and link on target, automatically switches to external assembler writer
+**2sT_Generate script only to link on target
 **1S<x>_Syntax options:
 **1S<x>_Syntax options:
 **2S2_Same as -Mobjfpc
 **2S2_Same as -Mobjfpc
-**2Sc_Support operators like C (*=,+=,/= and -=)
 **2Sa_Turn on assertions
 **2Sa_Turn on assertions
+**2Sc_Support operators like C (*=,+=,/= and -=)
 **2Sd_Same as -Mdelphi
 **2Sd_Same as -Mdelphi
 **2Se<x>_Error options. <x> is a combination of the following:
 **2Se<x>_Error options. <x> is a combination of the following:
 **3*_<n> : Compiler halts after the <n> errors (default is 1)
 **3*_<n> : Compiler halts after the <n> errors (default is 1)
-**3*_w : Compiler also halts after warnings
-**3*_n : Compiler also halts after notes
 **3*_h : Compiler also halts after hints
 **3*_h : Compiler also halts after hints
+**3*_n : Compiler also halts after notes
+**3*_w : Compiler also halts after warnings
 **2Sf_Enable certain features in compiler and RTL; see fpc -i or fpc -ir for possible values)
 **2Sf_Enable certain features in compiler and RTL; see fpc -i or fpc -ir for possible values)
 **2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)
 **2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)
 **2Sh_Use reference counted strings (ansistring by default) instead of shortstrings
 **2Sh_Use reference counted strings (ansistring by default) instead of shortstrings
 **2Si_Turn on inlining of procedures/functions declared as "inline"
 **2Si_Turn on inlining of procedures/functions declared as "inline"
-**2Sj_Allows typed constants to be writeable (default in all modes)
-**2Sk_Load fpcylix unit
 **2SI<x>_Set interface style to <x>
 **2SI<x>_Set interface style to <x>
 **3SIcom_COM compatible interface (default)
 **3SIcom_COM compatible interface (default)
 **3SIcorba_CORBA compatible interface
 **3SIcorba_CORBA compatible interface
-**2sT_Generate script only to link on target
+**2Sj_Allows typed constants to be writeable (default in all modes)
+**2Sk_Load fpcylix unit
 **2Sm_Support macros like C (global)
 **2Sm_Support macros like C (global)
 **2So_Same as -Mtp
 **2So_Same as -Mtp
 **2Sr_Transparent file names in ISO mode
 **2Sr_Transparent file names in ISO mode
@@ -4125,10 +4151,6 @@ F*2P<x>_Set target CPU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel,powerpc,
 **2Sv_Support vector processing (use CPU vector extensions if available)
 **2Sv_Support vector processing (use CPU vector extensions if available)
 **2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)
 **2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)
 **2Sy_@<pointer> returns a typed pointer, same as $T+
 **2Sy_@<pointer> returns a typed pointer, same as $T+
-**1s_Do not call assembler and linker
-**2sh_Generate script to link on host
-**2st_Generate script to assemble and link on target
-**2sr_Skip register allocation phase (use with -alr)
 **1T<x>_Target operating system:
 **1T<x>_Target operating system:
 # i386 targets
 # i386 targets
 3*2Tandroid_Android
 3*2Tandroid_Android
@@ -4148,8 +4170,8 @@ F*2P<x>_Set target CPU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel,powerpc,
 3*2Tnetwlibc_Novell Netware Module (libc)
 3*2Tnetwlibc_Novell Netware Module (libc)
 3*2Topenbsd_OpenBSD
 3*2Topenbsd_OpenBSD
 3*2Tos2_OS/2 / eComStation
 3*2Tos2_OS/2 / eComStation
-3*2Tsymbian_Symbian OS
 3*2Tsolaris_Solaris
 3*2Tsolaris_Solaris
+3*2Tsymbian_Symbian OS
 3*2Twatcom_Watcom compatible DOS extender
 3*2Twatcom_Watcom compatible DOS extender
 3*2Twdosx_WDOSX DOS extender
 3*2Twdosx_WDOSX DOS extender
 3*2Twin32_Windows 32 Bit
 3*2Twin32_Windows 32 Bit
@@ -4227,11 +4249,11 @@ p*2Tdarwin_Darwin/Mac OS X
 p*2Tembedded_Embedded
 p*2Tembedded_Embedded
 p*2Tlinux_Linux
 p*2Tlinux_Linux
 # riscv32 targets
 # riscv32 targets
-R*2Tlinux_Linux
 R*2Tembedded_Embedded
 R*2Tembedded_Embedded
+R*2Tlinux_Linux
 # riscv64 targets
 # riscv64 targets
-r*2Tlinux_Linux
 r*2Tembedded_Embedded
 r*2Tembedded_Embedded
+r*2Tlinux_Linux
 # sparc targets
 # sparc targets
 S*2Tlinux_Linux
 S*2Tlinux_Linux
 S*2Tsolaris_Solaris
 S*2Tsolaris_Solaris
@@ -4246,8 +4268,8 @@ x*2Tfreertos_FreeRTOS
 x*2Tlinux_Linux
 x*2Tlinux_Linux
 # z80 targets
 # z80 targets
 Z*2Tembedded_Embedded
 Z*2Tembedded_Embedded
-Z*2Tzxspectrum_ZX Spectrum
 Z*2Tmsxdos_MSX-DOS
 Z*2Tmsxdos_MSX-DOS
+Z*2Tzxspectrum_ZX Spectrum
 # wasm32 targets
 # wasm32 targets
 W*2Tembedded_Embedded
 W*2Tembedded_Embedded
 W*2Twasi_The WebAssembly System Interface (WASI)
 W*2Twasi_The WebAssembly System Interface (WASI)
@@ -4258,18 +4280,18 @@ W*2Twasi_The WebAssembly System Interface (WASI)
 **2Ur_Generate release unit files (never automatically recompiled)
 **2Ur_Generate release unit files (never automatically recompiled)
 **2Us_Compile a system unit
 **2Us_Compile a system unit
 **1v<x>_Be verbose. <x> is a combination of the following letters:
 **1v<x>_Be verbose. <x> is a combination of the following letters:
-**2*_e : Show errors (default)       0 : Show nothing (except errors)
-**2*_w : Show warnings               u : Show unit info
-**2*_n : Show notes                  t : Show tried/used files
-**2*_h : Show hints                  c : Show conditionals
-**2*_i : Show general info           d : Show debug info
-**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode
-**2*_s : Show time stamps            q : Show message numbers
-**2*_a : Show everything             x : Show info about invoked tools
-**2*_b : Write file names messages   p : Write tree.log with parse tree
-**2*_    with full path              v : Write fpcdebug.txt with
-**2*_z : Write output to stderr          lots of debugging info
+**2*_0 : Show nothing (except errors) p : Write tree.log with parse tree
+**2*_a : Show everything              q : Show message numbers
+**2*_b : Write file names messages    r : Rhide/GCC compatibility mode
+**2*_    with full path               s : Show time stamps
+**2*_c : Show conditionals            t : Show tried/used files
+**2*_d : Show debug info              u : Show unit info
+**2*_e : Show errors (default)        v : Write fpcdebug.txt with
+**2*_h : Show hints                       lots of debugging info
+**2*_i : Show general info            w : Show warnings
+**2*_l : Show linenumbers             x : Show info about invoked tools
 **2*_m<x>,<y> : Do not show messages numbered <x> and <y>
 **2*_m<x>,<y> : Do not show messages numbered <x> and <y>
+**2*_n : Show notes                   z : Write output to stderr
 F*1V<x>_Append '-<x>' to the used compiler binary name (e.g. for version)
 F*1V<x>_Append '-<x>' to the used compiler binary name (e.g. for version)
 **1W<x>_Target-specific options (targets)
 **1W<x>_Target-specific options (targets)
 3*2WA_Specify native type application (Windows)
 3*2WA_Specify native type application (Windows)
@@ -4343,8 +4365,8 @@ A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)
 4*2WR_Generate relocation code (Windows)
 4*2WR_Generate relocation code (Windows)
 A*2WR_Generate relocation code (Windows)
 A*2WR_Generate relocation code (Windows)
 8*2Wt<x>_Set the target executable format
 8*2Wt<x>_Set the target executable format
-8*3Wtexe_Create a DOS .EXE file (default)
 8*3Wtcom_Create a DOS .COM file (requires tiny memory model)
 8*3Wtcom_Create a DOS .COM file (requires tiny memory model)
+8*3Wtexe_Create a DOS .EXE file (default)
 P*2WT_Specify MPW tool type application (Classic Mac OS)
 P*2WT_Specify MPW tool type application (Classic Mac OS)
 6*2WQ<x>_Set executable metadata format (Sinclair QL)
 6*2WQ<x>_Set executable metadata format (Sinclair QL)
 6*3WQqhdr_Set metadata to QDOS File Header style (default)
 6*3WQqhdr_Set metadata to QDOS File Header style (default)
@@ -4355,15 +4377,15 @@ P*2WT_Specify MPW tool type application (Classic Mac OS)
 **2Xa_Generate code which allows to use more than 2 GB static data on 64 Bit targets (Linux)
 **2Xa_Generate code which allows to use more than 2 GB static data on 64 Bit targets (Linux)
 **2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xd_Do not search default library path (sometimes required for cross-compiling when not using -XR)
 **2Xd_Do not search default library path (sometimes required for cross-compiling when not using -XR)
+**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)
 **2Xe_Use external linker
 **2Xe_Use external linker
 **2Xf_Substitute pthread library name for linking (BSD)
 **2Xf_Substitute pthread library name for linking (BSD)
 **2Xg_Create debuginfo in a separate file and add a debuglink section to executable
 **2Xg_Create debuginfo in a separate file and add a debuglink section to executable
-**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)
 **2Xi_Use internal linker
 **2Xi_Use internal linker
 L*2XlS<x>_LLVM utilties suffix (e.g. -7 in case clang is called clang-7)
 L*2XlS<x>_LLVM utilties suffix (e.g. -7 in case clang is called clang-7)
 **2XLA_Define library substitutions for linking
 **2XLA_Define library substitutions for linking
-**2XLO_Define order of library linking
 **2XLD_Exclude default order of standard libraries
 **2XLD_Exclude default order of standard libraries
+**2XLO_Define order of library linking
 **2Xm_Generate link map
 **2Xm_Generate link map
 **2XM<x>_Set the name of the 'main' program routine (default is 'main')
 **2XM<x>_Set the name of the 'main' program routine (default is 'main')
 **2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)
 **2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)

+ 1 - 1
compiler/msg/errores.msg

@@ -2502,7 +2502,7 @@ asmr_d_finish_reading=07001_DL_Finalizado interpretado de ensamblador de estilo
 asmr_e_none_label_contain_at=07002_E_Una patrón que no es una etiqueta contiene @
 asmr_e_none_label_contain_at=07002_E_Una patrón que no es una etiqueta contiene @
 % A identifier which isn't a label can't contain a @.
 % A identifier which isn't a label can't contain a @.
 asmr_e_building_record_offset=07004_E_Error construyendo desplazamiento de registro (record)
 asmr_e_building_record_offset=07004_E_Error construyendo desplazamiento de registro (record)
-% There has an error occured while building the offset of a record/object
+% An error occurred while building the offset of a record/object
 % structure, this can happend when there is no field specified at all or
 % structure, this can happend when there is no field specified at all or
 % an unknown field identifier is used.
 % an unknown field identifier is used.
 asmr_e_offset_without_identifier=07005_E_OFFSET usado sin identificador
 asmr_e_offset_without_identifier=07005_E_OFFSET usado sin identificador

+ 1 - 1
compiler/msg/errorf.msg

@@ -1334,7 +1334,7 @@ asmr_e_none_label_contain_at=07002_E_Non-label pattern contains @
 asmr_w_override_op_not_supported=07003_W_Override operator not supported
 asmr_w_override_op_not_supported=07003_W_Override operator not supported
 % The Override operator is not supported
 % The Override operator is not supported
 asmr_e_building_record_offset=07004_E_Error building record offset
 asmr_e_building_record_offset=07004_E_Error building record offset
-% There has an error occured while building the offset of a record/object
+% An error occurred while building the offset of a record/object
 % structure, this can happend when there is no field specified at all or
 % structure, this can happend when there is no field specified at all or
 % an unknown field identifier is used.
 % an unknown field identifier is used.
 asmr_e_offset_without_identifier=07005_E_OFFSET used without identifier
 asmr_e_offset_without_identifier=07005_E_OFFSET used without identifier

+ 1 - 1
compiler/msg/errorfi.msg

@@ -2517,7 +2517,7 @@ asmr_d_finish_reading=07001_DL_Analyse assembleur de style $1 termin
 asmr_e_none_label_contain_at=07002_E_Un identificateur qui n'est pas un label contient @
 asmr_e_none_label_contain_at=07002_E_Un identificateur qui n'est pas un label contient @
 % A identifier which isn't a label can't contain a @.
 % A identifier which isn't a label can't contain a @.
 asmr_e_building_record_offset=07004_E_Erreur de construction de l'offset du record
 asmr_e_building_record_offset=07004_E_Erreur de construction de l'offset du record
-% There has an error occured while building the offset of a record/object
+% An error occurred while building the offset of a record/object
 % structure, this can happend when there is no field specified at all or
 % structure, this can happend when there is no field specified at all or
 % an unknown field identifier is used.
 % an unknown field identifier is used.
 asmr_e_offset_without_identifier=07005_E_OFFSET utilisé sans identificateur
 asmr_e_offset_without_identifier=07005_E_OFFSET utilisé sans identificateur

+ 1 - 1
compiler/msg/errorhe.msg

@@ -1730,7 +1730,7 @@ asmr_d_finish_reading=07001_DL_
 asmr_e_none_label_contain_at=07002_E_úáðéú ììà úååéú îëéìä àú äúå @
 asmr_e_none_label_contain_at=07002_E_úáðéú ììà úååéú îëéìä àú äúå @
 % A identifier which isn't a label can't contain a @.
 % A identifier which isn't a label can't contain a @.
 asmr_e_building_record_offset=07004_E_ùâéàä ááðééú äéñè äøùåîä
 asmr_e_building_record_offset=07004_E_ùâéàä ááðééú äéñè äøùåîä
-% There has an error occured while building the offset of a record/object
+% An error occurred while building the offset of a record/object
 % structure, this can happend when there is no field specified at all or
 % structure, this can happend when there is no field specified at all or
 % an unknown field identifier is used.
 % an unknown field identifier is used.
 asmr_e_offset_without_identifier=07005_E_ðòùä ùéîåù áOFFSET ììà îæää
 asmr_e_offset_without_identifier=07005_E_ðòùä ùéîåù áOFFSET ììà îæää

+ 1 - 1
compiler/msg/errorheu.msg

@@ -2508,7 +2508,7 @@ asmr_d_finish_reading=07001_DL_הסתיים ניתוח סגנון אסמבלר $
 asmr_e_none_label_contain_at=07002_E_תבנית ללא תווית מכילה את התו @
 asmr_e_none_label_contain_at=07002_E_תבנית ללא תווית מכילה את התו @
 % A identifier which isn't a label can't contain a @.
 % A identifier which isn't a label can't contain a @.
 asmr_e_building_record_offset=07004_E_שגיאה בבניית היסט הרשומה
 asmr_e_building_record_offset=07004_E_שגיאה בבניית היסט הרשומה
-% There has an error occured while building the offset of a record/object
+% An error occurred while building the offset of a record/object
 % structure, this can happend when there is no field specified at all or
 % structure, this can happend when there is no field specified at all or
 % an unknown field identifier is used.
 % an unknown field identifier is used.
 asmr_e_offset_without_identifier=07005_E_נעשה שימוש בOFFSET ללא מזהה
 asmr_e_offset_without_identifier=07005_E_נעשה שימוש בOFFSET ללא מזהה

+ 1 - 1
compiler/msg/erroriu.msg

@@ -1870,7 +1870,7 @@ asmr_d_finish_reading=07001_DL_Fine analisi assembler stile $1
 asmr_e_none_label_contain_at=07002_E_Il pattern contiene @ ma non è una label
 asmr_e_none_label_contain_at=07002_E_Il pattern contiene @ ma non è una label
 % A identifier which isn't a label can't contain a @.
 % A identifier which isn't a label can't contain a @.
 asmr_e_building_record_offset=07004_E_Errore nella costruzione dell'offset di un record
 asmr_e_building_record_offset=07004_E_Errore nella costruzione dell'offset di un record
-% There has an error occured while building the offset of a record/object
+% An error occurred while building the offset of a record/object
 % structure, this can happend when there is no field specified at all or
 % structure, this can happend when there is no field specified at all or
 % an unknown field identifier is used.
 % an unknown field identifier is used.
 asmr_e_offset_without_identifier=07005_E_usato OFFSET senza identificatore
 asmr_e_offset_without_identifier=07005_E_usato OFFSET senza identificatore

+ 1 - 1
compiler/msg/errorn.msg

@@ -2511,7 +2511,7 @@ asmr_d_finish_reading=07001_DL_Gedaan met verwerken van $1 assembler
 asmr_e_none_label_contain_at=07002_E_Symbool dat geen label is bevat "@"
 asmr_e_none_label_contain_at=07002_E_Symbool dat geen label is bevat "@"
 % A identifier which isn't a label can't contain a @.
 % A identifier which isn't a label can't contain a @.
 asmr_e_building_record_offset=07004_E_Fout bij berekenen offset in record
 asmr_e_building_record_offset=07004_E_Fout bij berekenen offset in record
-% There has an error occured while building the offset of a record/object
+% An error occurred while building the offset of a record/object
 % structure, this can happend when there is no field specified at all or
 % structure, this can happend when there is no field specified at all or
 % an unknown field identifier is used.
 % an unknown field identifier is used.
 asmr_e_offset_without_identifier=07005_E_OFFSET gebruikt zonder symbool
 asmr_e_offset_without_identifier=07005_E_OFFSET gebruikt zonder symbool

Some files were not shown because too many files changed in this diff