瀏覽代碼

* synchronised with r28168 of trunk

git-svn-id: branches/hlcgllvm@28169 -
Jonas Maebe 11 年之前
父節點
當前提交
7949bebb8d
共有 100 個文件被更改,包括 3494 次插入2683 次删除
  1. 68 8
      .gitattributes
  2. 42 6
      compiler/Makefile
  3. 1 1
      compiler/Makefile.fpc
  4. 5 1
      compiler/aasmbase.pas
  5. 9 3
      compiler/aggas.pas
  6. 10 1
      compiler/arm/aoptcpu.pas
  7. 90 4
      compiler/arm/cgcpu.pas
  8. 140 73
      compiler/arm/cpuinfo.pas
  9. 12 0
      compiler/arm/narminl.pas
  10. 12 4
      compiler/arm/narmmat.pas
  11. 4 0
      compiler/arm/rgcpu.pas
  12. 70 0
      compiler/cgobj.pas
  13. 101 0
      compiler/cgutils.pas
  14. 3 1
      compiler/dbgbase.pas
  15. 37 0
      compiler/defcmp.pas
  16. 20 2
      compiler/defutil.pas
  17. 7 15
      compiler/finput.pas
  18. 22 17
      compiler/fmodule.pas
  19. 1 0
      compiler/fpcdefs.inc
  20. 1 0
      compiler/globals.pas
  21. 3 1
      compiler/globtype.pas
  22. 10 4
      compiler/hlcg2ll.pas
  23. 0 29
      compiler/i386/i386att.inc
  24. 0 29
      compiler/i386/i386atts.inc
  25. 0 29
      compiler/i386/i386int.inc
  26. 0 29
      compiler/i386/i386op.inc
  27. 0 29
      compiler/i386/i386prop.inc
  28. 27 275
      compiler/i386/n386mat.pas
  29. 1 1
      compiler/i8086/cpunode.pas
  30. 19 4
      compiler/i8086/hlcgcpu.pas
  31. 0 15
      compiler/i8086/i8086att.inc
  32. 0 15
      compiler/i8086/i8086atts.inc
  33. 0 15
      compiler/i8086/i8086int.inc
  34. 0 15
      compiler/i8086/i8086op.inc
  35. 0 15
      compiler/i8086/i8086prop.inc
  36. 94 2
      compiler/i8086/n8086add.pas
  37. 73 0
      compiler/i8086/n8086inl.pas
  38. 127 0
      compiler/i8086/n8086util.pas
  39. 0 290
      compiler/jvm/pjvm.pas
  40. 383 2
      compiler/jvm/symcpu.pas
  41. 1 0
      compiler/m68k/aasmcpu.pas
  42. 36 3
      compiler/m68k/aoptcpu.pas
  43. 190 298
      compiler/m68k/cgcpu.pas
  44. 4 3
      compiler/m68k/cpubase.pas
  45. 1 1
      compiler/m68k/cpunode.pas
  46. 63 191
      compiler/m68k/cpupara.pas
  47. 8 0
      compiler/m68k/cputarg.pas
  48. 15 133
      compiler/m68k/n68kadd.pas
  49. 51 99
      compiler/m68k/n68kmat.pas
  50. 36 19
      compiler/m68k/n68kmem.pas
  51. 352 4
      compiler/mips/aoptcpu.pas
  52. 24 1
      compiler/mips/cgcpu.pas
  53. 11 1
      compiler/mips/cpubase.pas
  54. 1 19
      compiler/mips/cpugas.pas
  55. 1 1
      compiler/mips/cpuinfo.pas
  56. 12 9
      compiler/mips/mipsreg.dat
  57. 14 9
      compiler/mips/ncpumat.pas
  58. 16 0
      compiler/mips/opcode.inc
  59. 5 1
      compiler/mips/racpugas.pas
  60. 0 31
      compiler/mips/rgcpu.pas
  61. 8 9
      compiler/mips/rmipscon.inc
  62. 7 8
      compiler/mips/rmipsdwf.inc
  63. 8 9
      compiler/mips/rmipsgas.inc
  64. 4 5
      compiler/mips/rmipsgri.inc
  65. 1 1
      compiler/mips/rmipsnor.inc
  66. 8 9
      compiler/mips/rmipsnum.inc
  67. 1 2
      compiler/mips/rmipsrni.inc
  68. 4 5
      compiler/mips/rmipssri.inc
  69. 7 8
      compiler/mips/rmipssta.inc
  70. 8 9
      compiler/mips/rmipsstd.inc
  71. 8 9
      compiler/mips/rmipssup.inc
  72. 16 0
      compiler/mips/strinst.inc
  73. 158 73
      compiler/msg/errord.msg
  74. 166 81
      compiler/msg/errordu.msg
  75. 31 4
      compiler/msg/errore.msg
  76. 1 1
      compiler/msg/errorr.msg
  77. 10 3
      compiler/msgidx.inc
  78. 410 398
      compiler/msgtxt.inc
  79. 32 12
      compiler/nadd.pas
  80. 15 5
      compiler/ncal.pas
  81. 8 2
      compiler/ncgcnv.pas
  82. 2 1
      compiler/ncgld.pas
  83. 4 0
      compiler/ncgmem.pas
  84. 17 0
      compiler/ncgrtti.pas
  85. 0 1
      compiler/ncgutil.pas
  86. 6 17
      compiler/ncnv.pas
  87. 1 0
      compiler/ngenutil.pas
  88. 70 28
      compiler/ninl.pas
  89. 47 3
      compiler/nmat.pas
  90. 7 2
      compiler/nmem.pas
  91. 3 1
      compiler/ogbase.pas
  92. 3 1
      compiler/ogcoff.pas
  93. 3 1
      compiler/ogelf.pas
  94. 31 3
      compiler/options.pas
  95. 19 0
      compiler/parser.pas
  96. 13 0
      compiler/pbase.pas
  97. 13 6
      compiler/pdecl.pas
  98. 10 22
      compiler/pdecobj.pas
  99. 35 6
      compiler/pdecsub.pas
  100. 66 180
      compiler/pdecvar.pas

+ 68 - 8
.gitattributes

@@ -264,6 +264,7 @@ compiler/i8086/n8086ld.pas svneol=native#text/plain
 compiler/i8086/n8086mat.pas svneol=native#text/plain
 compiler/i8086/n8086mat.pas svneol=native#text/plain
 compiler/i8086/n8086mem.pas svneol=native#text/plain
 compiler/i8086/n8086mem.pas svneol=native#text/plain
 compiler/i8086/n8086tcon.pas svneol=native#text/plain
 compiler/i8086/n8086tcon.pas svneol=native#text/plain
+compiler/i8086/n8086util.pas svneol=native#text/plain
 compiler/i8086/r8086ari.inc svneol=native#text/plain
 compiler/i8086/r8086ari.inc svneol=native#text/plain
 compiler/i8086/r8086att.inc svneol=native#text/plain
 compiler/i8086/r8086att.inc svneol=native#text/plain
 compiler/i8086/r8086con.inc svneol=native#text/plain
 compiler/i8086/r8086con.inc svneol=native#text/plain
@@ -2032,6 +2033,7 @@ packages/fcl-db/examples/loadlibdemo.lpi svneol=native#text/plain
 packages/fcl-db/examples/loadlibdemo.pp svneol=native#text/plain
 packages/fcl-db/examples/loadlibdemo.pp svneol=native#text/plain
 packages/fcl-db/examples/pqeventstest.pp svneol=native#text/plain
 packages/fcl-db/examples/pqeventstest.pp svneol=native#text/plain
 packages/fcl-db/examples/sqlite3loadlib.lpr svneol=native#text/plain
 packages/fcl-db/examples/sqlite3loadlib.lpr svneol=native#text/plain
+packages/fcl-db/examples/sqlparser.pp svneol=native#text/plain
 packages/fcl-db/fpmake.pp svneol=native#text/plain
 packages/fcl-db/fpmake.pp svneol=native#text/plain
 packages/fcl-db/src/Dataset.txt svneol=native#text/plain
 packages/fcl-db/src/Dataset.txt svneol=native#text/plain
 packages/fcl-db/src/README.txt svneol=native#text/plain
 packages/fcl-db/src/README.txt svneol=native#text/plain
@@ -2162,6 +2164,7 @@ packages/fcl-db/src/sdf/testfix.pp svneol=native#text/plain
 packages/fcl-db/src/sdf/testsdf.pp svneol=native#text/plain
 packages/fcl-db/src/sdf/testsdf.pp svneol=native#text/plain
 packages/fcl-db/src/sql/Makefile svneol=native#text/plain
 packages/fcl-db/src/sql/Makefile svneol=native#text/plain
 packages/fcl-db/src/sql/Makefile.fpc svneol=native#text/plain
 packages/fcl-db/src/sql/Makefile.fpc svneol=native#text/plain
+packages/fcl-db/src/sql/README.txt svneol=native#text/plain
 packages/fcl-db/src/sql/fpsqlparser.pas svneol=native#text/plain
 packages/fcl-db/src/sql/fpsqlparser.pas svneol=native#text/plain
 packages/fcl-db/src/sql/fpsqlscanner.pp svneol=native#text/plain
 packages/fcl-db/src/sql/fpsqlscanner.pp svneol=native#text/plain
 packages/fcl-db/src/sql/fpsqltree.pp svneol=native#text/plain
 packages/fcl-db/src/sql/fpsqltree.pp svneol=native#text/plain
@@ -2272,6 +2275,8 @@ packages/fcl-db/tests/testsqlfiles.lpi svneol=native#text/plain
 packages/fcl-db/tests/testsqlfiles.lpr svneol=native#text/plain
 packages/fcl-db/tests/testsqlfiles.lpr svneol=native#text/plain
 packages/fcl-db/tests/testsqlscanner.lpi svneol=native#text/plain
 packages/fcl-db/tests/testsqlscanner.lpi svneol=native#text/plain
 packages/fcl-db/tests/testsqlscanner.lpr svneol=native#text/plain
 packages/fcl-db/tests/testsqlscanner.lpr svneol=native#text/plain
+packages/fcl-db/tests/testsqlscanner_gui.lpi svneol=native#text/plain
+packages/fcl-db/tests/testsqlscanner_gui.lpr svneol=native#text/plain
 packages/fcl-db/tests/testsqlscript.pas svneol=native#text/plain
 packages/fcl-db/tests/testsqlscript.pas svneol=native#text/plain
 packages/fcl-db/tests/toolsunit.pas svneol=native#text/plain
 packages/fcl-db/tests/toolsunit.pas svneol=native#text/plain
 packages/fcl-extra/Makefile svneol=native#text/plain
 packages/fcl-extra/Makefile svneol=native#text/plain
@@ -8007,6 +8012,8 @@ rtl/embedded/arm/lpc1768.pp svneol=native#text/pascal
 rtl/embedded/arm/lpc21x4.pp svneol=native#text/plain
 rtl/embedded/arm/lpc21x4.pp svneol=native#text/plain
 rtl/embedded/arm/lpc8xx.pp svneol=native#text/pascal
 rtl/embedded/arm/lpc8xx.pp svneol=native#text/pascal
 rtl/embedded/arm/sc32442b.pp svneol=native#text/pascal
 rtl/embedded/arm/sc32442b.pp svneol=native#text/pascal
+rtl/embedded/arm/stm32f0xx.pp svneol=native#text/plain
+rtl/embedded/arm/stm32f10x_cl.pp svneol=native#text/plain
 rtl/embedded/arm/stm32f10x_conn.pp svneol=native#text/pascal
 rtl/embedded/arm/stm32f10x_conn.pp svneol=native#text/pascal
 rtl/embedded/arm/stm32f10x_hd.pp svneol=native#text/pascal
 rtl/embedded/arm/stm32f10x_hd.pp svneol=native#text/pascal
 rtl/embedded/arm/stm32f10x_ld.pp svneol=native#text/pascal
 rtl/embedded/arm/stm32f10x_ld.pp svneol=native#text/pascal
@@ -8193,7 +8200,7 @@ rtl/i386/setjump.inc svneol=native#text/plain
 rtl/i386/setjumph.inc svneol=native#text/plain
 rtl/i386/setjumph.inc svneol=native#text/plain
 rtl/i386/strings.inc svneol=native#text/plain
 rtl/i386/strings.inc svneol=native#text/plain
 rtl/i386/stringss.inc svneol=native#text/plain
 rtl/i386/stringss.inc svneol=native#text/plain
-rtl/i386/strpas.inc svneol=native#text/plain
+rtl/i8086/hugeptr.inc svneol=native#text/plain
 rtl/i8086/i8086.inc svneol=native#text/plain
 rtl/i8086/i8086.inc svneol=native#text/plain
 rtl/i8086/int32p.inc svneol=native#text/plain
 rtl/i8086/int32p.inc svneol=native#text/plain
 rtl/i8086/int64p.inc svneol=native#text/plain
 rtl/i8086/int64p.inc svneol=native#text/plain
@@ -8999,7 +9006,6 @@ rtl/powerpc/setjumph.inc svneol=native#text/plain
 rtl/powerpc/strings.inc svneol=native#text/plain
 rtl/powerpc/strings.inc svneol=native#text/plain
 rtl/powerpc/stringss.inc svneol=native#text/plain
 rtl/powerpc/stringss.inc svneol=native#text/plain
 rtl/powerpc/strlen.inc svneol=native#text/plain
 rtl/powerpc/strlen.inc svneol=native#text/plain
-rtl/powerpc/strpas.inc svneol=native#text/plain
 rtl/powerpc64/int64p.inc svneol=native#text/plain
 rtl/powerpc64/int64p.inc svneol=native#text/plain
 rtl/powerpc64/makefile.cpu svneol=native#text/plain
 rtl/powerpc64/makefile.cpu svneol=native#text/plain
 rtl/powerpc64/math.inc svneol=native#text/plain
 rtl/powerpc64/math.inc svneol=native#text/plain
@@ -9011,7 +9017,6 @@ rtl/powerpc64/setjumph.inc svneol=native#text/plain
 rtl/powerpc64/strings.inc svneol=native#text/plain
 rtl/powerpc64/strings.inc svneol=native#text/plain
 rtl/powerpc64/stringss.inc svneol=native#text/plain
 rtl/powerpc64/stringss.inc svneol=native#text/plain
 rtl/powerpc64/strlen.inc svneol=native#text/plain
 rtl/powerpc64/strlen.inc svneol=native#text/plain
-rtl/powerpc64/strpas.inc svneol=native#text/plain
 rtl/qnx/Makefile svneol=native#text/plain
 rtl/qnx/Makefile svneol=native#text/plain
 rtl/qnx/Makefile.fpc svneol=native#text/plain
 rtl/qnx/Makefile.fpc svneol=native#text/plain
 rtl/qnx/dos.inc svneol=native#text/plain
 rtl/qnx/dos.inc svneol=native#text/plain
@@ -9628,6 +9633,14 @@ tests/tbf/tb0236.pp svneol=native#text/pascal
 tests/tbf/tb0237.pp svneol=native#text/pascal
 tests/tbf/tb0237.pp svneol=native#text/pascal
 tests/tbf/tb0238.pp svneol=native#text/pascal
 tests/tbf/tb0238.pp svneol=native#text/pascal
 tests/tbf/tb0239.pp svneol=native#text/plain
 tests/tbf/tb0239.pp svneol=native#text/plain
+tests/tbf/tb0240.pp svneol=native#text/plain
+tests/tbf/tb0241.pp svneol=native#text/plain
+tests/tbf/tb0242.pp svneol=native#text/plain
+tests/tbf/tb0243.pp svneol=native#text/plain
+tests/tbf/tb0244.pp svneol=native#text/plain
+tests/tbf/tb0245.pp svneol=native#text/plain
+tests/tbf/tb0246.pp svneol=native#text/plain
+tests/tbf/tb0247.pp svneol=native#text/plain
 tests/tbf/ub0115.pp svneol=native#text/plain
 tests/tbf/ub0115.pp svneol=native#text/plain
 tests/tbf/ub0149.pp svneol=native#text/plain
 tests/tbf/ub0149.pp svneol=native#text/plain
 tests/tbf/ub0158a.pp svneol=native#text/plain
 tests/tbf/ub0158a.pp svneol=native#text/plain
@@ -10866,8 +10879,18 @@ tests/test/cpu16/i8086/tfarptr1.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tfarptr2.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tfarptr2.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tfarptr3.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tfarptr3.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tfarptr4.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tfarptr4.pp svneol=native#text/plain
+tests/test/cpu16/i8086/thugeptr1.pp svneol=native#text/plain
+tests/test/cpu16/i8086/thugeptr1a.pp svneol=native#text/plain
+tests/test/cpu16/i8086/thugeptr1b.pp svneol=native#text/plain
+tests/test/cpu16/i8086/thugeptr2.pp svneol=native#text/plain
+tests/test/cpu16/i8086/thugeptr2a.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tintr1.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tintr1.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tintr2.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tintr2.pp svneol=native#text/plain
+tests/test/cpu16/i8086/tmmc.pp svneol=native#text/plain
+tests/test/cpu16/i8086/tmml.pp svneol=native#text/plain
+tests/test/cpu16/i8086/tmmm.pp svneol=native#text/plain
+tests/test/cpu16/i8086/tmms.pp svneol=native#text/plain
+tests/test/cpu16/i8086/tmmt.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tptrsize.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tptrsize.pp svneol=native#text/pascal
 tests/test/cpu16/taddint1.pp svneol=native#text/pascal
 tests/test/cpu16/taddint1.pp svneol=native#text/pascal
 tests/test/dumpclass.pp svneol=native#text/plain
 tests/test/dumpclass.pp svneol=native#text/plain
@@ -10921,6 +10944,10 @@ tests/test/jvm/tprop.pp svneol=native#text/plain
 tests/test/jvm/tprop2.pp svneol=native#text/plain
 tests/test/jvm/tprop2.pp svneol=native#text/plain
 tests/test/jvm/tprop3.pp svneol=native#text/plain
 tests/test/jvm/tprop3.pp svneol=native#text/plain
 tests/test/jvm/tprop4.pp svneol=native#text/plain
 tests/test/jvm/tprop4.pp svneol=native#text/plain
+tests/test/jvm/tprop5.pp svneol=native#text/plain
+tests/test/jvm/tprop5a.pp svneol=native#text/plain
+tests/test/jvm/tprop6.pp svneol=native#text/plain
+tests/test/jvm/tprop6a.pp svneol=native#text/plain
 tests/test/jvm/tptrdynarr.pp svneol=native#text/plain
 tests/test/jvm/tptrdynarr.pp svneol=native#text/plain
 tests/test/jvm/tpvar.pp svneol=native#text/plain
 tests/test/jvm/tpvar.pp svneol=native#text/plain
 tests/test/jvm/tpvardelphi.pp svneol=native#text/plain
 tests/test/jvm/tpvardelphi.pp svneol=native#text/plain
@@ -10961,17 +10988,17 @@ tests/test/jvm/uenum.pp svneol=native#text/plain
 tests/test/jvm/ujsetter.pp svneol=native#text/plain
 tests/test/jvm/ujsetter.pp svneol=native#text/plain
 tests/test/jvm/unsupported.pp svneol=native#text/plain
 tests/test/jvm/unsupported.pp svneol=native#text/plain
 tests/test/lcpref.inc svneol=native#text/plain
 tests/test/lcpref.inc svneol=native#text/plain
-tests/test/library/testdll.pp svneol=native#text/plain
-tests/test/library/testdll2.pp svneol=native#text/plain
 tests/test/library/tlib1a.pp svneol=native#text/plain
 tests/test/library/tlib1a.pp svneol=native#text/plain
-tests/test/library/tlib1a2.pp svneol=native#text/plain
 tests/test/library/tlib1b.pp svneol=native#text/plain
 tests/test/library/tlib1b.pp svneol=native#text/plain
-tests/test/library/tlib2b.pp svneol=native#text/plain
+tests/test/library/tlib1c.pp svneol=native#text/plain
+tests/test/library/tlib1d.pp svneol=native#text/plain
 tests/test/library/tlib3a.pp svneol=native#text/plain
 tests/test/library/tlib3a.pp svneol=native#text/plain
 tests/test/library/tlib3b.pp svneol=native#text/plain
 tests/test/library/tlib3b.pp svneol=native#text/plain
 tests/test/library/tlib3c.pp svneol=native#text/plain
 tests/test/library/tlib3c.pp svneol=native#text/plain
 tests/test/library/tlib3d.pp svneol=native#text/plain
 tests/test/library/tlib3d.pp svneol=native#text/plain
+tests/test/library/ttdllex1.pp svneol=native#text/plain
 tests/test/library/ttdllexe.pp svneol=native#text/plain
 tests/test/library/ttdllexe.pp svneol=native#text/plain
+tests/test/library/ttdlltes1.pp svneol=native#text/plain
 tests/test/library/ttdlltest.pp svneol=native#text/plain
 tests/test/library/ttdlltest.pp svneol=native#text/plain
 tests/test/library/ulib2a.pp svneol=native#text/plain
 tests/test/library/ulib2a.pp svneol=native#text/plain
 tests/test/library/ulib2b.pp svneol=native#text/plain
 tests/test/library/ulib2b.pp svneol=native#text/plain
@@ -12762,6 +12789,11 @@ tests/webtbf/tw25861.pp svneol=native#text/plain
 tests/webtbf/tw25862.pp svneol=native#text/plain
 tests/webtbf/tw25862.pp svneol=native#text/plain
 tests/webtbf/tw25915.pp svneol=native#text/plain
 tests/webtbf/tw25915.pp svneol=native#text/plain
 tests/webtbf/tw25951.pp svneol=native#text/plain
 tests/webtbf/tw25951.pp svneol=native#text/plain
+tests/webtbf/tw26176.pp svneol=native#text/plain
+tests/webtbf/tw26193.pp svneol=native#text/plain
+tests/webtbf/tw26363.pp svneol=native#text/plain
+tests/webtbf/tw26363a.pp svneol=native#text/plain
+tests/webtbf/tw2650.pp svneol=native#text/plain
 tests/webtbf/tw2657.pp svneol=native#text/plain
 tests/webtbf/tw2657.pp svneol=native#text/plain
 tests/webtbf/tw2670.pp svneol=native#text/plain
 tests/webtbf/tw2670.pp svneol=native#text/plain
 tests/webtbf/tw2719.pp svneol=native#text/plain
 tests/webtbf/tw2719.pp svneol=native#text/plain
@@ -13661,6 +13693,7 @@ tests/webtbs/tw20407.pp svneol=native#text/pascal
 tests/webtbs/tw2041.pp svneol=native#text/plain
 tests/webtbs/tw2041.pp svneol=native#text/plain
 tests/webtbs/tw20421.pp svneol=native#text/pascal
 tests/webtbs/tw20421.pp svneol=native#text/pascal
 tests/webtbs/tw2045.pp svneol=native#text/plain
 tests/webtbs/tw2045.pp svneol=native#text/plain
+tests/webtbs/tw20456.pp svneol=native#text/plain
 tests/webtbs/tw2046a.pp svneol=native#text/plain
 tests/webtbs/tw2046a.pp svneol=native#text/plain
 tests/webtbs/tw20527.pp svneol=native#text/plain
 tests/webtbs/tw20527.pp svneol=native#text/plain
 tests/webtbs/tw20557.pp svneol=native#text/pascal
 tests/webtbs/tw20557.pp svneol=native#text/pascal
@@ -13741,6 +13774,7 @@ tests/webtbs/tw21593.pp svneol=native#text/pascal
 tests/webtbs/tw21593a.pp svneol=native#text/pascal
 tests/webtbs/tw21593a.pp svneol=native#text/pascal
 tests/webtbs/tw21593b.pp svneol=native#text/pascal
 tests/webtbs/tw21593b.pp svneol=native#text/pascal
 tests/webtbs/tw21593c.pp svneol=native#text/pascal
 tests/webtbs/tw21593c.pp svneol=native#text/pascal
+tests/webtbs/tw21622.pp svneol=native#text/plain
 tests/webtbs/tw2163.pp svneol=native#text/plain
 tests/webtbs/tw2163.pp svneol=native#text/plain
 tests/webtbs/tw21654.pp svneol=native#text/pascal
 tests/webtbs/tw21654.pp svneol=native#text/pascal
 tests/webtbs/tw21674.pp svneol=native#text/pascal
 tests/webtbs/tw21674.pp svneol=native#text/pascal
@@ -13783,9 +13817,11 @@ tests/webtbs/tw2242.pp svneol=native#text/plain
 tests/webtbs/tw22427.pp svneol=native#text/pascal
 tests/webtbs/tw22427.pp svneol=native#text/pascal
 tests/webtbs/tw22428.pp svneol=native#text/pascal
 tests/webtbs/tw22428.pp svneol=native#text/pascal
 tests/webtbs/tw22433.pp svneol=native#text/pascal
 tests/webtbs/tw22433.pp svneol=native#text/pascal
+tests/webtbs/tw22468.pp svneol=native#text/plain
 tests/webtbs/tw22490.pp svneol=native#text/plain
 tests/webtbs/tw22490.pp svneol=native#text/plain
 tests/webtbs/tw2250.pp svneol=native#text/plain
 tests/webtbs/tw2250.pp svneol=native#text/plain
 tests/webtbs/tw22502.pp svneol=native#text/plain
 tests/webtbs/tw22502.pp svneol=native#text/plain
+tests/webtbs/tw22540.pp svneol=native#text/plain
 tests/webtbs/tw22561.pp svneol=native#text/plain
 tests/webtbs/tw22561.pp svneol=native#text/plain
 tests/webtbs/tw22570.pp svneol=native#text/plain
 tests/webtbs/tw22570.pp svneol=native#text/plain
 tests/webtbs/tw2259.pp svneol=native#text/plain
 tests/webtbs/tw2259.pp svneol=native#text/plain
@@ -13803,6 +13839,10 @@ tests/webtbs/tw2274.pp svneol=native#text/plain
 tests/webtbs/tw22741.pp svneol=native#text/plain
 tests/webtbs/tw22741.pp svneol=native#text/plain
 tests/webtbs/tw22744.pp svneol=native#text/pascal
 tests/webtbs/tw22744.pp svneol=native#text/pascal
 tests/webtbs/tw2277.pp svneol=native#text/plain
 tests/webtbs/tw2277.pp svneol=native#text/plain
+tests/webtbs/tw22790a.pp svneol=native#text/plain
+tests/webtbs/tw22790b.pp svneol=native#text/plain
+tests/webtbs/tw22790c.pp svneol=native#text/plain
+tests/webtbs/tw22792.pp svneol=native#text/plain
 tests/webtbs/tw22796.pp svneol=native#text/plain
 tests/webtbs/tw22796.pp svneol=native#text/plain
 tests/webtbs/tw2280.pp svneol=native#text/plain
 tests/webtbs/tw2280.pp svneol=native#text/plain
 tests/webtbs/tw22860.pp svneol=native#text/plain
 tests/webtbs/tw22860.pp svneol=native#text/plain
@@ -13833,6 +13873,7 @@ tests/webtbs/tw23204.pp svneol=native#text/plain
 tests/webtbs/tw23212.pp svneol=native#text/plain
 tests/webtbs/tw23212.pp svneol=native#text/plain
 tests/webtbs/tw2323.pp svneol=native#text/plain
 tests/webtbs/tw2323.pp svneol=native#text/plain
 tests/webtbs/tw23270.pp svneol=native#text/pascal
 tests/webtbs/tw23270.pp svneol=native#text/pascal
+tests/webtbs/tw23279.pp svneol=native#text/plain
 tests/webtbs/tw2328.pp svneol=native#text/plain
 tests/webtbs/tw2328.pp svneol=native#text/plain
 tests/webtbs/tw23299.pp svneol=native#text/pascal
 tests/webtbs/tw23299.pp svneol=native#text/pascal
 tests/webtbs/tw2332.pp svneol=native#text/plain
 tests/webtbs/tw2332.pp svneol=native#text/plain
@@ -13844,6 +13885,7 @@ tests/webtbs/tw23503.pp svneol=native#text/pascal
 tests/webtbs/tw2351.pp svneol=native#text/plain
 tests/webtbs/tw2351.pp svneol=native#text/plain
 tests/webtbs/tw23568.pp svneol=native#text/plain
 tests/webtbs/tw23568.pp svneol=native#text/plain
 tests/webtbs/tw2363.pp svneol=native#text/plain
 tests/webtbs/tw2363.pp svneol=native#text/plain
+tests/webtbs/tw23653.pp svneol=native#text/plain
 tests/webtbs/tw23667.pp svneol=native#text/plain
 tests/webtbs/tw23667.pp svneol=native#text/plain
 tests/webtbs/tw23725.pp svneol=native#text/pascal
 tests/webtbs/tw23725.pp svneol=native#text/pascal
 tests/webtbs/tw23744.pp svneol=native#text/plain
 tests/webtbs/tw23744.pp svneol=native#text/plain
@@ -13861,6 +13903,7 @@ tests/webtbs/tw2397.pp svneol=native#text/plain
 tests/webtbs/tw23980.pp svneol=native#text/plain
 tests/webtbs/tw23980.pp svneol=native#text/plain
 tests/webtbs/tw24007.pp svneol=native#text/plain
 tests/webtbs/tw24007.pp svneol=native#text/plain
 tests/webtbs/tw24071.pp svneol=native#text/pascal
 tests/webtbs/tw24071.pp svneol=native#text/pascal
+tests/webtbs/tw24072.pp svneol=native#text/plain
 tests/webtbs/tw2409.pp svneol=native#text/plain
 tests/webtbs/tw2409.pp svneol=native#text/plain
 tests/webtbs/tw24129.pp svneol=native#text/pascal
 tests/webtbs/tw24129.pp svneol=native#text/pascal
 tests/webtbs/tw24131.pp svneol=native#text/plain
 tests/webtbs/tw24131.pp svneol=native#text/plain
@@ -13879,12 +13922,18 @@ tests/webtbs/tw24486.pp svneol=native#text/pascal
 tests/webtbs/tw2452.pp svneol=native#text/plain
 tests/webtbs/tw2452.pp svneol=native#text/plain
 tests/webtbs/tw24536.pp svneol=native#text/plain
 tests/webtbs/tw24536.pp svneol=native#text/plain
 tests/webtbs/tw2454.pp svneol=native#text/plain
 tests/webtbs/tw2454.pp svneol=native#text/plain
+tests/webtbs/tw24540.pp svneol=native#text/plain
 tests/webtbs/tw24651.pp svneol=native#text/pascal
 tests/webtbs/tw24651.pp svneol=native#text/pascal
+tests/webtbs/tw24690.pp svneol=native#text/plain
 tests/webtbs/tw24705.pp svneol=native#text/pascal
 tests/webtbs/tw24705.pp svneol=native#text/pascal
 tests/webtbs/tw2473.pp svneol=native#text/plain
 tests/webtbs/tw2473.pp svneol=native#text/plain
 tests/webtbs/tw2480.pp svneol=native#text/plain
 tests/webtbs/tw2480.pp svneol=native#text/plain
 tests/webtbs/tw2481.pp svneol=native#text/plain
 tests/webtbs/tw2481.pp svneol=native#text/plain
 tests/webtbs/tw2483.pp svneol=native#text/plain
 tests/webtbs/tw2483.pp svneol=native#text/plain
+tests/webtbs/tw24844.pp svneol=native#text/plain
+tests/webtbs/tw24844a.pp svneol=native#text/plain
+tests/webtbs/tw24844b.pp svneol=native#text/plain
+tests/webtbs/tw24844c.pp svneol=native#text/plain
 tests/webtbs/tw24848.pp svneol=native#text/pascal
 tests/webtbs/tw24848.pp svneol=native#text/pascal
 tests/webtbs/tw24863.pp svneol=native#text/plain
 tests/webtbs/tw24863.pp svneol=native#text/plain
 tests/webtbs/tw24865.pp svneol=native#text/pascal
 tests/webtbs/tw24865.pp svneol=native#text/pascal
@@ -13898,6 +13947,7 @@ tests/webtbs/tw25004.pp svneol=native#text/pascal
 tests/webtbs/tw2503.pp svneol=native#text/plain
 tests/webtbs/tw2503.pp svneol=native#text/plain
 tests/webtbs/tw25030.pp svneol=native#text/pascal
 tests/webtbs/tw25030.pp svneol=native#text/pascal
 tests/webtbs/tw2504.pp svneol=native#text/plain
 tests/webtbs/tw2504.pp svneol=native#text/plain
+tests/webtbs/tw25043.pp svneol=native#text/plain
 tests/webtbs/tw25054a.pp svneol=native#text/pascal
 tests/webtbs/tw25054a.pp svneol=native#text/pascal
 tests/webtbs/tw25054b.pp svneol=native#text/pascal
 tests/webtbs/tw25054b.pp svneol=native#text/pascal
 tests/webtbs/tw25059.pp svneol=native#text/pascal
 tests/webtbs/tw25059.pp svneol=native#text/pascal
@@ -13912,6 +13962,7 @@ tests/webtbs/tw25169.pp svneol=native#text/plain
 tests/webtbs/tw25170.pp svneol=native#text/plain
 tests/webtbs/tw25170.pp svneol=native#text/plain
 tests/webtbs/tw25198.pp svneol=native#text/plain
 tests/webtbs/tw25198.pp svneol=native#text/plain
 tests/webtbs/tw25210.pp svneol=native#text/pascal
 tests/webtbs/tw25210.pp svneol=native#text/pascal
+tests/webtbs/tw25236.pp svneol=native#text/plain
 tests/webtbs/tw2525.pp svneol=native#text/plain
 tests/webtbs/tw2525.pp svneol=native#text/plain
 tests/webtbs/tw25255.pp svneol=native#text/plain
 tests/webtbs/tw25255.pp svneol=native#text/plain
 tests/webtbs/tw25269.pp svneol=native#text/plain
 tests/webtbs/tw25269.pp svneol=native#text/plain
@@ -13934,6 +13985,7 @@ tests/webtbs/tw25605.pp svneol=native#text/plain
 tests/webtbs/tw2561.pp svneol=native#text/plain
 tests/webtbs/tw2561.pp svneol=native#text/plain
 tests/webtbs/tw25610.pp -text svneol=native#text/plain
 tests/webtbs/tw25610.pp -text svneol=native#text/plain
 tests/webtbs/tw25685.pp svneol=native#text/plain
 tests/webtbs/tw25685.pp svneol=native#text/plain
+tests/webtbs/tw25703.pp svneol=native#text/plain
 tests/webtbs/tw25781.pp svneol=native#text/plain
 tests/webtbs/tw25781.pp svneol=native#text/plain
 tests/webtbs/tw25814.pp svneol=native#text/plain
 tests/webtbs/tw25814.pp svneol=native#text/plain
 tests/webtbs/tw25869.pp svneol=native#text/plain
 tests/webtbs/tw25869.pp svneol=native#text/plain
@@ -13950,16 +14002,23 @@ tests/webtbs/tw25956.pp svneol=native#text/plain
 tests/webtbs/tw25959.pp svneol=native#text/plain
 tests/webtbs/tw25959.pp svneol=native#text/plain
 tests/webtbs/tw2602.pp svneol=native#text/plain
 tests/webtbs/tw2602.pp svneol=native#text/plain
 tests/webtbs/tw2607.pp svneol=native#text/plain
 tests/webtbs/tw2607.pp svneol=native#text/plain
+tests/webtbs/tw26123.pp svneol=native#text/plain
+tests/webtbs/tw26162.pp svneol=native#text/plain
+tests/webtbs/tw26177.pp svneol=native#text/plain
+tests/webtbs/tw26180.pp svneol=native#text/plain
 tests/webtbs/tw2620.pp svneol=native#text/plain
 tests/webtbs/tw2620.pp svneol=native#text/plain
+tests/webtbs/tw26226.pp -text svneol=native#text/plain
+tests/webtbs/tw26230.pp svneol=native#text/plain
 tests/webtbs/tw2626.pp svneol=native#text/plain
 tests/webtbs/tw2626.pp svneol=native#text/plain
 tests/webtbs/tw2627.pp svneol=native#text/plain
 tests/webtbs/tw2627.pp svneol=native#text/plain
+tests/webtbs/tw26271.pp svneol=native#text/plain
+tests/webtbs/tw26288.pp svneol=native#text/plain
 tests/webtbs/tw2631.pp svneol=native#text/plain
 tests/webtbs/tw2631.pp svneol=native#text/plain
 tests/webtbs/tw26408.pp svneol=native#text/pascal
 tests/webtbs/tw26408.pp svneol=native#text/pascal
 tests/webtbs/tw2643.pp svneol=native#text/plain
 tests/webtbs/tw2643.pp svneol=native#text/plain
 tests/webtbs/tw2645.pp svneol=native#text/plain
 tests/webtbs/tw2645.pp svneol=native#text/plain
 tests/webtbs/tw2647.pp svneol=native#text/plain
 tests/webtbs/tw2647.pp svneol=native#text/plain
 tests/webtbs/tw2649.pp svneol=native#text/plain
 tests/webtbs/tw2649.pp svneol=native#text/plain
-tests/webtbs/tw2650.pp svneol=native#text/plain
 tests/webtbs/tw2651.pp svneol=native#text/plain
 tests/webtbs/tw2651.pp svneol=native#text/plain
 tests/webtbs/tw2656.pp svneol=native#text/plain
 tests/webtbs/tw2656.pp svneol=native#text/plain
 tests/webtbs/tw2659.pp svneol=native#text/plain
 tests/webtbs/tw2659.pp svneol=native#text/plain
@@ -14693,6 +14752,7 @@ tests/webtbs/uw19701.pas svneol=native#text/plain
 tests/webtbs/uw19851.pp svneol=native#text/pascal
 tests/webtbs/uw19851.pp svneol=native#text/pascal
 tests/webtbs/uw2004.inc svneol=native#text/plain
 tests/webtbs/uw2004.inc svneol=native#text/plain
 tests/webtbs/uw2040.pp svneol=native#text/plain
 tests/webtbs/uw2040.pp svneol=native#text/plain
+tests/webtbs/uw20456.pp svneol=native#text/plain
 tests/webtbs/uw20909a.pas svneol=native#text/pascal
 tests/webtbs/uw20909a.pas svneol=native#text/pascal
 tests/webtbs/uw20909b.pas svneol=native#text/pascal
 tests/webtbs/uw20909b.pas svneol=native#text/pascal
 tests/webtbs/uw20940.pp svneol=native#text/pascal
 tests/webtbs/uw20940.pp svneol=native#text/pascal

+ 42 - 6
compiler/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-02-06 rev 26692]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-04-01 rev 27428]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-android jvm-java jvm-android i8086-msdos
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
 LIMIT83fs = go32v2 os2 emx watcom msdos
@@ -184,6 +184,12 @@ $(error When compiling for arm-embedded, a sub-architecture (e.g. SUBARCH=armv4t
 endif
 endif
 override FPCOPT+=-Cp$(SUBARCH)
 override FPCOPT+=-Cp$(SUBARCH)
 endif
 endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+ifeq ($(SUBARCH),)
+$(error When compiling for mipsel-embedded, a sub-architecture (e.g. SUBARCH=pic32mx) must be defined)
+endif
+override FPCOPT+=-Cp$(SUBARCH)
+endif
 ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
 ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
 TARGETSUFFIX=$(OS_TARGET)
 TARGETSUFFIX=$(OS_TARGET)
 SOURCESUFFIX=$(OS_SOURCE)
 SOURCESUFFIX=$(OS_SOURCE)
@@ -495,7 +501,7 @@ ifeq ($(PPC_TARGET),powerpc64)
 override LOCALOPT+=-Fuppcgen
 override LOCALOPT+=-Fuppcgen
 endif
 endif
 ifeq ($(PPC_TARGET),m68k)
 ifeq ($(PPC_TARGET),m68k)
-override LOCALOPT+=-dNOOPT
+override LOCALOPT+=
 endif
 endif
 ifeq ($(PPC_TARGET),sparc)
 ifeq ($(PPC_TARGET),sparc)
 override LOCALOPT+=
 override LOCALOPT+=
@@ -749,6 +755,9 @@ endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
 override TARGET_DIRS+=utils
 override TARGET_DIRS+=utils
 endif
 endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+override TARGET_DIRS+=utils
+endif
 ifeq ($(FULL_TARGET),mipsel-android)
 ifeq ($(FULL_TARGET),mipsel-android)
 override TARGET_DIRS+=utils
 override TARGET_DIRS+=utils
 endif
 endif
@@ -971,6 +980,9 @@ endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
 override TARGET_PROGRAMS+=pp
 override TARGET_PROGRAMS+=pp
 endif
 endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+override TARGET_PROGRAMS+=pp
+endif
 ifeq ($(FULL_TARGET),mipsel-android)
 ifeq ($(FULL_TARGET),mipsel-android)
 override TARGET_PROGRAMS+=pp
 override TARGET_PROGRAMS+=pp
 endif
 endif
@@ -1194,6 +1206,9 @@ endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
 override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
+endif
 ifeq ($(FULL_TARGET),mipsel-android)
 ifeq ($(FULL_TARGET),mipsel-android)
 override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
 endif
 endif
@@ -1416,6 +1431,9 @@ endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 endif
 endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
+endif
 ifeq ($(FULL_TARGET),mipsel-android)
 ifeq ($(FULL_TARGET),mipsel-android)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 endif
 endif
@@ -1638,6 +1656,9 @@ endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
 override COMPILER_TARGETDIR+=.
 override COMPILER_TARGETDIR+=.
 endif
 endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+override COMPILER_TARGETDIR+=.
+endif
 ifeq ($(FULL_TARGET),mipsel-android)
 ifeq ($(FULL_TARGET),mipsel-android)
 override COMPILER_TARGETDIR+=.
 override COMPILER_TARGETDIR+=.
 endif
 endif
@@ -1860,6 +1881,9 @@ endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
+endif
 ifeq ($(FULL_TARGET),mipsel-android)
 ifeq ($(FULL_TARGET),mipsel-android)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 endif
 endif
@@ -2721,6 +2745,9 @@ endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),mipsel-android)
 ifeq ($(FULL_TARGET),mipsel-android)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -2914,17 +2941,23 @@ ifdef ACROSSCOMPILE
 override FPCOPT+=$(CROSSOPT)
 override FPCOPT+=$(CROSSOPT)
 endif
 endif
 override COMPILER:=$(strip $(FPC) $(FPCOPT))
 override COMPILER:=$(strip $(FPC) $(FPCOPT))
-ifeq (,$(findstring -s ,$(COMPILER)))
+ifneq (,$(findstring -sh ,$(COMPILER)))
+UseEXECPPAS=1
+endif
+ifneq (,$(findstring -s ,$(COMPILER)))
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+UseEXECPPAS=1
+endif
+endif
+ifneq ($(UseEXECPPAS),1)
 EXECPPAS=
 EXECPPAS=
 else
 else
-ifeq ($(FULL_SOURCE),$(FULL_TARGET))
 ifdef RUNBATCH
 ifdef RUNBATCH
 EXECPPAS:=@$(RUNBATCH) $(PPAS)
 EXECPPAS:=@$(RUNBATCH) $(PPAS)
 else
 else
 EXECPPAS:=@$(PPAS)
 EXECPPAS:=@$(PPAS)
 endif
 endif
 endif
 endif
-endif
 .PHONY: fpc_exes
 .PHONY: fpc_exes
 ifndef CROSSINSTALL
 ifndef CROSSINSTALL
 ifneq ($(TARGET_PROGRAMS),)
 ifneq ($(TARGET_PROGRAMS),)
@@ -3569,6 +3602,9 @@ endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
 TARGET_DIRS_UTILS=1
 TARGET_DIRS_UTILS=1
 endif
 endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+TARGET_DIRS_UTILS=1
+endif
 ifeq ($(FULL_TARGET),mipsel-android)
 ifeq ($(FULL_TARGET),mipsel-android)
 TARGET_DIRS_UTILS=1
 TARGET_DIRS_UTILS=1
 endif
 endif

+ 1 - 1
compiler/Makefile.fpc

@@ -261,7 +261,7 @@ endif
 
 
 # m68k specific
 # m68k specific
 ifeq ($(PPC_TARGET),m68k)
 ifeq ($(PPC_TARGET),m68k)
-override LOCALOPT+=-dNOOPT
+override LOCALOPT+=
 endif
 endif
 
 
 # Sparc specific
 # Sparc specific

+ 5 - 1
compiler/aasmbase.pas

@@ -142,7 +142,11 @@ interface
          sec_objc_nlclasslist,
          sec_objc_nlclasslist,
          sec_objc_catlist,
          sec_objc_catlist,
          sec_objc_nlcatlist,
          sec_objc_nlcatlist,
-         sec_objc_protolist
+         sec_objc_protolist,
+         { stack segment for 16-bit DOS }
+         sec_stack,
+         { initial heap segment for 16-bit DOS }
+         sec_heap
        );
        );
 
 
        TAsmSectionOrder = (secorder_begin,secorder_default,secorder_end);
        TAsmSectionOrder = (secorder_begin,secorder_default,secorder_end);

+ 9 - 3
compiler/aggas.pas

@@ -268,7 +268,9 @@ implementation
           '.objc_nlclasslist',
           '.objc_nlclasslist',
           '.objc_catlist',
           '.objc_catlist',
           '.obcj_nlcatlist',
           '.obcj_nlcatlist',
-          '.objc_protolist'
+          '.objc_protolist',
+          '.stack',
+          '.heap'
         );
         );
         secnames_pic : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('','',
         secnames_pic : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('','',
           '.text',
           '.text',
@@ -325,7 +327,9 @@ implementation
           '.objc_nlclasslist',
           '.objc_nlclasslist',
           '.objc_catlist',
           '.objc_catlist',
           '.obcj_nlcatlist',
           '.obcj_nlcatlist',
-          '.objc_protolist'
+          '.objc_protolist',
+          '.stack',
+          '.heap'
         );
         );
       var
       var
         sep     : string[3];
         sep     : string[3];
@@ -1842,7 +1846,9 @@ implementation
          sec_none (* sec_objc_nlclasslist *),
          sec_none (* sec_objc_nlclasslist *),
          sec_none (* sec_objc_catlist *),
          sec_none (* sec_objc_catlist *),
          sec_none (* sec_objc_nlcatlist *),
          sec_none (* sec_objc_nlcatlist *),
-         sec_none (* sec_objc_protlist *)
+         sec_none (* sec_objc_protlist *),
+         sec_none (* sec_stack *),
+         sec_none (* sec_heap *)
         );
         );
       begin
       begin
         Result := inherited SectionName (SecXTable [AType], AName, AOrder);
         Result := inherited SectionName (SecXTable [AType], AName, AOrder);

+ 10 - 1
compiler/arm/aoptcpu.pas

@@ -1206,6 +1206,12 @@ Implementation
                           (taicpu(hp1).oper[1]^.ref^.base = taicpu(p).oper[0]^.reg))
                           (taicpu(hp1).oper[1]^.ref^.base = taicpu(p).oper[0]^.reg))
                        ) and
                        ) and
                        not(RegModifiedBetween(taicpu(p).oper[1]^.reg,p,hp1)) and
                        not(RegModifiedBetween(taicpu(p).oper[1]^.reg,p,hp1)) and
+
+                       // Make sure that Thumb code doesn't propagate a high register into a reference
+                       ((GenerateThumbCode and
+                         (getsupreg(taicpu(p).oper[1]^.reg) < RS_R8)) or
+                        (not GenerateThumbCode)) and
+
                        RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) then
                        RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) then
                       begin
                       begin
                         DebugMsg('Peephole MovLdr2Ldr done', hp1);
                         DebugMsg('Peephole MovLdr2Ldr done', hp1);
@@ -1600,7 +1606,8 @@ Implementation
                       to
                       to
                       str/ldr reg3,[reg1,const2+/-const1]
                       str/ldr reg3,[reg1,const2+/-const1]
                     }
                     }
-                    if (taicpu(p).opcode in [A_ADD,A_SUB]) and
+                    if (not GenerateThumbCode) and
+                       (taicpu(p).opcode in [A_ADD,A_SUB]) and
                        (taicpu(p).ops>2) and
                        (taicpu(p).ops>2) and
                        (taicpu(p).oper[1]^.typ = top_reg) and
                        (taicpu(p).oper[1]^.typ = top_reg) and
                        (taicpu(p).oper[2]^.typ = top_const) then
                        (taicpu(p).oper[2]^.typ = top_const) then
@@ -1695,6 +1702,8 @@ Implementation
                       (taicpu(p).oper[2]^.typ = top_reg) and
                       (taicpu(p).oper[2]^.typ = top_reg) and
                       GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
                       GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
                       MatchInstruction(hp1,[A_ADD,A_SUB],[C_None],[PF_None]) and
                       MatchInstruction(hp1,[A_ADD,A_SUB],[C_None],[PF_None]) and
+                      (not RegModifiedBetween(taicpu(p).oper[1]^.reg, p, hp1)) and
+                      (not RegModifiedBetween(taicpu(p).oper[2]^.reg, p, hp1)) and
 
 
                       (((taicpu(hp1).opcode=A_ADD) and (current_settings.cputype>=cpu_armv4)) or
                       (((taicpu(hp1).opcode=A_ADD) and (current_settings.cputype>=cpu_armv4)) or
                        ((taicpu(hp1).opcode=A_SUB) and (current_settings.cputype in [cpu_armv6t2,cpu_armv7,cpu_armv7a,cpu_armv7r,cpu_armv7m,cpu_armv7em]))) and
                        ((taicpu(hp1).opcode=A_SUB) and (current_settings.cputype in [cpu_armv6t2,cpu_armv7,cpu_armv7a,cpu_armv7r,cpu_armv7m,cpu_armv7em]))) and

+ 90 - 4
compiler/arm/cgcpu.pas

@@ -114,11 +114,13 @@ unit cgcpu;
 
 
         { mla for thumb requires that none of the registers is equal to r13/r15, this method ensures this }
         { mla for thumb requires that none of the registers is equal to r13/r15, this method ensures this }
         procedure safe_mla(list: TAsmList;op1,op2,op3,op4 : TRegister);
         procedure safe_mla(list: TAsmList;op1,op2,op3,op4 : TRegister);
+
       end;
       end;
 
 
       { tcgarm is shared between normal arm and thumb-2 }
       { tcgarm is shared between normal arm and thumb-2 }
       tcgarm = class(tbasecgarm)
       tcgarm = class(tbasecgarm)
         procedure a_op_const_reg(list : TAsmList; Op: TOpCG; size: TCGSize; a: tcgint; reg: TRegister); override;
         procedure a_op_const_reg(list : TAsmList; Op: TOpCG; size: TCGSize; a: tcgint; reg: TRegister); override;
+        procedure a_op_const_ref(list : TAsmList; Op: TOpCG; size: TCGSize; a: tcgint; const ref: TReference); override;
         procedure a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; src, dst: TRegister); override;
         procedure a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; src, dst: TRegister); override;
 
 
         procedure a_op_const_reg_reg(list: TAsmList; op: TOpCg;
         procedure a_op_const_reg_reg(list: TAsmList; op: TOpCg;
@@ -132,6 +134,9 @@ unit cgcpu;
         procedure a_load_ref_reg(list : TAsmList; fromsize, tosize : tcgsize;const Ref : treference;reg : tregister);override;
         procedure a_load_ref_reg(list : TAsmList; fromsize, tosize : tcgsize;const Ref : treference;reg : tregister);override;
 
 
         procedure g_adjust_self_value(list:TAsmList;procdef: tprocdef;ioffset: tcgint); override;
         procedure g_adjust_self_value(list:TAsmList;procdef: tprocdef;ioffset: tcgint); override;
+
+        {Multiply two 32-bit registers into lo and hi 32-bit registers}
+        procedure a_mul_reg_reg_pair(list: tasmlist; size: tcgsize; src1,src2,dstlo,dsthi: tregister); override;
       end;
       end;
 
 
       { normal arm cg }
       { normal arm cg }
@@ -176,6 +181,8 @@ unit cgcpu;
         procedure a_load_const_reg(list: TAsmList; size: tcgsize; a: tcgint; reg: tregister);override;
         procedure a_load_const_reg(list: TAsmList; size: tcgsize; a: tcgint; reg: tregister);override;
 
 
         procedure g_adjust_self_value(list:TAsmList;procdef: tprocdef;ioffset: tcgint); override;
         procedure g_adjust_self_value(list:TAsmList;procdef: tprocdef;ioffset: tcgint); override;
+
+        function handle_load_store(list: TAsmList; op: tasmop; oppostfix: toppostfix; reg: tregister; ref: treference): treference; override;
       end;
       end;
 
 
       tthumbcg64farm = class(tbasecg64farm)
       tthumbcg64farm = class(tbasecg64farm)
@@ -685,6 +692,17 @@ unit cgcpu;
           a_op_const_reg_reg(list,op,size,a,reg,reg);
           a_op_const_reg_reg(list,op,size,a,reg,reg);
        end;
        end;
 
 
+     procedure tcgarm.a_op_const_ref(list : TAsmList; Op: TOpCG; size: TCGSize; a: tcgint; const ref: TReference);
+       var
+         tmpreg,tmpresreg : tregister;
+         tmpref : treference;
+       begin
+         tmpreg:=getintregister(list,size);
+         tmpresreg:=getintregister(list,size);
+         tmpref:=a_internal_load_ref_reg(list,size,size,ref,tmpreg);
+         a_op_const_reg_reg(list,op,size,a,tmpreg,tmpresreg);
+         a_load_reg_ref(list,size,size,tmpresreg,tmpref);
+       end;
 
 
      procedure tcgarm.a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; src, dst: TRegister);
      procedure tcgarm.a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; src, dst: TRegister);
        var
        var
@@ -1161,6 +1179,26 @@ unit cgcpu;
         maybeadjustresult(list,op,size,dst);
         maybeadjustresult(list,op,size,dst);
       end;
       end;
 
 
+    procedure tcgarm.a_mul_reg_reg_pair(list: tasmlist; size: tcgsize; src1,src2,dstlo,dsthi: tregister);
+    var
+      asmop: tasmop;
+    begin
+      list.concat(tai_comment.create(strpnew('tcgarm.a_mul_reg_reg_pair called')));
+      case size of
+        OS_32:  asmop:=A_UMULL;
+        OS_S32: asmop:=A_SMULL;
+        else
+          InternalError(2014060802);
+      end;
+      { The caller might omit dstlo or dsthi, when he is not interested in it, we still
+        need valid registers everywhere. In case of dsthi = NR_NO we could fall back to
+        32x32=32 bit multiplication}
+      if (dstlo = NR_NO) then
+        dstlo:=getintregister(list,size);
+      if (dsthi = NR_NO) then
+        dsthi:=getintregister(list,size);
+      list.concat(taicpu.op_reg_reg_reg_reg(asmop, dstlo, dsthi, src1,src2));
+    end;
 
 
     function tbasecgarm.handle_load_store(list:TAsmList;op: tasmop;oppostfix : toppostfix;reg:tregister;ref: treference):treference;
     function tbasecgarm.handle_load_store(list:TAsmList;op: tasmop;oppostfix : toppostfix;reg:tregister;ref: treference):treference;
       var
       var
@@ -3830,8 +3868,8 @@ unit cgcpu;
                    { only complicated references need an extra loadaddr }
                    { only complicated references need an extra loadaddr }
                    if assigned(ref.symbol) or
                    if assigned(ref.symbol) or
                      (ref.index<>NR_NO) or
                      (ref.index<>NR_NO) or
-                     (ref.offset<-255) or
-                     (ref.offset>4094) or
+                     (ref.offset<-124) or
+                     (ref.offset>124) or
                      { sometimes the compiler reused registers }
                      { sometimes the compiler reused registers }
                      (reg=ref.index) or
                      (reg=ref.index) or
                      (reg=ref.base) then
                      (reg=ref.base) then
@@ -3863,8 +3901,8 @@ unit cgcpu;
                    { only complicated references need an extra loadaddr }
                    { only complicated references need an extra loadaddr }
                    if assigned(ref.symbol) or
                    if assigned(ref.symbol) or
                      (ref.index<>NR_NO) or
                      (ref.index<>NR_NO) or
-                     (ref.offset<-255) or
-                     (ref.offset>4092) or
+                     (ref.offset<-124) or
+                     (ref.offset>124) or
                      { sometimes the compiler reused registers }
                      { sometimes the compiler reused registers }
                      (reg=ref.index) or
                      (reg=ref.index) or
                      (reg=ref.base) then
                      (reg=ref.base) then
@@ -4013,6 +4051,54 @@ unit cgcpu;
       end;
       end;
 
 
 
 
+    function tthumbcgarm.handle_load_store(list: TAsmList; op: tasmop; oppostfix: toppostfix; reg: tregister; ref: treference): treference;
+      var
+        href : treference;
+        tmpreg : TRegister;
+      begin
+        href:=ref;
+        if (op in [A_STR,A_STRB,A_STRH]) and
+           (abs(ref.offset)>124) then
+          begin
+            tmpreg:=getintregister(list,OS_ADDR);
+            a_loadaddr_ref_reg(list,ref,tmpreg);
+
+            reference_reset_base(href,tmpreg,0,ref.alignment);
+          end
+        else if (op=A_LDR) and
+           (oppostfix in [PF_None]) and
+           (ref.base<>NR_STACK_POINTER_REG)  and
+           (abs(ref.offset)>124) then
+          begin
+            tmpreg:=getintregister(list,OS_ADDR);
+            a_loadaddr_ref_reg(list,ref,tmpreg);
+
+            reference_reset_base(href,tmpreg,0,ref.alignment);
+          end
+        else if (op=A_LDR) and
+           (oppostfix in [PF_None]) and
+           (ref.base=NR_STACK_POINTER_REG) and
+           (abs(ref.offset)>1020) then
+          begin
+            tmpreg:=getintregister(list,OS_ADDR);
+            a_loadaddr_ref_reg(list,ref,tmpreg);
+
+            reference_reset_base(href,tmpreg,0,ref.alignment);
+          end
+        else if (op=A_LDR) and
+           ((oppostfix in [PF_SH,PF_SB]) or
+            (abs(ref.offset)>124)) then
+          begin
+            tmpreg:=getintregister(list,OS_ADDR);
+            a_loadaddr_ref_reg(list,ref,tmpreg);
+
+            reference_reset_base(href,tmpreg,0,ref.alignment);
+          end;
+
+        Result:=inherited handle_load_store(list, op, oppostfix, reg, href);
+      end;
+
+
     procedure tthumbcgarm.a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; src, dst: TRegister);
     procedure tthumbcgarm.a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; src, dst: TRegister);
       var
       var
         tmpreg,overflowreg : tregister;
         tmpreg,overflowreg : tregister;

+ 140 - 73
compiler/arm/cpuinfo.pas

@@ -182,6 +182,28 @@ Type
       ct_at91sam7xc256,
       ct_at91sam7xc256,
 
 
       { STMicroelectronics }
       { STMicroelectronics }
+      ct_stm32f030c6,
+      ct_stm32f030c8,
+      ct_stm32f030f4,
+      ct_stm32f030k6,
+      ct_stm32f030r8,
+      ct_stm32f050c4,
+      ct_stm32f050c6,
+      ct_stm32f050f4,
+      ct_stm32f050f6,
+      ct_stm32f050g4,
+      ct_stm32f050g6,
+      ct_stm32f050k4,
+      ct_stm32f050k6,
+      ct_stm32f051c4,
+      ct_stm32f051c6,
+      ct_stm32f051c8,
+      ct_stm32f051k4,
+      ct_stm32f051k6,
+      ct_stm32f051k8,
+      ct_stm32f051r4,
+      ct_stm32f051r6,
+      ct_stm32f051r8,
       ct_stm32f100x4, // LD&MD value line, 4=16,6=32,8=64,b=128
       ct_stm32f100x4, // LD&MD value line, 4=16,6=32,8=64,b=128
       ct_stm32f100x6,
       ct_stm32f100x6,
       ct_stm32f100x8,
       ct_stm32f100x8,
@@ -214,6 +236,16 @@ Type
       ct_stm32f107x8, // MD and HD connectivity line, 8=64,B=128,C=256
       ct_stm32f107x8, // MD and HD connectivity line, 8=64,B=128,C=256
       ct_stm32f107xB,
       ct_stm32f107xB,
       ct_stm32f107xC,
       ct_stm32f107xC,
+      ct_stm32f105r8,
+      ct_stm32f105rb,
+      ct_stm32f105rc,
+      ct_stm32f105v8,
+      ct_stm32f105vb,
+      ct_stm32f105vc,
+      ct_stm32f107rb,
+      ct_stm32f107rc,
+      ct_stm32f107vb,
+      ct_stm32f107vc,
 
 
       { TI - Fury Class - 64 K Flash, 16 K SRAM Devices }
       { TI - Fury Class - 64 K Flash, 16 K SRAM Devices }
       ct_lm3s1110,
       ct_lm3s1110,
@@ -383,91 +415,91 @@ Const
 
 
       { LPC 11xx Series}
       { LPC 11xx Series}
       (controllertypestr:'LPC1110FD20';		controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00001000;	srambase:$10000000;	sramsize:$00000400),
       (controllertypestr:'LPC1110FD20';		controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00001000;	srambase:$10000000;	sramsize:$00000400),
-      (controllertypestr:'LPC1111FDH20/002';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00000800),
-      (controllertypestr:'LPC1111FHN33/101';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00000800),
-      (controllertypestr:'LPC1111FHN33/102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00000800),
-      (controllertypestr:'LPC1111FHN33/103';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00000800),
-      (controllertypestr:'LPC1111FHN33/201';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1111FHN33/202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1111FHN33/203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
-
-      (controllertypestr:'LPC1112FD20/102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1112FDH20/102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1112FDH28/102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1112FHN33/101';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00000800),
-      (controllertypestr:'LPC1112FHN33/102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00000800),
-      (controllertypestr:'LPC1112FHN33/103';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00000800),
-      (controllertypestr:'LPC1112FHN33/201';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1112FHN24/202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1112FHN33/202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1112FHN33/203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1112FHI33/202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1112FHI33/203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
-
-      (controllertypestr:'LPC1113FHN33/201';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1113FHN33/202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1113FHN33/203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1113FHN33/301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1113FHN33/302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1113FHN33/303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1113FBD48/301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1113FBD48/302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1113FBD48/303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
-
-      (controllertypestr:'LPC1114FDH28/102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1114FN28/102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1114FHN33/201';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1114FHN33/202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1114FHN33/203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1114FHN33/301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FHN33/302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FHN33/303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FHN33/333';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$0000E000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FHI33/302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FHI33/303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FBD48/301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FBD48/302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FBD48/303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FBD48/323';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$0000C000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1114FBD48/333';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$0000E000;	srambase:$10000000;	sramsize:$00002000),
-
-      (controllertypestr:'LPC1115FBD48/303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00010000;	srambase:$10000000;	sramsize:$00002000),
-
-      (controllertypestr:'LPC11C12FBD48/301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC11C14FBD48/301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-
-      (controllertypestr:'LPC11C22FBD48/301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC11C24FBD48/301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-
-      (controllertypestr:'LPC11D14FBD100/302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1111FDH20_002';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00000800),
+      (controllertypestr:'LPC1111FHN33_101';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00000800),
+      (controllertypestr:'LPC1111FHN33_102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00000800),
+      (controllertypestr:'LPC1111FHN33_103';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00000800),
+      (controllertypestr:'LPC1111FHN33_201';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1111FHN33_202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1111FHN33_203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
+
+      (controllertypestr:'LPC1112FD20_102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1112FDH20_102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1112FDH28_102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1112FHN33_101';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00000800),
+      (controllertypestr:'LPC1112FHN33_102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00000800),
+      (controllertypestr:'LPC1112FHN33_103';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00000800),
+      (controllertypestr:'LPC1112FHN33_201';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1112FHN24_202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1112FHN33_202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1112FHN33_203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1112FHI33_202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1112FHI33_203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00001000),
+
+      (controllertypestr:'LPC1113FHN33_201';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1113FHN33_202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1113FHN33_203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1113FHN33_301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1113FHN33_302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1113FHN33_303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1113FBD48_301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1113FBD48_302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1113FBD48_303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00006000;	srambase:$10000000;	sramsize:$00002000),
+
+      (controllertypestr:'LPC1114FDH28_102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1114FN28_102';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1114FHN33_201';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1114FHN33_202';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1114FHN33_203';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1114FHN33_301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FHN33_302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FHN33_303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FHN33_333';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$0000E000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FHI33_302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FHI33_303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FBD48_301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FBD48_302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FBD48_303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FBD48_323';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$0000C000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1114FBD48_333';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$0000E000;	srambase:$10000000;	sramsize:$00002000),
+
+      (controllertypestr:'LPC1115FBD48_303';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00010000;	srambase:$10000000;	sramsize:$00002000),
+
+      (controllertypestr:'LPC11C12FBD48_301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC11C14FBD48_301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+
+      (controllertypestr:'LPC11C22FBD48_301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00004000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC11C24FBD48_301';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+
+      (controllertypestr:'LPC11D14FBD100_302';	controllerunitstr:'LPC11XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
 
 
       {LPC 122x Series}
       {LPC 122x Series}
-      (controllertypestr:'LPC1224FBD48/101';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1224FBD48/121';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$0000C000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1224FBD64/101';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1224FBD64/121';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$0000C000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1224FBD48_101';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1224FBD48_121';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$0000C000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1224FBD64_101';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1224FBD64_121';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$0000C000;	srambase:$10000000;	sramsize:$00001000),
 
 
-      (controllertypestr:'LPC1225FBD48/301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00010000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1225FBD48/321';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00014000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1225FBD64/301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00010000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1225FBD64/321';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00014000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1225FBD48_301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00010000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1225FBD48_321';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00014000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1225FBD64_301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00010000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1225FBD64_321';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00014000;	srambase:$10000000;	sramsize:$00002000),
 
 
-      (controllertypestr:'LPC1226FBD48/301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00018000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1226FBD64/301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00018000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1226FBD48_301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00018000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1226FBD64_301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00018000;	srambase:$10000000;	sramsize:$00002000),
 
 
-      (controllertypestr:'LPC1227FBD48/301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00020000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1227FBD64/301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00020000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1227FBD48_301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00020000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1227FBD64_301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00020000;	srambase:$10000000;	sramsize:$00002000),
 
 
-      (controllertypestr:'LPC12D27FBD100/301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00020000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC12D27FBD100_301';	controllerunitstr:'LPC122X';	flashbase:$00000000;	flashsize:$00020000;	srambase:$10000000;	sramsize:$00002000),
 
 
 
 
       (controllertypestr:'LPC1311FHN33';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
       (controllertypestr:'LPC1311FHN33';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
-      (controllertypestr:'LPC1311FHN33/01';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
+      (controllertypestr:'LPC1311FHN33_01';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00002000;	srambase:$10000000;	sramsize:$00001000),
 
 
       (controllertypestr:'LPC1313FHN33';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
       (controllertypestr:'LPC1313FHN33';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1313FHN33/01';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1313FHN33_01';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
       (controllertypestr:'LPC1313FBD48';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
       (controllertypestr:'LPC1313FBD48';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
-      (controllertypestr:'LPC1313FBD48/01';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
+      (controllertypestr:'LPC1313FBD48_01';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
 
 
       (controllertypestr:'LPC1315FHN33';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
       (controllertypestr:'LPC1315FHN33';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
       (controllertypestr:'LPC1315FBD48';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
       (controllertypestr:'LPC1315FBD48';	controllerunitstr:'LPC13XX';	flashbase:$00000000;	flashsize:$00008000;	srambase:$10000000;	sramsize:$00002000),
@@ -511,6 +543,30 @@ Const
       (controllertypestr:'AT91SAM7X256';	controllerunitstr:'AT91SAM7x256';	flashbase:$00000000;	flashsize:$00040000;	srambase:$00200000;	sramsize:$00010000),
       (controllertypestr:'AT91SAM7X256';	controllerunitstr:'AT91SAM7x256';	flashbase:$00000000;	flashsize:$00040000;	srambase:$00200000;	sramsize:$00010000),
       (controllertypestr:'AT91SAM7XC256';	controllerunitstr:'AT91SAM7x256';	flashbase:$00000000;	flashsize:$00040000;	srambase:$00200000;	sramsize:$00010000),
       (controllertypestr:'AT91SAM7XC256';	controllerunitstr:'AT91SAM7x256';	flashbase:$00000000;	flashsize:$00040000;	srambase:$00200000;	sramsize:$00010000),
 
 
+      { STM32F0 series }
+      (controllertypestr:'STM32F030C6';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F030C8';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00002000),
+      (controllertypestr:'STM32F030F4';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F030K6';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F030R8';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00002000),
+      (controllertypestr:'STM32F050C4';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F050C6';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F050F4';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F050F6';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F050G4';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F050G6';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F050K4';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F050K6';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F051C4';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F051C6';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F051C8';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00002000),
+      (controllertypestr:'STM32F051K4';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F051K6';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F051K8';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00002000),
+      (controllertypestr:'STM32F051R4';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F051R6';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
+      (controllertypestr:'STM32F051R8';     controllerunitstr:'STM32F0XX';        flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00002000),
+
       { STM32F1 series }
       { STM32F1 series }
       (controllertypestr:'STM32F100X4';     controllerunitstr:'STM32F10X_LD';     flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
       (controllertypestr:'STM32F100X4';     controllerunitstr:'STM32F10X_LD';     flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
       (controllertypestr:'STM32F100X6';     controllerunitstr:'STM32F10X_LD';     flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
       (controllertypestr:'STM32F100X6';     controllerunitstr:'STM32F10X_LD';     flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
@@ -545,6 +601,17 @@ Const
       (controllertypestr:'STM32F107XB';     controllerunitstr:'STM32F10X_CONN';   flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00010000),
       (controllertypestr:'STM32F107XB';     controllerunitstr:'STM32F10X_CONN';   flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00010000),
       (controllertypestr:'STM32F107XC';     controllerunitstr:'STM32F10X_CONN';   flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
       (controllertypestr:'STM32F107XC';     controllerunitstr:'STM32F10X_CONN';   flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
 
 
+      (controllertypestr:'STM32F105R8';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00010000),
+      (controllertypestr:'STM32F105RB';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00010000),
+      (controllertypestr:'STM32F105RC';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
+      (controllertypestr:'STM32F105V8';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00010000),
+      (controllertypestr:'STM32F105VB';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00010000),
+      (controllertypestr:'STM32F105VC';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
+      (controllertypestr:'STM32F107RB';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00010000),
+      (controllertypestr:'STM32F107RC';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
+      (controllertypestr:'STM32F107VB';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00010000),
+      (controllertypestr:'STM32F107VC';     controllerunitstr:'STM32F10X_CL';     flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
+
       (controllertypestr:'LM3S1110';	controllerunitstr:'LM3FURY';	flashbase:$00000000;	flashsize:$00010000;	srambase:$20000000;	sramsize:$00004000),
       (controllertypestr:'LM3S1110';	controllerunitstr:'LM3FURY';	flashbase:$00000000;	flashsize:$00010000;	srambase:$20000000;	sramsize:$00004000),
       (controllertypestr:'LM3S1133';	controllerunitstr:'LM3FURY';	flashbase:$00000000;	flashsize:$00010000;	srambase:$20000000;	sramsize:$00004000),
       (controllertypestr:'LM3S1133';	controllerunitstr:'LM3FURY';	flashbase:$00000000;	flashsize:$00010000;	srambase:$20000000;	sramsize:$00004000),
       (controllertypestr:'LM3S1138';	controllerunitstr:'LM3FURY';	flashbase:$00000000;	flashsize:$00010000;	srambase:$20000000;	sramsize:$00004000),
       (controllertypestr:'LM3S1138';	controllerunitstr:'LM3FURY';	flashbase:$00000000;	flashsize:$00010000;	srambase:$20000000;	sramsize:$00004000),

+ 12 - 0
compiler/arm/narminl.pas

@@ -382,14 +382,26 @@ implementation
         opsize : tcgsize;
         opsize : tcgsize;
         hp : taicpu;
         hp : taicpu;
       begin
       begin
+        if GenerateThumbCode then
+          begin
+            inherited second_abs_long;
+            exit;
+          end;
+
         secondpass(left);
         secondpass(left);
         opsize:=def_cgsize(left.resultdef);
         opsize:=def_cgsize(left.resultdef);
         hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
         hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
         location:=left.location;
         location:=left.location;
         location.register:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
         location.register:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
+
         cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
         cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
         current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg(A_MOV,location.register,left.location.register), PF_S));
         current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg(A_MOV,location.register,left.location.register), PF_S));
+
+        if GenerateThumb2Code then
+          current_asmdata.CurrAsmList.concat(taicpu.op_cond(A_IT,C_MI));
+
         current_asmdata.CurrAsmList.concat(setcondition(taicpu.op_reg_reg_const(A_RSB,location.register,location.register, 0), C_MI));
         current_asmdata.CurrAsmList.concat(setcondition(taicpu.op_reg_reg_const(A_RSB,location.register,location.register, 0), C_MI));
+
         cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
         cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
       end;
       end;
 
 

+ 12 - 4
compiler/arm/narmmat.pas

@@ -71,14 +71,19 @@ implementation
       var
       var
         power  : longint;
         power  : longint;
       begin
       begin
+        {We can handle all cases of constant division}
         if not(cs_check_overflow in current_settings.localswitches) and
         if not(cs_check_overflow in current_settings.localswitches) and
            (right.nodetype=ordconstn) and
            (right.nodetype=ordconstn) and
            (nodetype=divn) and
            (nodetype=divn) and
-           (ispowerof2(tordconstnode(right).value,power) or
+           not(is_64bitint(resultdef)) and
+           {Only the ARM and thumb2-isa support umull and smull, which are required for arbitary division by const optimization}
+           (GenerateArmCode or
+            GenerateThumb2Code or
+            (ispowerof2(tordconstnode(right).value,power) or
             (tordconstnode(right).value=1) or
             (tordconstnode(right).value=1) or
             (tordconstnode(right).value=int64(-1))
             (tordconstnode(right).value=int64(-1))
-           ) and
-           not(is_64bitint(resultdef)) then
+            )
+           ) then
           result:=nil
           result:=nil
         else if ((GenerateThumbCode or GenerateThumb2Code) and (CPUARM_HAS_THUMB_IDIV in cpu_capabilities[current_settings.cputype])) and
         else if ((GenerateThumbCode or GenerateThumb2Code) and (CPUARM_HAS_THUMB_IDIV in cpu_capabilities[current_settings.cputype])) and
           (nodetype=divn) and
           (nodetype=divn) and
@@ -173,7 +178,10 @@ implementation
                   end
                   end
                else
                else
                  cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SHR,OS_INT,power,numerator,resultreg)
                  cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SHR,OS_INT,power,numerator,resultreg)
-             end;
+             end
+           else {Everything else is handled the generic code}
+             cg.g_div_const_reg_reg(current_asmdata.CurrAsmList,def_cgsize(resultdef),
+               tordconstnode(right).value.svalue,numerator,resultreg);
          end;
          end;
 
 
 {
 {

+ 4 - 0
compiler/arm/rgcpu.pas

@@ -290,6 +290,10 @@ unit rgcpu;
         if abs(spilltemp.offset)>4095 then
         if abs(spilltemp.offset)>4095 then
           exit;
           exit;
 
 
+        if GenerateThumbCode and
+          (abs(spilltemp.offset)>1020) then
+          exit;
+
         { Replace 'mov  dst,orgreg' with 'ldr  dst,spilltemp'
         { Replace 'mov  dst,orgreg' with 'ldr  dst,spilltemp'
           and     'mov  orgreg,src' with 'str  dst,spilltemp' }
           and     'mov  orgreg,src' with 'str  dst,spilltemp' }
         with instr do
         with instr do

+ 70 - 0
compiler/cgobj.pas

@@ -250,6 +250,10 @@ unit cgobj;
           { bit scan instructions }
           { bit scan instructions }
           procedure a_bit_scan_reg_reg(list: TAsmList; reverse: boolean; size: tcgsize; src, dst: TRegister); virtual; abstract;
           procedure a_bit_scan_reg_reg(list: TAsmList; reverse: boolean; size: tcgsize; src, dst: TRegister); virtual; abstract;
 
 
+          { Multiplication with doubling result size.
+            dstlo or dsthi may be NR_NO, in which case corresponding half of result is discarded. }
+          procedure a_mul_reg_reg_pair(list: TAsmList; size: tcgsize; src1,src2,dstlo,dsthi: TRegister);virtual;
+
           { fpu move instructions }
           { fpu move instructions }
           procedure a_loadfpu_reg_reg(list: TAsmList; fromsize, tosize:tcgsize; reg1, reg2: tregister); virtual; abstract;
           procedure a_loadfpu_reg_reg(list: TAsmList; fromsize, tosize:tcgsize; reg1, reg2: tregister); virtual; abstract;
           procedure a_loadfpu_ref_reg(list: TAsmList; fromsize, tosize: tcgsize; const ref: treference; reg: tregister); virtual; abstract;
           procedure a_loadfpu_ref_reg(list: TAsmList; fromsize, tosize: tcgsize; const ref: treference; reg: tregister); virtual; abstract;
@@ -459,6 +463,9 @@ unit cgobj;
           { Generate code to exit an unwind-protected region. The default implementation
           { Generate code to exit an unwind-protected region. The default implementation
             produces a simple jump to destination label. }
             produces a simple jump to destination label. }
           procedure g_local_unwind(list: TAsmList; l: TAsmLabel);virtual;
           procedure g_local_unwind(list: TAsmList; l: TAsmLabel);virtual;
+          { Generate code for integer division by constant,
+            generic version is suitable for 3-address CPUs }
+          procedure g_div_const_reg_reg(list:tasmlist; size: TCgSize; a: tcgint; src,dst: tregister); virtual;
 
 
          protected
          protected
           function g_indirect_sym_load(list:TAsmList;const symname: string; const flags: tindsymflags): tregister;virtual;
           function g_indirect_sym_load(list:TAsmList;const symname: string; const flags: tindsymflags): tregister;virtual;
@@ -2508,6 +2515,69 @@ implementation
         internalerror(200807238);
         internalerror(200807238);
       end;
       end;
 
 
+
+    procedure tcg.a_mul_reg_reg_pair(list: TAsmList; size: TCgSize; src1,src2,dstlo,dsthi: TRegister);
+      begin
+        internalerror(2014060801);
+      end;
+
+
+    procedure tcg.g_div_const_reg_reg(list:tasmlist; size: TCgSize; a: tcgint; src,dst: tregister);
+      var
+        divreg: tregister;
+        magic: aInt;
+        u_magic: aWord;
+        u_shift: byte;
+        u_add: boolean;
+      begin
+        divreg:=getintregister(list,OS_INT);
+        if (size in [OS_S32,OS_S64]) then
+          begin
+            calc_divconst_magic_signed(tcgsize2size[size]*8,a,magic,u_shift);
+            { load magic value }
+            a_load_const_reg(list,OS_INT,magic,divreg);
+            { multiply, discarding low bits }
+            a_mul_reg_reg_pair(list,size,src,divreg,NR_NO,dst);
+            { add/subtract numerator }
+            if (a>0) and (magic<0) then
+              a_op_reg_reg_reg(list,OP_ADD,OS_INT,src,dst,dst)
+            else if (a<0) and (magic>0) then
+              a_op_reg_reg_reg(list,OP_SUB,OS_INT,src,dst,dst);
+            { shift shift places to the right (arithmetic) }
+            a_op_const_reg_reg(list,OP_SAR,OS_INT,u_shift,dst,dst);
+            { extract and add sign bit }
+            if (a>=0) then
+              a_op_const_reg_reg(list,OP_SHR,OS_INT,tcgsize2size[size]*8-1,src,divreg)
+            else
+              a_op_const_reg_reg(list,OP_SHR,OS_INT,tcgsize2size[size]*8-1,dst,divreg);
+            a_op_reg_reg_reg(list,OP_ADD,OS_INT,dst,divreg,dst);
+          end
+        else if (size in [OS_32,OS_64]) then
+          begin
+            calc_divconst_magic_unsigned(tcgsize2size[size]*8,a,u_magic,u_add,u_shift);
+            { load magic in divreg }
+            a_load_const_reg(list,OS_INT,tcgint(u_magic),divreg);
+            { multiply, discarding low bits }
+            a_mul_reg_reg_pair(list,size,src,divreg,NR_NO,dst);
+            if (u_add) then
+              begin
+                { Calculate "(numerator+result) shr u_shift", avoiding possible overflow }
+                a_op_reg_reg_reg(list,OP_SUB,OS_INT,dst,src,divreg);
+                { divreg=(numerator-result) }
+                a_op_const_reg_reg(list,OP_SHR,OS_INT,1,divreg,divreg);
+                { divreg=(numerator-result)/2 }
+                a_op_reg_reg_reg(list,OP_ADD,OS_INT,divreg,dst,divreg);
+                { divreg=(numerator+result)/2, already shifted by 1, so decrease u_shift. }
+                a_op_const_reg_reg(list,OP_SHR,OS_INT,u_shift-1,divreg,dst);
+              end
+            else
+              a_op_const_reg_reg(list,OP_SHR,OS_INT,u_shift,dst,dst);
+          end
+        else
+          InternalError(2014060601);
+      end;
+
+
 {*****************************************************************************
 {*****************************************************************************
                                     TCG64
                                     TCG64
 *****************************************************************************}
 *****************************************************************************}

+ 101 - 0
compiler/cgutils.pas

@@ -176,6 +176,12 @@ unit cgutils;
     { returns r with the given alignment }
     { returns r with the given alignment }
     function setalignment(const r : treference;b : byte) : treference;
     function setalignment(const r : treference;b : byte) : treference;
 
 
+    { Helper function which calculate "magic" values for replacement of division
+      by constant operation by multiplication. See the "PowerPC compiler developer
+      manual" for more information.
+      N is number of bits to handle, functionality tested for values 32 and 64. }
+    procedure calc_divconst_magic_signed(N: byte; d: aInt; out magic_m: aInt; out magic_s: byte);
+    procedure calc_divconst_magic_unsigned(N: byte; d: aWord; out magic_m: aWord; out magic_add: boolean; out magic_shift: byte);
 
 
 implementation
 implementation
 
 
@@ -328,5 +334,100 @@ uses
       end;
       end;
 
 
 
 
+{$push}
+{$r-,q-}
+    procedure calc_divconst_magic_signed(N: byte; d: aInt; out magic_m: aInt; out magic_s: byte);
+      var
+        p: aInt;
+        ad,anc,delta,q1,r1,q2,r2,t: aWord;
+        two_N_minus_1: aWord;
+      begin
+        assert((d<-1) or (d>1));
+        two_N_minus_1:=aWord(1) shl (N-1);
+
+        ad:=abs(d);
+        t:=two_N_minus_1+(aWord(d) shr (N-1));
+        anc:=t-1-t mod ad;               { absolute value of nc }
+        p:=(N-1);                        { initialize p }
+        q1:=two_N_minus_1 div anc;       { initialize q1 = 2**p/abs(nc) }
+        r1:=two_N_minus_1-q1*anc;        { initialize r1 = rem(2**p,abs(nc)) }
+        q2:=two_N_minus_1 div ad;        { initialize q2 = 2**p/abs(d) }
+        r2:=two_N_minus_1-q2*ad;         { initialize r2 = rem(2**p,abs(d)) }
+        repeat
+          inc(p);
+          q1:=2*q1;           { update q1 = 2**p/abs(nc) }
+          r1:=2*r1;           { update r1 = rem(2**p/abs(nc)) }
+          if (r1>=anc) then   { must be unsigned comparison }
+            begin
+              inc(q1);
+              dec(r1,anc);
+            end;
+          q2:=2*q2;           { update q2 = 2p/abs(d) }
+          r2:=2*r2;           { update r2 = rem(2p/abs(d)) }
+          if (r2>=ad) then    { must be unsigned comparison }
+            begin
+              inc(q2);
+              dec(r2,ad);
+            end;
+          delta:=ad-r2;
+        until not ((q1<delta) or ((q1=delta) and (r1=0)));
+        magic_m:=q2+1;
+        if (d<0) then
+          magic_m:=-magic_m;  { resulting magic number }
+        magic_s:=p-N;         { resulting shift }
+      end;
+
+
+    procedure calc_divconst_magic_unsigned(N: byte; d: aWord; out magic_m: aWord; out magic_add: boolean; out magic_shift: byte);
+      var
+        p: aInt;
+        nc,delta,q1,r1,q2,r2,two_N_minus_1 : aWord;
+        mask: aWord;
+      begin
+        two_N_minus_1:=aWord(1) shl (N-1);
+        magic_add:=false;
+{$push}
+{$warnings off }
+        mask:=aWord(not 0) shr ((64-N) and (sizeof(aWord)*8-1));
+        nc:=(mask-(-d) mod aInt(d));
+{$pop}
+        p:=N-1;                       { initialize p }
+        q1:=two_N_minus_1 div nc;     { initialize q1 = 2**p/nc }
+        r1:=two_N_minus_1-q1*nc;      { initialize r1 = rem(2**p,nc) }
+        q2:=(two_N_minus_1-1) div d;  { initialize q2 = (2**p-1)/d }
+        r2:=(two_N_minus_1-1)-q2*d;   { initialize r2 = rem((2**p-1),d) }
+        repeat
+          inc(p);
+          if (r1>=(nc-r1)) then
+            begin
+              q1:=2*q1+1;    { update q1 }
+              r1:=2*r1-nc;   { update r1 }
+            end
+          else
+            begin
+              q1:=2*q1;      { update q1 }
+              r1:=2*r1;      { update r1 }
+            end;
+          if ((r2+1)>=(d-r2)) then
+            begin
+              if (q2>=(two_N_minus_1-1)) then
+                magic_add:=true;
+              q2:=2*q2+1;    { update q2 }
+              r2:=2*r2+1-d;  { update r2 }
+            end
+          else
+            begin
+              if (q2>=two_N_minus_1) then
+                magic_add:=true;
+              q2:=2*q2;      { update q2 }
+              r2:=2*r2+1;    { update r2 }
+            end;
+          delta:=d-1-r2;
+        until not ((p<(2*N)) and ((q1<delta) or ((q1=delta) and (r1=0))));
+        magic_m:=(q2+1) and mask;        { resulting magic number }
+        magic_shift:=p-N;     { resulting shift }
+      end;
+{$pop}
+
 end.
 end.
 
 

+ 3 - 1
compiler/dbgbase.pas

@@ -418,7 +418,9 @@ implementation
         beforeappendsym(list,sym);
         beforeappendsym(list,sym);
         case sym.typ of
         case sym.typ of
           staticvarsym :
           staticvarsym :
-            appendsym_staticvar(list,tstaticvarsym(sym));
+            if not assigned(tstaticvarsym(sym).fieldvarsym) or
+               not(df_generic in tdef(tstaticvarsym(sym).fieldvarsym.owner.defowner).defoptions) then
+              appendsym_staticvar(list,tstaticvarsym(sym));
           unitsym:
           unitsym:
             appendsym_unit(list,tunitsym(sym));
             appendsym_unit(list,tunitsym(sym));
           labelsym :
           labelsym :

+ 37 - 0
compiler/defcmp.pas

@@ -213,6 +213,7 @@ implementation
       var
       var
          subeq,eq : tequaltype;
          subeq,eq : tequaltype;
          hd1,hd2 : tdef;
          hd1,hd2 : tdef;
+         def_generic : tstoreddef;
          hct : tconverttype;
          hct : tconverttype;
          hobjdef : tobjectdef;
          hobjdef : tobjectdef;
          hpd : tprocdef;
          hpd : tprocdef;
@@ -324,6 +325,42 @@ implementation
                  exit;
                  exit;
                end;
                end;
            end;
            end;
+         { handling of partial specializations }
+         if (
+               (df_generic in def_to.defoptions) and
+               (df_specialization in def_from.defoptions) and
+               (tstoreddef(def_from).genericdef=def_to)
+             ) or (
+               (df_generic in def_from.defoptions) and
+               (df_specialization in def_to.defoptions) and
+               (tstoreddef(def_to).genericdef=def_from)
+             ) then
+           begin
+             if tstoreddef(def_from).genericdef=def_to then
+               def_generic:=tstoreddef(def_to)
+             else
+               def_generic:=tstoreddef(def_from);
+             if not assigned(def_generic.genericparas) then
+               internalerror(2014052306);
+             diff:=false;
+             for i:=0 to def_generic.genericparas.count-1 do
+               begin
+                 symfrom:=tsym(def_generic.genericparas[i]);
+                 if symfrom.typ<>typesym then
+                   internalerror(2014052307);
+                 if ttypesym(symfrom).typedef.typ<>undefineddef then
+                   diff:=true;
+                 if diff then
+                   break;
+               end;
+             if not diff then
+               begin
+                 doconv:=tc_equal;
+                 { the definitions are not exactly the same, but only equal }
+                 compare_defs_ext:=te_equal;
+                 exit;
+               end;
+           end;
 
 
          { we walk the wanted (def_to) types and check then the def_from
          { we walk the wanted (def_to) types and check then the def_from
            types if there is a conversion possible }
            types if there is a conversion possible }

+ 20 - 2
compiler/defutil.pas

@@ -331,6 +331,13 @@ interface
     { returns true of def is a methodpointer }
     { returns true of def is a methodpointer }
     function is_methodpointer(def : tdef) : boolean;
     function is_methodpointer(def : tdef) : boolean;
 
 
+    {# returns the appropriate int type for pointer arithmetic with the given pointer type.
+       When adding or subtracting a number to/from a pointer, this function returns the
+       int type to which that number has to be converted, before the operation can be performed.
+       Normally, this is sinttype, except on i8086, where it takes into account the
+       special i8086 pointer types (near, far, huge). }
+    function get_int_type_for_pointer_arithmetic(p : tdef) : tdef;
+
 {$ifdef i8086}
 {$ifdef i8086}
     {# Returns true if p is a far pointer def }
     {# Returns true if p is a far pointer def }
     function is_farpointer(p : tdef) : boolean;
     function is_farpointer(p : tdef) : boolean;
@@ -685,10 +692,10 @@ implementation
     { true, if p points to an open array def }
     { true, if p points to an open array def }
     function is_open_array(p : tdef) : boolean;
     function is_open_array(p : tdef) : boolean;
       begin
       begin
-         { check for s32inttype is needed, because for u32bit the high
+         { check for ptrsinttype is needed, because for unsigned the high
            range is also -1 ! (PFV) }
            range is also -1 ! (PFV) }
          result:=(p.typ=arraydef) and
          result:=(p.typ=arraydef) and
-                 (tarraydef(p).rangedef=s32inttype) and
+                 (tarraydef(p).rangedef=ptrsinttype) and
                  (tarraydef(p).lowrange=0) and
                  (tarraydef(p).lowrange=0) and
                  (tarraydef(p).highrange=-1) and
                  (tarraydef(p).highrange=-1) and
                  ((tarraydef(p).arrayoptions * [ado_IsVariant,ado_IsArrayOfConst,ado_IsConstructor,ado_IsDynamicArray])=[]);
                  ((tarraydef(p).arrayoptions * [ado_IsVariant,ado_IsArrayOfConst,ado_IsConstructor,ado_IsDynamicArray])=[]);
@@ -1433,6 +1440,17 @@ implementation
         result:=(def.typ=procvardef) and (po_methodpointer in tprocvardef(def).procoptions);
         result:=(def.typ=procvardef) and (po_methodpointer in tprocvardef(def).procoptions);
       end;
       end;
 
 
+
+    function get_int_type_for_pointer_arithmetic(p : tdef) : tdef;
+      begin
+{$ifdef i8086}
+        if is_hugepointer(p) then
+          result:=s32inttype
+        else
+{$endif i8086}
+          result:=sinttype;
+      end;
+
 {$ifdef i8086}
 {$ifdef i8086}
     { true if p is a far pointer def }
     { true if p is a far pointer def }
     function is_farpointer(p : tdef) : boolean;
     function is_farpointer(p : tdef) : boolean;

+ 7 - 15
compiler/finput.pas

@@ -226,7 +226,7 @@ uses
          close;
          close;
       { free memory }
       { free memory }
         if assigned(linebuf) then
         if assigned(linebuf) then
-         freemem(linebuf,maxlinebuf shl 2);
+         freemem(linebuf,maxlinebuf*sizeof(linebuf^[0]));
       end;
       end;
 
 
 
 
@@ -368,24 +368,16 @@ uses
 
 
 
 
     procedure tinputfile.setline(line,linepos:longint);
     procedure tinputfile.setline(line,linepos:longint);
-      var
-        oldlinebuf  : plongintarr;
       begin
       begin
         if line<1 then
         if line<1 then
          exit;
          exit;
         while (line>=maxlinebuf) do
         while (line>=maxlinebuf) do
-         begin
-           oldlinebuf:=linebuf;
-         { create new linebuf and move old info }
-           getmem(linebuf,(maxlinebuf+linebufincrease) shl 2);
-           if assigned(oldlinebuf) then
-            begin
-              move(oldlinebuf^,linebuf^,maxlinebuf shl 2);
-              freemem(oldlinebuf,maxlinebuf shl 2);
-            end;
-           fillchar(linebuf^[maxlinebuf],linebufincrease shl 2,0);
-           inc(maxlinebuf,linebufincrease);
-         end;
+          begin
+            { create new linebuf and move old info }
+            linebuf:=reallocmem(linebuf,(maxlinebuf+linebufincrease)*sizeof(linebuf^[0]));
+            fillchar(linebuf^[maxlinebuf],linebufincrease*sizeof(linebuf^[0]),0);
+            inc(maxlinebuf,linebufincrease);
+          end;
         linebuf^[line]:=linepos;
         linebuf^[line]:=linepos;
       end;
       end;
 
 

+ 22 - 17
compiler/fmodule.pas

@@ -224,7 +224,6 @@ interface
         procedure flagdependent(callermodule:tmodule);
         procedure flagdependent(callermodule:tmodule);
         function  addusedunit(hp:tmodule;inuses:boolean;usym:tunitsym):tused_unit;
         function  addusedunit(hp:tmodule;inuses:boolean;usym:tunitsym):tused_unit;
         procedure updatemaps;
         procedure updatemaps;
-        procedure check_hints;
         function  derefidx_unit(id:longint):longint;
         function  derefidx_unit(id:longint):longint;
         function  resolve_unit(id:longint):tmodule;
         function  resolve_unit(id:longint):tmodule;
         procedure allunitsused;
         procedure allunitsused;
@@ -243,6 +242,7 @@ interface
           u               : tmodule;
           u               : tmodule;
           unitsym         : tunitsym;
           unitsym         : tunitsym;
           constructor create(_u : tmodule;intface,inuses:boolean;usym:tunitsym);
           constructor create(_u : tmodule;intface,inuses:boolean;usym:tunitsym);
+          procedure check_hints;
        end;
        end;
 
 
        tdependent_unit = class(tlinkedlistitem)
        tdependent_unit = class(tlinkedlistitem)
@@ -478,6 +478,27 @@ implementation
       end;
       end;
 
 
 
 
+    procedure tused_unit.check_hints;
+      var
+        uname: pshortstring;
+      begin
+        uname:=u.realmodulename;
+        if mo_hint_deprecated in u.moduleoptions then
+          if (mo_has_deprecated_msg in u.moduleoptions) and (u.deprecatedmsg <> nil) then
+            MessagePos2(unitsym.fileinfo,sym_w_deprecated_unit_with_msg,uname^,u.deprecatedmsg^)
+          else
+            MessagePos1(unitsym.fileinfo,sym_w_deprecated_unit,uname^);
+        if mo_hint_experimental in u.moduleoptions then
+          MessagePos1(unitsym.fileinfo,sym_w_experimental_unit,uname^);
+        if mo_hint_platform in u.moduleoptions then
+          MessagePos1(unitsym.fileinfo,sym_w_non_portable_unit,uname^);
+        if mo_hint_library in u.moduleoptions then
+          MessagePos1(unitsym.fileinfo,sym_w_library_unit,uname^);
+        if mo_hint_unimplemented in u.moduleoptions then
+          MessagePos1(unitsym.fileinfo,sym_w_non_implemented_unit,uname^);
+      end;
+
+
 {****************************************************************************
 {****************************************************************************
                             TDENPENDENT_UNIT
                             TDENPENDENT_UNIT
  ****************************************************************************}
  ****************************************************************************}
@@ -912,22 +933,6 @@ implementation
           end;
           end;
       end;
       end;
 
 
-    procedure tmodule.check_hints;
-      begin
-        if mo_hint_deprecated in moduleoptions then
-          if (mo_has_deprecated_msg in moduleoptions) and (deprecatedmsg <> nil) then
-            Message2(sym_w_deprecated_unit_with_msg,realmodulename^,deprecatedmsg^)
-          else
-            Message1(sym_w_deprecated_unit,realmodulename^);
-        if mo_hint_experimental in moduleoptions then
-          Message1(sym_w_experimental_unit,realmodulename^);
-        if mo_hint_platform in moduleoptions then
-          Message1(sym_w_non_portable_unit,realmodulename^);
-        if mo_hint_library in moduleoptions then
-          Message1(sym_w_library_unit,realmodulename^);
-        if mo_hint_unimplemented in moduleoptions then
-          Message1(sym_w_non_implemented_unit,realmodulename^);
-      end;
 
 
 
 
     function tmodule.derefidx_unit(id:longint):longint;
     function tmodule.derefidx_unit(id:longint):longint;

+ 1 - 0
compiler/fpcdefs.inc

@@ -178,6 +178,7 @@
   {$define cpufpemu}
   {$define cpufpemu}
   {$define cpurefshaveindexreg}
   {$define cpurefshaveindexreg}
   {$define cpucapabilities}
   {$define cpucapabilities}
+  {$define cpuneedsdiv32helper}
 {$endif m68k}
 {$endif m68k}
 
 
 {$ifdef avr}
 {$ifdef avr}

+ 1 - 0
compiler/globals.pas

@@ -322,6 +322,7 @@ interface
        pendingstate       : tpendingstate;
        pendingstate       : tpendingstate;
      { Memory sizes }
      { Memory sizes }
        heapsize,
        heapsize,
+       maxheapsize,
        stacksize,
        stacksize,
        jmp_buf_size,
        jmp_buf_size,
        jmp_buf_align : longint;
        jmp_buf_align : longint;

+ 3 - 1
compiler/globtype.pas

@@ -145,7 +145,9 @@ interface
          cs_check_var_copyout,
          cs_check_var_copyout,
          cs_zerobasedstrings,
          cs_zerobasedstrings,
          { i8086 specific }
          { i8086 specific }
-         cs_force_far_calls
+         cs_force_far_calls,
+         cs_hugeptr_arithmetic_normalization,
+         cs_hugeptr_comparison_normalization
        );
        );
        tlocalswitches = set of tlocalswitch;
        tlocalswitches = set of tlocalswitch;
 
 

+ 10 - 4
compiler/hlcg2ll.pas

@@ -1411,10 +1411,16 @@ implementation
                by typecasting an int64 constant to a record of 8 bytes }
                by typecasting an int64 constant to a record of 8 bytes }
              if locsize = OS_F64 then
              if locsize = OS_F64 then
                begin
                begin
-                 tmploc:=l;
-                 location_force_mem(list,tmploc,size);
-                 cg.a_load_loc_cgpara(list,tmploc,cgpara);
-                 location_freetemp(list,tmploc);
+                 if (cgpara.Location^.Next=nil) and (l.size in [OS_64,OS_S64]) and
+                   (cgpara.size in [OS_64,OS_S64]) then
+                   cg64.a_load64_reg_cgpara(list,l.register64,cgpara)
+                 else
+                   begin
+                     tmploc:=l;
+                     location_force_mem(list,tmploc,size);
+                     cg.a_load_loc_cgpara(list,tmploc,cgpara);
+                     location_freetemp(list,tmploc);
+                   end;
                end
                end
              else
              else
 {$endif not cpu64bitalu}
 {$endif not cpu64bitalu}

+ 0 - 29
compiler/i386/i386att.inc

@@ -161,10 +161,8 @@
 'iret',
 'iret',
 'iret',
 'iret',
 'iretw',
 'iretw',
-'iretq',
 'jcxz',
 'jcxz',
 'jecxz',
 'jecxz',
-'jrcxz',
 'jmp',
 'jmp',
 'lahf',
 'lahf',
 'lar',
 'lar',
@@ -200,7 +198,6 @@
 'movq',
 'movq',
 'movsb',
 'movsb',
 'movsl',
 'movsl',
-'movsq',
 'movsw',
 'movsw',
 'movs',
 'movs',
 'movz',
 'movz',
@@ -272,7 +269,6 @@
 'popf',
 'popf',
 'popfl',
 'popfl',
 'popfw',
 'popfw',
-'popfq',
 'por',
 'por',
 'prefetch',
 'prefetch',
 'prefetchw',
 'prefetchw',
@@ -306,7 +302,6 @@
 'pushf',
 'pushf',
 'pushfl',
 'pushfl',
 'pushfw',
 'pushfw',
-'pushfq',
 'pxor',
 'pxor',
 'rcl',
 'rcl',
 'rcr',
 'rcr',
@@ -334,7 +329,6 @@
 'sbb',
 'sbb',
 'scasb',
 'scasb',
 'scasl',
 'scasl',
-'scasq',
 'scasw',
 'scasw',
 'cs',
 'cs',
 'ds',
 'ds',
@@ -596,10 +590,6 @@
 'xsha256',
 'xsha256',
 'dmint',
 'dmint',
 'rdm',
 'rdm',
-'movabs',
-'movslq',
-'cqto',
-'cmpxchg16b',
 'movntss',
 'movntss',
 'movntsd',
 'movntsd',
 'insertq',
 'insertq',
@@ -637,11 +627,9 @@
 'pcmpeqq',
 'pcmpeqq',
 'pextrb',
 'pextrb',
 'pextrd',
 'pextrd',
-'pextrq',
 'phminposuw',
 'phminposuw',
 'pinsrb',
 'pinsrb',
 'pinsrd',
 'pinsrd',
-'pinsrq',
 'pmaxsb',
 'pmaxsb',
 'pmaxsd',
 'pmaxsd',
 'pmaxud',
 'pmaxud',
@@ -682,9 +670,6 @@
 'aesdeclast',
 'aesdeclast',
 'aesimc',
 'aesimc',
 'aeskeygenassist',
 'aeskeygenassist',
-'stosq',
-'lodsq',
-'cmpsq',
 'vaddpd',
 'vaddpd',
 'vaddps',
 'vaddps',
 'vaddsd',
 'vaddsd',
@@ -971,20 +956,6 @@
 'vpsravd',
 'vpsravd',
 'vpsrlvd',
 'vpsrlvd',
 'vpsrlvq',
 'vpsrlvq',
-'add4s',
-'brkem',
-'clr1',
-'cmp4s',
-'ext',
-'ins',
-'not1',
-'repc',
-'repnc',
-'rol4',
-'ror4',
-'set1',
-'sub4s',
-'test1',
 'vfmadd132pd',
 'vfmadd132pd',
 'vfmadd213pd',
 'vfmadd213pd',
 'vfmadd231pd',
 'vfmadd231pd',

+ 0 - 29
compiler/i386/i386atts.inc

@@ -163,8 +163,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
 attsufINT,
 attsufINT,
@@ -201,7 +199,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINTdual,
 attsufINTdual,
 attsufINTdual,
 attsufINTdual,
 attsufINT,
 attsufINT,
@@ -273,7 +270,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
@@ -307,7 +303,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
@@ -342,7 +337,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
@@ -599,10 +593,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufNONE,
-attsufNONE,
-attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
@@ -667,8 +657,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -713,9 +701,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
 attsufMM,
 attsufMM,
 attsufMM,
 attsufMM,
 attsufNONE,
 attsufNONE,
@@ -1031,19 +1016,5 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
 attsufNONE
 attsufNONE
 );
 );

+ 0 - 29
compiler/i386/i386int.inc

@@ -161,10 +161,8 @@
 'iret',
 'iret',
 'iretd',
 'iretd',
 'iretw',
 'iretw',
-'iretq',
 'jcxz',
 'jcxz',
 'jecxz',
 'jecxz',
-'jrcxz',
 'jmp',
 'jmp',
 'lahf',
 'lahf',
 'lar',
 'lar',
@@ -200,7 +198,6 @@
 'movq',
 'movq',
 'movsb',
 'movsb',
 'movsd',
 'movsd',
-'movsq',
 'movsw',
 'movsw',
 'movsx',
 'movsx',
 'movzx',
 'movzx',
@@ -272,7 +269,6 @@
 'popf',
 'popf',
 'popfd',
 'popfd',
 'popfw',
 'popfw',
-'popfq',
 'por',
 'por',
 'prefetch',
 'prefetch',
 'prefetchw',
 'prefetchw',
@@ -306,7 +302,6 @@
 'pushf',
 'pushf',
 'pushfd',
 'pushfd',
 'pushfw',
 'pushfw',
-'pushfq',
 'pxor',
 'pxor',
 'rcl',
 'rcl',
 'rcr',
 'rcr',
@@ -334,7 +329,6 @@
 'sbb',
 'sbb',
 'scasb',
 'scasb',
 'scasd',
 'scasd',
-'scasq',
 'scasw',
 'scasw',
 'segcs',
 'segcs',
 'segds',
 'segds',
@@ -596,10 +590,6 @@
 'xsha256',
 'xsha256',
 'dmint',
 'dmint',
 'rdm',
 'rdm',
-'movabs',
-'movsxd',
-'cqo',
-'cmpxchg16b',
 'movntss',
 'movntss',
 'movntsd',
 'movntsd',
 'insertq',
 'insertq',
@@ -637,11 +627,9 @@
 'pcmpeqq',
 'pcmpeqq',
 'pextrb',
 'pextrb',
 'pextrd',
 'pextrd',
-'pextrq',
 'phminposuw',
 'phminposuw',
 'pinsrb',
 'pinsrb',
 'pinsrd',
 'pinsrd',
-'pinsrq',
 'pmaxsb',
 'pmaxsb',
 'pmaxsd',
 'pmaxsd',
 'pmaxud',
 'pmaxud',
@@ -682,9 +670,6 @@
 'aesdeclast',
 'aesdeclast',
 'aesimc',
 'aesimc',
 'aeskeygenassist',
 'aeskeygenassist',
-'stosq',
-'lodsq',
-'cmpsq',
 'vaddpd',
 'vaddpd',
 'vaddps',
 'vaddps',
 'vaddsd',
 'vaddsd',
@@ -971,20 +956,6 @@
 'vpsravd',
 'vpsravd',
 'vpsrlvd',
 'vpsrlvd',
 'vpsrlvq',
 'vpsrlvq',
-'add4s',
-'brkem',
-'clr1',
-'cmp4s',
-'ext',
-'ins',
-'not1',
-'repc',
-'repnc',
-'rol4',
-'ror4',
-'set1',
-'sub4s',
-'test1',
 'vfmadd132pd',
 'vfmadd132pd',
 'vfmadd213pd',
 'vfmadd213pd',
 'vfmadd231pd',
 'vfmadd231pd',

+ 0 - 29
compiler/i386/i386op.inc

@@ -161,10 +161,8 @@ A_INVLPG,
 A_IRET,
 A_IRET,
 A_IRETD,
 A_IRETD,
 A_IRETW,
 A_IRETW,
-A_IRETQ,
 A_JCXZ,
 A_JCXZ,
 A_JECXZ,
 A_JECXZ,
-A_JRCXZ,
 A_JMP,
 A_JMP,
 A_LAHF,
 A_LAHF,
 A_LAR,
 A_LAR,
@@ -200,7 +198,6 @@ A_MOVD,
 A_MOVQ,
 A_MOVQ,
 A_MOVSB,
 A_MOVSB,
 A_MOVSD,
 A_MOVSD,
-A_MOVSQ,
 A_MOVSW,
 A_MOVSW,
 A_MOVSX,
 A_MOVSX,
 A_MOVZX,
 A_MOVZX,
@@ -272,7 +269,6 @@ A_POPAW,
 A_POPF,
 A_POPF,
 A_POPFD,
 A_POPFD,
 A_POPFW,
 A_POPFW,
-A_POPFQ,
 A_POR,
 A_POR,
 A_PREFETCH,
 A_PREFETCH,
 A_PREFETCHW,
 A_PREFETCHW,
@@ -306,7 +302,6 @@ A_PUSHAW,
 A_PUSHF,
 A_PUSHF,
 A_PUSHFD,
 A_PUSHFD,
 A_PUSHFW,
 A_PUSHFW,
-A_PUSHFQ,
 A_PXOR,
 A_PXOR,
 A_RCL,
 A_RCL,
 A_RCR,
 A_RCR,
@@ -334,7 +329,6 @@ A_SAR,
 A_SBB,
 A_SBB,
 A_SCASB,
 A_SCASB,
 A_SCASD,
 A_SCASD,
-A_SCASQ,
 A_SCASW,
 A_SCASW,
 A_SEGCS,
 A_SEGCS,
 A_SEGDS,
 A_SEGDS,
@@ -596,10 +590,6 @@ A_XSHA1,
 A_XSHA256,
 A_XSHA256,
 A_DMINT,
 A_DMINT,
 A_RDM,
 A_RDM,
-A_MOVABS,
-A_MOVSXD,
-A_CQO,
-A_CMPXCHG16B,
 A_MOVNTSS,
 A_MOVNTSS,
 A_MOVNTSD,
 A_MOVNTSD,
 A_INSERTQ,
 A_INSERTQ,
@@ -637,11 +627,9 @@ A_PBLENDW,
 A_PCMPEQQ,
 A_PCMPEQQ,
 A_PEXTRB,
 A_PEXTRB,
 A_PEXTRD,
 A_PEXTRD,
-A_PEXTRQ,
 A_PHMINPOSUW,
 A_PHMINPOSUW,
 A_PINSRB,
 A_PINSRB,
 A_PINSRD,
 A_PINSRD,
-A_PINSRQ,
 A_PMAXSB,
 A_PMAXSB,
 A_PMAXSD,
 A_PMAXSD,
 A_PMAXUD,
 A_PMAXUD,
@@ -682,9 +670,6 @@ A_AESDEC,
 A_AESDECLAST,
 A_AESDECLAST,
 A_AESIMC,
 A_AESIMC,
 A_AESKEYGENASSIST,
 A_AESKEYGENASSIST,
-A_STOSQ,
-A_LODSQ,
-A_CMPSQ,
 A_VADDPD,
 A_VADDPD,
 A_VADDPS,
 A_VADDPS,
 A_VADDSD,
 A_VADDSD,
@@ -971,20 +956,6 @@ A_VPSLLVQ,
 A_VPSRAVD,
 A_VPSRAVD,
 A_VPSRLVD,
 A_VPSRLVD,
 A_VPSRLVQ,
 A_VPSRLVQ,
-A_ADD4S,
-A_BRKEM,
-A_CLR1,
-A_CMP4S,
-A_EXT,
-A_INS,
-A_NOT1,
-A_REPC,
-A_REPNC,
-A_ROL4,
-A_ROR4,
-A_SET1,
-A_SUB4S,
-A_TEST1,
 A_VFMADD132PD,
 A_VFMADD132PD,
 A_VFMADD213PD,
 A_VFMADD213PD,
 A_VFMADD231PD,
 A_VFMADD231PD,

+ 0 - 29
compiler/i386/i386prop.inc

@@ -161,8 +161,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_ROp1, Ch_None, Ch_None)),
 (Ch: (Ch_ROp1, Ch_None, Ch_None)),
@@ -201,7 +199,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_RWEAX, Ch_WEDX, Ch_WFlags)),
 (Ch: (Ch_RWEAX, Ch_WEDX, Ch_WFlags)),
@@ -272,7 +269,6 @@
 (Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFLAGS, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFLAGS, Ch_None)),
-(Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
@@ -306,7 +302,6 @@
 (Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFLAGS, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFLAGS, Ch_None)),
-(Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_RWFlags)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_RWFlags)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_RWFlags)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_RWFlags)),
@@ -335,7 +330,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
@@ -596,12 +590,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
-(Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
-(Ch: (Ch_MRAX, Ch_WRDX, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
@@ -682,9 +670,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_RRAX, Ch_WMemEDI, Ch_RWRDI)),
-(Ch: (Ch_WRAX, Ch_RWRSI, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
@@ -971,20 +956,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_Mop2, Ch_Rop1, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_Mop2, Ch_Rop1, Ch_None)),
-(Ch: (Ch_RWECX, Ch_RWFlags, Ch_None)),
-(Ch: (Ch_RWECX, Ch_RWFlags, Ch_None)),
-(Ch: (Ch_Mop1, Ch_RWEAX, Ch_None)),
-(Ch: (Ch_Mop1, Ch_RWEAX, Ch_None)),
-(Ch: (Ch_Mop2, Ch_Rop1, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_WFlags, Ch_Rop1, Ch_Rop2)),
 (Ch: (Ch_Mop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Mop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Mop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Mop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Mop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Mop3, Ch_Rop2, Ch_Rop1)),

+ 27 - 275
compiler/i386/n386mat.pas

@@ -29,7 +29,7 @@ interface
       node,nmat,ncgmat,nx86mat;
       node,nmat,ncgmat,nx86mat;
 
 
     type
     type
-      ti386moddivnode = class(tmoddivnode)
+      ti386moddivnode = class(tx86moddivnode)
          procedure pass_generate_code;override;
          procedure pass_generate_code;override;
       end;
       end;
 
 
@@ -61,295 +61,47 @@ implementation
                              TI386MODDIVNODE
                              TI386MODDIVNODE
 *****************************************************************************}
 *****************************************************************************}
 
 
-    function log2(i : dword) : dword;
-      begin
-        result:=0;
-        i:=i shr 1;
-        while i<>0 do
-          begin
-            i:=i shr 1;
-            inc(result);
-          end;
-      end;
 
 
 
 
    procedure ti386moddivnode.pass_generate_code;
    procedure ti386moddivnode.pass_generate_code;
       var
       var
-        hreg1,hreg2:Tregister;
+        hreg1:Tregister;
         power:longint;
         power:longint;
         hl:Tasmlabel;
         hl:Tasmlabel;
-        op:Tasmop;
-        e : longint;
-        d,l,r,s,m,a,n,t : dword;
-        m_low,m_high,j,k : qword;
       begin
       begin
-        secondpass(left);
-        if codegenerror then
-          exit;
-        secondpass(right);
-        if codegenerror then
-          exit;
-
         if is_64bitint(resultdef) then
         if is_64bitint(resultdef) then
           { should be handled in pass_1 (JM) }
           { should be handled in pass_1 (JM) }
           internalerror(200109052);
           internalerror(200109052);
-        { put numerator in register }
-        location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
-        hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,resultdef,false);
-        hreg1:=left.location.register;
 
 
-        if (nodetype=divn) and (right.nodetype=ordconstn) then
+        if (nodetype=divn) and (right.nodetype=ordconstn) and
+          is_signed(left.resultdef) and
+          ispowerof2(tordconstnode(right).value.svalue,power) and
+          ((current_settings.optimizecputype = cpu_386) or
+           (cs_opt_size in current_settings.optimizerswitches)) then
           begin
           begin
-            if ispowerof2(tordconstnode(right).value.svalue,power) then
-              begin
-                { for signed numbers, the numerator must be adjusted before the
-                  shift instruction, but not wih unsigned numbers! Otherwise,
-                  "Cardinal($ffffffff) div 16" overflows! (JM) }
-                if is_signed(left.resultdef) Then
-                  begin
-                    if (current_settings.optimizecputype <> cpu_386) and
-                       not(cs_opt_size in current_settings.optimizerswitches) then
-                      { use a sequence without jumps, saw this in
-                        comp.compilers (JM) }
-                      begin
-                        { no jumps, but more operations }
-                        hreg2:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
-                        emit_reg_reg(A_MOV,S_L,hreg1,hreg2);
-                        {If the left value is signed, hreg2=$ffffffff, otherwise 0.}
-                        emit_const_reg(A_SAR,S_L,31,hreg2);
-                        {If signed, hreg2=right value-1, otherwise 0.}
-                        emit_const_reg(A_AND,S_L,tordconstnode(right).value.svalue-1,hreg2);
-                        { add to the left value }
-                        emit_reg_reg(A_ADD,S_L,hreg2,hreg1);
-                        { do the shift }
-                        emit_const_reg(A_SAR,S_L,power,hreg1);
-                      end
-                    else
-                      begin
-                        { a jump, but less operations }
-                        emit_reg_reg(A_TEST,S_L,hreg1,hreg1);
-                        current_asmdata.getjumplabel(hl);
-                        cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NS,hl);
-                        if power=1 then
-                          emit_reg(A_INC,S_L,hreg1)
-                        else
-                          emit_const_reg(A_ADD,S_L,tordconstnode(right).value.svalue-1,hreg1);
-                        cg.a_label(current_asmdata.CurrAsmList,hl);
-                        emit_const_reg(A_SAR,S_L,power,hreg1);
-                      end
-                  end
-                else
-                  emit_const_reg(A_SHR,S_L,power,hreg1);
-                location.register:=hreg1;
-              end
+            { signed divide-by-power-of-two optimized for size }
+            secondpass(left);
+            if codegenerror then
+              exit;
+            secondpass(right);
+            if codegenerror then
+              exit;
+            hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,resultdef,false);
+            hreg1:=left.location.register;
+            emit_reg_reg(A_TEST,S_L,hreg1,hreg1);
+            current_asmdata.getjumplabel(hl);
+            cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NS,hl);
+            if power=1 then
+              emit_reg(A_INC,S_L,hreg1)
             else
             else
-              begin
-                if is_signed(left.resultdef) then
-                  begin
-                    e:=tordconstnode(right).value.svalue;
-                    d:=abs(e);
-                    { Determine algorithm (a), multiplier (m), and shift factor (s) for 32-bit
-                      signed integer division. Based on: Granlund, T.; Montgomery, P.L.:
-                      "Division by Invariant Integers using Multiplication". SIGPLAN Notices,
-                      Vol. 29, June 1994, page 61.
-                    }
-
-                    l:=log2(d);
-                    j:=qword($80000000) mod qword(d);
-                    k:=(qword(1) shl (32+l)) div (qword($80000000-j));
-                    m_low:=((qword(1)) shl (32+l)) div d;
-                    m_high:=(((qword(1)) shl (32+l)) + k) div d;
-                    while ((m_low shr 1) < (m_high shr 1)) and (l > 0) do
-                      begin
-                        m_low:=m_low shr 1;
-                        m_high:=m_high shr 1;
-                        dec(l);
-                      end;
-                    m:=dword(m_high);
-                    s:=l;
-                    if (m_high shr 31)<>0 then
-                      a:=1
-                    else
-                      a:=0;
-                    cg.getcpuregister(current_asmdata.CurrAsmList,NR_EAX);
-                    emit_const_reg(A_MOV,S_L,aint(m),NR_EAX);
-                    cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
-                    emit_reg(A_IMUL,S_L,hreg1);
-                    emit_reg_reg(A_MOV,S_L,hreg1,NR_EAX);
-                    if a<>0 then
-                      begin
-                        emit_reg_reg(A_ADD,S_L,NR_EAX,NR_EDX);
-                        {
-                          printf ("; dividend: memory location or register other than EAX or EDX\n");
-                          printf ("\n");
-                          printf ("MOV EAX, 0%08LXh\n", m);
-                          printf ("IMUL dividend\n");
-                          printf ("MOV EAX, dividend\n");
-                          printf ("ADD EDX, EAX\n");
-                          if (s) printf ("SAR EDX, %d\n", s);
-                          printf ("SHR EAX, 31\n");
-                          printf ("ADD EDX, EAX\n");
-                          if (e < 0) printf ("NEG EDX\n");
-                          printf ("\n");
-                          printf ("; quotient now in EDX\n");
-                        }
-                      end;
-                      {
-                        printf ("; dividend: memory location of register other than EAX or EDX\n");
-                        printf ("\n");
-                        printf ("MOV EAX, 0%08LXh\n", m);
-                        printf ("IMUL dividend\n");
-                        printf ("MOV EAX, dividend\n");
-                        if (s) printf ("SAR EDX, %d\n", s);
-                        printf ("SHR EAX, 31\n");
-                        printf ("ADD EDX, EAX\n");
-                        if (e < 0) printf ("NEG EDX\n");
-                        printf ("\n");
-                        printf ("; quotient now in EDX\n");
-                      }
-                    if s<>0 then
-                      emit_const_reg(A_SAR,S_L,s,NR_EDX);
-                    emit_const_reg(A_SHR,S_L,31,NR_EAX);
-                    emit_reg_reg(A_ADD,S_L,NR_EAX,NR_EDX);
-                    if e<0 then
-                      emit_reg(A_NEG,S_L,NR_EDX);
-                    cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_EDX);
-                    cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_EAX);
-                    location.register:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
-                    cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_INT,OS_INT,NR_EDX,location.register)
-                  end
-                else
-                  begin
-                    d:=tordconstnode(right).value.svalue;
-                    if d>=$80000000 then
-                      begin
-                        emit_const_reg(A_CMP,S_L,aint(d),hreg1);
-                        location.register:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
-                        emit_const_reg(A_MOV,S_L,0,location.register);
-                        emit_const_reg(A_SBB,S_L,-1,location.register);
-                      end
-                    else
-                      begin
-                        { Reduce divisor until it becomes odd }
-                        n:=0;
-                        t:=d;
-                        while (t and 1)=0 do
-                          begin
-                            t:=t shr 1;
-                            inc(n);
-                          end;
-                        { Generate m, s for algorithm 0. Based on: Granlund, T.; Montgomery,
-                        P.L.: "Division by Invariant Integers using Multiplication".
-                        SIGPLAN Notices, Vol. 29, June 1994, page 61.
-                        }
-                        l:=log2(t)+1;
-                        j:=qword($ffffffff) mod qword(t);
-                        k:=(qword(1) shl (32+l)) div (qword($ffffffff-j));
-                        m_low:=((qword(1)) shl (32+l)) div t;
-                        m_high:=(((qword(1)) shl (32+l)) + k) div t;
-                        while ((m_low shr 1) < (m_high shr 1)) and (l>0) do
-                          begin
-                            m_low:=m_low shr 1;
-                            m_high:=m_high shr 1;
-                            l:=l-1;
-                          end;
-                        if (m_high shr 32)=0 then
-                          begin
-                            m:=dword(m_high);
-                            s:=l;
-                            a:=0;
-                          end
-
-                        { Generate m, s for algorithm 1. Based on: Magenheimer, D.J.; et al:
-                        "Integer Multiplication and Division on the HP Precision Architecture".
-                        IEEE Transactions on Computers, Vol 37, No. 8, August 1988, page 980.
-                        }
-                        else
-                          begin
-                            s:=log2(t);
-                            m_low:=(qword(1) shl (32+s)) div qword(t);
-                            r:=dword(((qword(1)) shl (32+s)) mod qword(t));
-                            if (r < ((t>>1)+1)) then
-                              m:=dword(m_low)
-                            else
-                              m:=dword(m_low)+1;
-                            a:=1;
-                          end;
-                        { Reduce multiplier for either algorithm to smallest possible }
-                        while (m and 1)=0 do
-                          begin
-                            m:=m shr 1;
-                            dec(s);
-                          end;
-                        { Adjust multiplier for reduction of even divisors }
-                        inc(s,n);
-                        cg.getcpuregister(current_asmdata.CurrAsmList,NR_EAX);
-                        emit_const_reg(A_MOV,S_L,aint(m),NR_EAX);
-                        cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
-                        emit_reg(A_MUL,S_L,hreg1);
-                        if a<>0 then
-                          begin
-                            {
-                            printf ("; dividend: register other than EAX or memory location\n");
-                            printf ("\n");
-                            printf ("MOV EAX, 0%08lXh\n", m);
-                            printf ("MUL dividend\n");
-                            printf ("ADD EAX, 0%08lXh\n", m);
-                            printf ("ADC EDX, 0\n");
-                            if (s) printf ("SHR EDX, %d\n", s);
-                            printf ("\n");
-                            printf ("; quotient now in EDX\n");
-                            }
-                            emit_const_reg(A_ADD,S_L,aint(m),NR_EAX);
-                            emit_const_reg(A_ADC,S_L,0,NR_EDX);
-                          end;
-                        if s<>0 then
-                          emit_const_reg(A_SHR,S_L,aint(s),NR_EDX);
-                        cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_EDX);
-                        cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_EAX);
-                        location.register:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
-                        cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_INT,OS_INT,NR_EDX,location.register)
-                      end;
-                  end
-              end
+              emit_const_reg(A_ADD,S_L,tordconstnode(right).value.svalue-1,hreg1);
+            cg.a_label(current_asmdata.CurrAsmList,hl);
+            emit_const_reg(A_SAR,S_L,power,hreg1);
+            location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
+            location.register:=hreg1;
           end
           end
         else
         else
-          begin
-            cg.getcpuregister(current_asmdata.CurrAsmList,NR_EAX);
-            emit_reg_reg(A_MOV,S_L,hreg1,NR_EAX);
-            cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
-            {Sign extension depends on the left type.}
-            if torddef(left.resultdef).ordtype=u32bit then
-              emit_reg_reg(A_XOR,S_L,NR_EDX,NR_EDX)
-            else
-              emit_none(A_CDQ,S_NO);
-
-            {Division depends on the right type.}
-            if Torddef(right.resultdef).ordtype=u32bit then
-              op:=A_DIV
-            else
-              op:=A_IDIV;
-
-            if right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then
-              emit_ref(op,S_L,right.location.reference)
-            else if right.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
-              emit_reg(op,S_L,right.location.register)
-            else
-              begin
-                hreg1:=cg.getintregister(current_asmdata.CurrAsmList,right.location.size);
-                hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,right.resultdef,u32inttype,right.location,hreg1);
-                emit_reg(op,S_L,hreg1);
-              end;
-
-            {Copy the result into a new register. Release EAX & EDX.}
-            cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_EDX);
-            cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_EAX);
-            location.register:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
-            if nodetype=divn then
-              cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_INT,OS_INT,NR_EAX,location.register)
-            else
-              cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_INT,OS_INT,NR_EDX,location.register);
-          end;
+          inherited pass_generate_code;
       end;
       end;
 
 
 
 

+ 1 - 1
compiler/i8086/cpunode.pas

@@ -57,7 +57,7 @@ unit cpunode;
        n8086mat,
        n8086mat,
        n8086con,
        n8086con,
        { these are not really nodes }
        { these are not really nodes }
-       n8086tcon,tgcpu,
+       n8086util,n8086tcon,tgcpu,
        { symtable }
        { symtable }
        symcpu
        symcpu
        ;
        ;

+ 19 - 4
compiler/i8086/hlcgcpu.pas

@@ -52,7 +52,9 @@ interface
         and registerhi with the following sizes:
         and registerhi with the following sizes:
 
 
         register   - cgsize = int_cgsize(voidcodepointertype.size)
         register   - cgsize = int_cgsize(voidcodepointertype.size)
-        registerhi - cgsize = int_cgsize(voidpointertype.size) }
+        registerhi - cgsize = int_cgsize(voidpointertype.size) or int_cgsize(parentfpvoidpointertype.size)
+                              (check d.size to determine which one of the two)
+        }
       function is_methodptr_like_type(d:tdef): boolean;
       function is_methodptr_like_type(d:tdef): boolean;
 
 
       { 4-byte records in registers need special handling as well. A record may
       { 4-byte records in registers need special handling as well. A record may
@@ -271,7 +273,8 @@ implementation
             ref.segment:=NR_GS;
             ref.segment:=NR_GS;
           x86pt_far,
           x86pt_far,
           x86pt_huge:
           x86pt_huge:
-            ref.segment:=GetNextReg(reg);
+            if reg<>NR_NO then
+              ref.segment:=GetNextReg(reg);
         end;
         end;
     end;
     end;
 
 
@@ -306,7 +309,13 @@ implementation
           tmpref:=ref;
           tmpref:=ref;
           a_load_reg_ref(list,voidcodepointertype,voidcodepointertype,loc.register,tmpref);
           a_load_reg_ref(list,voidcodepointertype,voidcodepointertype,loc.register,tmpref);
           inc(tmpref.offset,voidcodepointertype.size);
           inc(tmpref.offset,voidcodepointertype.size);
-          a_load_reg_ref(list,voidpointertype,voidpointertype,loc.registerhi,tmpref);
+          { the second part could be either self or parentfp }
+          if tosize.size=(voidcodepointertype.size+voidpointertype.size) then
+            a_load_reg_ref(list,voidpointertype,voidpointertype,loc.registerhi,tmpref)
+          else if tosize.size=(voidcodepointertype.size+parentfpvoidpointertype.size) then
+            a_load_reg_ref(list,parentfpvoidpointertype,parentfpvoidpointertype,loc.registerhi,tmpref)
+          else
+            internalerror(2014052201);
         end
         end
       else if is_fourbyterecord(tosize) and (loc.loc in [LOC_REGISTER,LOC_CREGISTER]) then
       else if is_fourbyterecord(tosize) and (loc.loc in [LOC_REGISTER,LOC_CREGISTER]) then
         begin
         begin
@@ -395,7 +404,13 @@ implementation
 
 
           a_load_reg_ref(list,voidcodepointertype,voidcodepointertype,l.register,tmpref);
           a_load_reg_ref(list,voidcodepointertype,voidcodepointertype,l.register,tmpref);
           inc(tmpref.offset,voidcodepointertype.size);
           inc(tmpref.offset,voidcodepointertype.size);
-          a_load_reg_ref(list,voidpointertype,voidpointertype,l.registerhi,tmpref);
+          { the second part could be either self or parentfp }
+          if size.size=(voidcodepointertype.size+voidpointertype.size) then
+            a_load_reg_ref(list,voidpointertype,voidpointertype,l.registerhi,tmpref)
+          else if size.size=(voidcodepointertype.size+parentfpvoidpointertype.size) then
+            a_load_reg_ref(list,parentfpvoidpointertype,parentfpvoidpointertype,l.registerhi,tmpref)
+          else
+            internalerror(2014052202);
 
 
           location_reset_ref(l,LOC_REFERENCE,l.size,0);
           location_reset_ref(l,LOC_REFERENCE,l.size,0);
           l.reference:=r;
           l.reference:=r;

+ 0 - 15
compiler/i8086/i8086att.inc

@@ -161,10 +161,8 @@
 'iret',
 'iret',
 'iret',
 'iret',
 'iretw',
 'iretw',
-'iretq',
 'jcxz',
 'jcxz',
 'jecxz',
 'jecxz',
-'jrcxz',
 'jmp',
 'jmp',
 'lahf',
 'lahf',
 'lar',
 'lar',
@@ -200,7 +198,6 @@
 'movq',
 'movq',
 'movsb',
 'movsb',
 'movsl',
 'movsl',
-'movsq',
 'movsw',
 'movsw',
 'movs',
 'movs',
 'movz',
 'movz',
@@ -272,7 +269,6 @@
 'popf',
 'popf',
 'popfl',
 'popfl',
 'popfw',
 'popfw',
-'popfq',
 'por',
 'por',
 'prefetch',
 'prefetch',
 'prefetchw',
 'prefetchw',
@@ -306,7 +302,6 @@
 'pushf',
 'pushf',
 'pushfl',
 'pushfl',
 'pushfw',
 'pushfw',
-'pushfq',
 'pxor',
 'pxor',
 'rcl',
 'rcl',
 'rcr',
 'rcr',
@@ -334,7 +329,6 @@
 'sbb',
 'sbb',
 'scasb',
 'scasb',
 'scasl',
 'scasl',
-'scasq',
 'scasw',
 'scasw',
 'cs',
 'cs',
 'ds',
 'ds',
@@ -596,10 +590,6 @@
 'xsha256',
 'xsha256',
 'dmint',
 'dmint',
 'rdm',
 'rdm',
-'movabs',
-'movslq',
-'cqto',
-'cmpxchg16b',
 'movntss',
 'movntss',
 'movntsd',
 'movntsd',
 'insertq',
 'insertq',
@@ -637,11 +627,9 @@
 'pcmpeqq',
 'pcmpeqq',
 'pextrb',
 'pextrb',
 'pextrd',
 'pextrd',
-'pextrq',
 'phminposuw',
 'phminposuw',
 'pinsrb',
 'pinsrb',
 'pinsrd',
 'pinsrd',
-'pinsrq',
 'pmaxsb',
 'pmaxsb',
 'pmaxsd',
 'pmaxsd',
 'pmaxud',
 'pmaxud',
@@ -682,9 +670,6 @@
 'aesdeclast',
 'aesdeclast',
 'aesimc',
 'aesimc',
 'aeskeygenassist',
 'aeskeygenassist',
-'stosq',
-'lodsq',
-'cmpsq',
 'vaddpd',
 'vaddpd',
 'vaddps',
 'vaddps',
 'vaddsd',
 'vaddsd',

+ 0 - 15
compiler/i8086/i8086atts.inc

@@ -163,8 +163,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
 attsufINT,
 attsufINT,
@@ -201,7 +199,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINTdual,
 attsufINTdual,
 attsufINTdual,
 attsufINTdual,
 attsufINT,
 attsufINT,
@@ -273,7 +270,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
@@ -307,7 +303,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
@@ -342,7 +337,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
@@ -599,10 +593,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufNONE,
-attsufNONE,
-attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
@@ -667,8 +657,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -713,9 +701,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
-attsufNONE,
-attsufNONE,
 attsufMM,
 attsufMM,
 attsufMM,
 attsufMM,
 attsufNONE,
 attsufNONE,

+ 0 - 15
compiler/i8086/i8086int.inc

@@ -161,10 +161,8 @@
 'iret',
 'iret',
 'iretd',
 'iretd',
 'iretw',
 'iretw',
-'iretq',
 'jcxz',
 'jcxz',
 'jecxz',
 'jecxz',
-'jrcxz',
 'jmp',
 'jmp',
 'lahf',
 'lahf',
 'lar',
 'lar',
@@ -200,7 +198,6 @@
 'movq',
 'movq',
 'movsb',
 'movsb',
 'movsd',
 'movsd',
-'movsq',
 'movsw',
 'movsw',
 'movsx',
 'movsx',
 'movzx',
 'movzx',
@@ -272,7 +269,6 @@
 'popf',
 'popf',
 'popfd',
 'popfd',
 'popfw',
 'popfw',
-'popfq',
 'por',
 'por',
 'prefetch',
 'prefetch',
 'prefetchw',
 'prefetchw',
@@ -306,7 +302,6 @@
 'pushf',
 'pushf',
 'pushfd',
 'pushfd',
 'pushfw',
 'pushfw',
-'pushfq',
 'pxor',
 'pxor',
 'rcl',
 'rcl',
 'rcr',
 'rcr',
@@ -334,7 +329,6 @@
 'sbb',
 'sbb',
 'scasb',
 'scasb',
 'scasd',
 'scasd',
-'scasq',
 'scasw',
 'scasw',
 'segcs',
 'segcs',
 'segds',
 'segds',
@@ -596,10 +590,6 @@
 'xsha256',
 'xsha256',
 'dmint',
 'dmint',
 'rdm',
 'rdm',
-'movabs',
-'movsxd',
-'cqo',
-'cmpxchg16b',
 'movntss',
 'movntss',
 'movntsd',
 'movntsd',
 'insertq',
 'insertq',
@@ -637,11 +627,9 @@
 'pcmpeqq',
 'pcmpeqq',
 'pextrb',
 'pextrb',
 'pextrd',
 'pextrd',
-'pextrq',
 'phminposuw',
 'phminposuw',
 'pinsrb',
 'pinsrb',
 'pinsrd',
 'pinsrd',
-'pinsrq',
 'pmaxsb',
 'pmaxsb',
 'pmaxsd',
 'pmaxsd',
 'pmaxud',
 'pmaxud',
@@ -682,9 +670,6 @@
 'aesdeclast',
 'aesdeclast',
 'aesimc',
 'aesimc',
 'aeskeygenassist',
 'aeskeygenassist',
-'stosq',
-'lodsq',
-'cmpsq',
 'vaddpd',
 'vaddpd',
 'vaddps',
 'vaddps',
 'vaddsd',
 'vaddsd',

+ 0 - 15
compiler/i8086/i8086op.inc

@@ -161,10 +161,8 @@ A_INVLPG,
 A_IRET,
 A_IRET,
 A_IRETD,
 A_IRETD,
 A_IRETW,
 A_IRETW,
-A_IRETQ,
 A_JCXZ,
 A_JCXZ,
 A_JECXZ,
 A_JECXZ,
-A_JRCXZ,
 A_JMP,
 A_JMP,
 A_LAHF,
 A_LAHF,
 A_LAR,
 A_LAR,
@@ -200,7 +198,6 @@ A_MOVD,
 A_MOVQ,
 A_MOVQ,
 A_MOVSB,
 A_MOVSB,
 A_MOVSD,
 A_MOVSD,
-A_MOVSQ,
 A_MOVSW,
 A_MOVSW,
 A_MOVSX,
 A_MOVSX,
 A_MOVZX,
 A_MOVZX,
@@ -272,7 +269,6 @@ A_POPAW,
 A_POPF,
 A_POPF,
 A_POPFD,
 A_POPFD,
 A_POPFW,
 A_POPFW,
-A_POPFQ,
 A_POR,
 A_POR,
 A_PREFETCH,
 A_PREFETCH,
 A_PREFETCHW,
 A_PREFETCHW,
@@ -306,7 +302,6 @@ A_PUSHAW,
 A_PUSHF,
 A_PUSHF,
 A_PUSHFD,
 A_PUSHFD,
 A_PUSHFW,
 A_PUSHFW,
-A_PUSHFQ,
 A_PXOR,
 A_PXOR,
 A_RCL,
 A_RCL,
 A_RCR,
 A_RCR,
@@ -334,7 +329,6 @@ A_SAR,
 A_SBB,
 A_SBB,
 A_SCASB,
 A_SCASB,
 A_SCASD,
 A_SCASD,
-A_SCASQ,
 A_SCASW,
 A_SCASW,
 A_SEGCS,
 A_SEGCS,
 A_SEGDS,
 A_SEGDS,
@@ -596,10 +590,6 @@ A_XSHA1,
 A_XSHA256,
 A_XSHA256,
 A_DMINT,
 A_DMINT,
 A_RDM,
 A_RDM,
-A_MOVABS,
-A_MOVSXD,
-A_CQO,
-A_CMPXCHG16B,
 A_MOVNTSS,
 A_MOVNTSS,
 A_MOVNTSD,
 A_MOVNTSD,
 A_INSERTQ,
 A_INSERTQ,
@@ -637,11 +627,9 @@ A_PBLENDW,
 A_PCMPEQQ,
 A_PCMPEQQ,
 A_PEXTRB,
 A_PEXTRB,
 A_PEXTRD,
 A_PEXTRD,
-A_PEXTRQ,
 A_PHMINPOSUW,
 A_PHMINPOSUW,
 A_PINSRB,
 A_PINSRB,
 A_PINSRD,
 A_PINSRD,
-A_PINSRQ,
 A_PMAXSB,
 A_PMAXSB,
 A_PMAXSD,
 A_PMAXSD,
 A_PMAXUD,
 A_PMAXUD,
@@ -682,9 +670,6 @@ A_AESDEC,
 A_AESDECLAST,
 A_AESDECLAST,
 A_AESIMC,
 A_AESIMC,
 A_AESKEYGENASSIST,
 A_AESKEYGENASSIST,
-A_STOSQ,
-A_LODSQ,
-A_CMPSQ,
 A_VADDPD,
 A_VADDPD,
 A_VADDPS,
 A_VADDPS,
 A_VADDSD,
 A_VADDSD,

+ 0 - 15
compiler/i8086/i8086prop.inc

@@ -161,8 +161,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_RECX, Ch_None, Ch_None)),
 (Ch: (Ch_ROp1, Ch_None, Ch_None)),
 (Ch: (Ch_ROp1, Ch_None, Ch_None)),
@@ -201,7 +199,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_RWEAX, Ch_WEDX, Ch_WFlags)),
 (Ch: (Ch_RWEAX, Ch_WEDX, Ch_WFlags)),
@@ -272,7 +269,6 @@
 (Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFLAGS, Ch_None)),
 (Ch: (Ch_RWESP, Ch_WFLAGS, Ch_None)),
-(Ch: (Ch_RWESP, Ch_WFlags, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
@@ -306,7 +302,6 @@
 (Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFLAGS, Ch_None)),
 (Ch: (Ch_RWESP, Ch_RFLAGS, Ch_None)),
-(Ch: (Ch_RWESP, Ch_RFlags, Ch_None)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_None)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_RWFlags)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_RWFlags)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_RWFlags)),
 (Ch: (Ch_Mop2, Ch_Rop1, Ch_RWFlags)),
@@ -335,7 +330,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
@@ -596,12 +590,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
-(Ch: (Ch_Wop2, Ch_Rop1, Ch_None)),
-(Ch: (Ch_MRAX, Ch_WRDX, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
@@ -682,9 +670,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
-(Ch: (Ch_RRAX, Ch_WMemEDI, Ch_RWRDI)),
-(Ch: (Ch_WRAX, Ch_RWRSI, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),
 (Ch: (Ch_Wop3, Ch_Rop2, Ch_Rop1)),

+ 94 - 2
compiler/i8086/n8086add.pas

@@ -35,6 +35,10 @@ interface
        ti8086addnode = class(tx86addnode)
        ti8086addnode = class(tx86addnode)
          function simplify(forinline: boolean) : tnode;override;
          function simplify(forinline: boolean) : tnode;override;
          function use_generic_mul32to64: boolean; override;
          function use_generic_mul32to64: boolean; override;
+         function first_addpointer: tnode; override;
+         function first_addhugepointer: tnode;
+         function first_cmppointer: tnode; override;
+         function first_cmphugepointer: tnode;
          procedure second_addordinal; override;
          procedure second_addordinal; override;
          procedure second_add64bit;override;
          procedure second_add64bit;override;
          procedure second_addfarpointer;
          procedure second_addfarpointer;
@@ -48,11 +52,11 @@ interface
 
 
     uses
     uses
       globtype,systems,
       globtype,systems,
-      cutils,verbose,globals,constexp,
+      cutils,verbose,globals,constexp,pass_1,
       symconst,symdef,symtype,paramgr,defutil,
       symconst,symdef,symtype,paramgr,defutil,
       aasmbase,aasmtai,aasmdata,aasmcpu,
       aasmbase,aasmtai,aasmdata,aasmcpu,
       cgbase,procinfo,
       cgbase,procinfo,
-      ncon,nset,cgutils,tgobj,
+      ncal,ncon,nset,cgutils,tgobj,
       cga,ncgutil,cgobj,cg64f32,cgx86,
       cga,ncgutil,cgobj,cg64f32,cgx86,
       hlcgobj;
       hlcgobj;
 
 
@@ -308,6 +312,94 @@ interface
       end;
       end;
 
 
 
 
+    function ti8086addnode.first_addpointer: tnode;
+      begin
+        if is_hugepointer(left.resultdef) xor is_hugepointer(right.resultdef) then
+          result:=first_addhugepointer
+        else
+          result:=inherited;
+      end;
+
+
+    function ti8086addnode.first_addhugepointer: tnode;
+      var
+        procname:string;
+      begin
+        result:=nil;
+
+        case nodetype of
+          addn:
+            procname:='fpc_hugeptr_add_longint';
+          subn:
+            procname:='fpc_hugeptr_sub_longint';
+          else
+            internalerror(2014070301);
+        end;
+
+        if cs_hugeptr_arithmetic_normalization in current_settings.localswitches then
+          procname:=procname+'_normalized';
+
+        if is_hugepointer(left.resultdef) then
+          result := ccallnode.createintern(procname,
+            ccallparanode.create(right,
+            ccallparanode.create(left,nil)))
+        else
+          result := ccallnode.createintern(procname,
+            ccallparanode.create(left,
+            ccallparanode.create(right,nil)));
+        left := nil;
+        right := nil;
+        firstpass(result);
+      end;
+
+
+    function ti8086addnode.first_cmppointer: tnode;
+      begin
+        if is_hugepointer(left.resultdef) or is_hugepointer(right.resultdef) then
+          result:=first_cmphugepointer
+        else
+          result:=inherited;
+      end;
+
+
+    function ti8086addnode.first_cmphugepointer: tnode;
+      var
+        procname:string;
+      begin
+        result:=nil;
+
+        if not (cs_hugeptr_comparison_normalization in current_settings.localswitches) then
+          begin
+            expectloc:=LOC_FLAGS;
+            exit;
+          end;
+
+        case nodetype of
+          equaln:
+            procname:='fpc_hugeptr_cmp_normalized_e';
+          unequaln:
+            procname:='fpc_hugeptr_cmp_normalized_ne';
+          ltn:
+            procname:='fpc_hugeptr_cmp_normalized_b';
+          lten:
+            procname:='fpc_hugeptr_cmp_normalized_be';
+          gtn:
+            procname:='fpc_hugeptr_cmp_normalized_a';
+          gten:
+            procname:='fpc_hugeptr_cmp_normalized_ae';
+          else
+            internalerror(2014070401);
+        end;
+
+        result := ccallnode.createintern(procname,
+          ccallparanode.create(right,
+          ccallparanode.create(left,nil)));
+        left := nil;
+        right := nil;
+        firstpass(result);
+      end;
+
+
     procedure ti8086addnode.second_addfarpointer;
     procedure ti8086addnode.second_addfarpointer;
       var
       var
         tmpreg : tregister;
         tmpreg : tregister;

+ 73 - 0
compiler/i8086/n8086inl.pas

@@ -37,6 +37,7 @@ interface
          function first_seg: tnode; override;
          function first_seg: tnode; override;
          procedure second_seg; override;
          procedure second_seg; override;
          procedure second_get_frame;override;
          procedure second_get_frame;override;
+         procedure second_incdec;override;
        end;
        end;
 
 
 implementation
 implementation
@@ -46,6 +47,7 @@ implementation
     systems,
     systems,
     globtype,globals,
     globtype,globals,
     cutils,verbose,
     cutils,verbose,
+    constexp,
     symconst,
     symconst,
     defutil,
     defutil,
     aasmbase,aasmtai,aasmdata,aasmcpu,
     aasmbase,aasmtai,aasmdata,aasmcpu,
@@ -136,6 +138,77 @@ implementation
            inherited second_get_frame;
            inherited second_get_frame;
        end;
        end;
 
 
+     procedure ti8086inlinenode.second_incdec;
+       const
+         addsubop:array[in_inc_x..in_dec_x] of TOpCG=(OP_ADD,OP_SUB);
+       var
+         addvalue : TConstExprInt;
+         addconstant : boolean;
+         hregister : tregister;
+         tmploc: tlocation;
+       begin
+         if is_farpointer(tcallparanode(left).left.resultdef) then
+           begin
+             { set defaults }
+             addconstant:=true;
+             hregister:=NR_NO;
+
+             { first secondpass second argument, because if the first arg }
+             { is used in that expression then SSL may move it to another }
+             { register                                                   }
+             if assigned(tcallparanode(left).right) then
+               secondpass(tcallparanode(tcallparanode(left).right).left);
+             { load first parameter, must be a reference }
+             secondpass(tcallparanode(left).left);
+             tmploc:=tcallparanode(left).left.location;
+             tmploc.size:=OS_S16;
+             { get addvalue }
+             case tcallparanode(left).left.resultdef.typ of
+               pointerdef :
+                 begin
+                   if is_void(tpointerdef(tcallparanode(left).left.resultdef).pointeddef) then
+                     addvalue:=1
+                   else
+                     addvalue:=tpointerdef(tcallparanode(left).left.resultdef).pointeddef.size;
+                 end;
+               else
+                 internalerror(10081);
+             end;
+             { second_ argument specified?, must be a s16bit in register }
+             if assigned(tcallparanode(left).right) then
+               begin
+                 { when constant, just multiply the addvalue }
+                 if is_constintnode(tcallparanode(tcallparanode(left).right).left) then
+                    addvalue:=addvalue*get_ordinal_value(tcallparanode(tcallparanode(left).right).left)
+                 else if is_constpointernode(tcallparanode(tcallparanode(left).right).left) then
+                    addvalue:=addvalue*tpointerconstnode(tcallparanode(tcallparanode(left).right).left).value
+                 else
+                   begin
+                     hlcg.location_force_reg(current_asmdata.CurrAsmList,tcallparanode(tcallparanode(left).right).left.location,tcallparanode(tcallparanode(left).right).left.resultdef,s16inttype,addvalue<=1);
+                     hregister:=tcallparanode(tcallparanode(left).right).left.location.register;
+                     { insert multiply with addvalue if its >1 }
+                     if addvalue>1 then
+                       hlcg.a_op_const_reg(current_asmdata.CurrAsmList,OP_IMUL,s16inttype,addvalue.svalue,hregister);
+                     addconstant:=false;
+                   end;
+               end;
+             { write the add instruction }
+             if addconstant then
+               begin
+                 hlcg.a_op_const_loc(current_asmdata.CurrAsmList,addsubop[inlinenumber],s16inttype,
+                   smallint(addvalue.svalue),
+                   tmploc);
+               end
+             else
+               begin
+                 hlcg.a_op_reg_loc(current_asmdata.CurrAsmList,addsubop[inlinenumber],s16inttype,
+                   hregister,tmploc);
+               end;
+           end
+         else
+           inherited second_incdec;
+       end;
+
 begin
 begin
    cinlinenode:=ti8086inlinenode;
    cinlinenode:=ti8086inlinenode;
 end.
 end.

+ 127 - 0
compiler/i8086/n8086util.pas

@@ -0,0 +1,127 @@
+{
+    Copyright (c) 2014 by Nikolay Nikolov
+
+    i8086 version of some node tree helper routines
+
+    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
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+unit n8086util;
+
+{$i fpcdefs.inc}
+
+interface
+
+  uses
+    ngenutil;
+
+
+  type
+    ti8086nodeutils = class(tnodeutils)
+      class procedure InsertMemorySizes; override;
+      class procedure InsertStackSegment;
+      class procedure InsertHeapSegment;
+      class procedure InsertStackPlusHeapSize;
+    end;
+
+
+implementation
+
+  uses
+    sysutils,cutils,
+    globtype,globals,cpuinfo,
+    aasmbase,aasmdata,aasmtai;
+
+
+  class procedure ti8086nodeutils.InsertMemorySizes;
+    begin
+      inherited;
+      if current_settings.x86memorymodel<>mm_tiny then
+        InsertStackSegment;
+      InsertHeapSegment;
+      if current_settings.x86memorymodel in x86_near_data_models then
+        InsertStackPlusHeapSize;
+    end;
+
+
+  class procedure ti8086nodeutils.InsertStackSegment;
+    var
+      stacksizeleft,stackblock: LongInt;
+      i: Integer;
+    begin
+      maybe_new_object_file(current_asmdata.asmlists[al_globals]);
+      new_section(current_asmdata.asmlists[al_globals],sec_stack,'__stack', 16);
+      current_asmdata.asmlists[al_globals].concat(tai_symbol.Createname_global('___stack', AT_DATA, stacksize));
+      { HACK: since tai_datablock's size parameter is aint, which cannot be
+        larger than 32767 on i8086, but we'd like to support stack size of
+        up to 64kb, we may need to use several tai_datablocks to reserve
+        the stack segment }
+      i:=0;
+      stacksizeleft:=stacksize;
+      while stacksizeleft>0 do
+        begin
+          stackblock:=min(stacksizeleft,high(aint));
+          current_asmdata.asmlists[al_globals].concat(tai_datablock.Create('___stackblock'+IntToStr(i),stackblock));
+          dec(stacksizeleft,stackblock);
+          inc(i);
+        end;
+      current_asmdata.asmlists[al_globals].concat(tai_symbol.Createname_global('___stacktop',AT_DATA,0));
+    end;
+
+
+  class procedure ti8086nodeutils.InsertHeapSegment;
+    var
+      heapsizeleft,heapblock: LongInt;
+      i: Integer;
+    begin
+      maybe_new_object_file(current_asmdata.asmlists[al_globals]);
+      new_section(current_asmdata.asmlists[al_globals],sec_heap,'__heap', 16);
+      current_asmdata.asmlists[al_globals].concat(tai_symbol.Createname_global('___heap', AT_DATA, heapsize));
+      { HACK: since tai_datablock's size parameter is aint, which cannot be
+        larger than 32767 on i8086, but we'd like to support heap size of
+        up to 640kb, we may need to use several tai_datablocks to reserve
+        the heap segment }
+      i:=0;
+      heapsizeleft:=heapsize;
+      while heapsizeleft>0 do
+        begin
+          heapblock:=min(heapsizeleft,high(aint));
+          current_asmdata.asmlists[al_globals].concat(tai_datablock.Create('___heapblock'+IntToStr(i),heapblock));
+          dec(heapsizeleft,heapblock);
+          inc(i);
+        end;
+      current_asmdata.asmlists[al_globals].concat(tai_symbol.Createname_global('___heaptop',AT_DATA,0));
+    end;
+
+
+  class procedure ti8086nodeutils.InsertStackPlusHeapSize;
+    var
+      maxheapsize_para: Word;
+      stacksize_para: Word;
+    begin
+      maxheapsize_para:=(maxheapsize+15) div 16;
+      stacksize_para:=(stacksize+15) div 16;
+
+      maybe_new_object_file(current_asmdata.asmlists[al_globals]);
+      new_section(current_asmdata.asmlists[al_globals],sec_data,'__fpc_stackplusmaxheap_in_para',sizeof(pint));
+      current_asmdata.asmlists[al_globals].concat(Tai_symbol.Createname_global('__fpc_stackplusmaxheap_in_para',AT_DATA,4));
+      current_asmdata.asmlists[al_globals].concat(Tai_const.Create_16bit(min($1000,stacksize_para+maxheapsize_para)));
+    end;
+
+
+begin
+  cnodeutils:=ti8086nodeutils;
+end.

+ 0 - 290
compiler/jvm/pjvm.pas

@@ -48,13 +48,6 @@ interface
 
 
     function jvm_wrap_method_with_vis(pd: tprocdef; vis: tvisibility): tprocdef;
     function jvm_wrap_method_with_vis(pd: tprocdef; vis: tvisibility): tprocdef;
 
 
-    { when a private/protected field is exposed via a property with a higher
-      visibility, then we have to create a getter and/or setter with that same
-      higher visibility to make sure that using the property does not result
-      in JVM verification errors }
-    procedure jvm_create_getter_for_property(p: tpropertysym; orgaccesspd: tprocdef);
-    procedure jvm_create_setter_for_property(p: tpropertysym; orgaccesspd: tprocdef);
-
 
 
 implementation
 implementation
 
 
@@ -853,287 +846,4 @@ implementation
       end;
       end;
 
 
 
 
-    procedure jvm_create_getter_or_setter_for_property(p: tpropertysym; orgaccesspd: tprocdef; getter: boolean);
-      var
-        obj: tabstractrecorddef;
-        ps: tprocsym;
-        pvs: tparavarsym;
-        sym: tsym;
-        pd, parentpd, accessorparapd: tprocdef;
-        tmpaccesslist: tpropaccesslist;
-        callthroughpropname,
-        name: string;
-        callthroughprop: tpropertysym;
-        accesstyp: tpropaccesslisttypes;
-        sktype: tsynthetickind;
-        procoptions: tprocoptions;
-        paranr: word;
-        explicitwrapper: boolean;
-      begin
-        obj:=current_structdef;
-        { if someone gets the idea to add a property to an external class
-          definition, don't try to wrap it since we cannot add methods to
-          external classes }
-        if oo_is_external in obj.objectoptions then
-          exit;
-        symtablestack.push(obj.symtable);
-
-        try
-          if getter then
-            accesstyp:=palt_read
-          else
-            accesstyp:=palt_write;
-
-          { we can't use str_parse_method_dec here because the type of the field
-            may not be visible at the Pascal level }
-
-          explicitwrapper:=
-            { private methods are not visibile outside the current class, so
-              no use in making life harder for us by introducing potential
-              (future or current) naming conflicts }
-            (p.visibility<>vis_private) and
-            (getter and
-             (prop_auto_getter_prefix<>'')) or
-            (not getter and
-             (prop_auto_setter_prefix<>''));
-          sym:=nil;
-          procoptions:=[];
-          if explicitwrapper then
-            begin
-              if getter then
-                name:=prop_auto_getter_prefix+p.realname
-              else
-                name:=prop_auto_setter_prefix+p.realname;
-              sym:=search_struct_member_no_helper(obj,upper(name));
-              if getter then
-                sktype:=tsk_field_getter
-              else
-                sktype:=tsk_field_setter;
-              if assigned(sym) then
-                begin
-                  if ((sym.typ<>procsym) or
-                      (tprocsym(sym).procdeflist.count<>1) or
-                      (tprocdef(tprocsym(sym).procdeflist[0]).synthetickind<>sktype)) and
-                     (not assigned(orgaccesspd) or
-                      (sym<>orgaccesspd.procsym)) then
-                    begin
-                      MessagePos2(p.fileinfo,parser_e_cannot_generate_property_getter_setter,name,FullTypeName(tdef(sym.owner.defowner),nil)+'.'+name);
-                      exit;
-                    end
-                  else
-                    begin
-                      if name<>sym.realname then
-                        MessagePos2(p.fileinfo,parser_w_case_difference_auto_property_getter_setter_prefix,sym.realname,name);
-                      { is the specified getter/setter defined in the current
-                        struct and was it originally specified as the getter/
-                        setter for this property? If so, simply adjust its
-                        visibility if necessary.
-                      }
-                      if assigned(orgaccesspd) then
-                        parentpd:=orgaccesspd
-                      else
-                        parentpd:=tprocdef(tprocsym(sym).procdeflist[0]);
-                      if parentpd.owner.defowner=p.owner.defowner then
-                        begin
-                          if parentpd.visibility<p.visibility then
-                            begin
-                              parentpd.visibility:=p.visibility;
-                              include(parentpd.procoptions,po_auto_raised_visibility);
-                            end;
-                          { we are done, no need to create a wrapper }
-                          exit
-                        end
-                      { a parent already included this getter/setter -> try to
-                        override it }
-                      else if parentpd.visibility<>vis_private then
-                        begin
-                          if po_virtualmethod in parentpd.procoptions then
-                            begin
-                              procoptions:=procoptions+[po_virtualmethod,po_overridingmethod];
-                              Message2(parser_w_overriding_property_getter_setter,name,FullTypeName(tdef(parentpd.owner.defowner),nil));
-                            end;
-                          { otherwise we can't do anything, and
-                            proc_add_definition will give an error }
-                        end;
-                      { add method with the correct visibility }
-                      pd:=tprocdef(parentpd.getcopy);
-                      { get rid of the import name for inherited virtual class methods,
-                        it has to be regenerated rather than amended }
-                      if [po_classmethod,po_virtualmethod]<=pd.procoptions then
-                        begin
-                          stringdispose(pd.import_name);
-                          exclude(pd.procoptions,po_has_importname);
-                        end;
-                      pd.visibility:=p.visibility;
-                      pd.procoptions:=pd.procoptions+procoptions;
-                      { ignore this artificially added procdef when looking for overloads }
-                      include(pd.procoptions,po_ignore_for_overload_resolution);
-                      finish_copied_procdef(pd,parentpd.procsym.realname,obj.symtable,obj);
-                      exclude(pd.procoptions,po_external);
-                      pd.synthetickind:=tsk_anon_inherited;
-                      exit;
-                    end;
-                end;
-              { make the artificial getter/setter virtual so we can override it in
-                children if necessary }
-              if not(sp_static in p.symoptions) and
-                 (obj.typ=objectdef) then
-                include(procoptions,po_virtualmethod);
-              { prevent problems in Delphi mode }
-              include(procoptions,po_overload);
-            end
-          else
-            begin
-              { construct procsym name (unique for this access; reusing the same
-                helper for multiple accesses to the same field is hard because the
-                propacesslist can contain subscript nodes etc) }
-              name:=visibilityName[p.visibility];
-              replace(name,' ','_');
-              if getter then
-                name:=name+'$getter'
-              else
-                name:=name+'$setter';
-            end;
-
-          { create procdef }
-          if not assigned(orgaccesspd) then
-            begin
-              pd:=cprocdef.create(normal_function_level);
-              if df_generic in obj.defoptions then
-                include(pd.defoptions,df_generic);
-              { method of this objectdef }
-              pd.struct:=obj;
-              { can only construct the artificial name now, because it requires
-                pd.defid }
-              if not explicitwrapper then
-                name:='$'+obj.symtable.realname^+'$'+p.realname+'$'+name+'$'+tostr(pd.defid);
-            end
-          else
-            begin
-              { getter/setter could have parameters in case of indexed access
-                -> copy original procdef }
-              pd:=tprocdef(orgaccesspd.getcopy);
-              exclude(pd.procoptions,po_abstractmethod);
-              { can only construct the artificial name now, because it requires
-                pd.defid }
-              if not explicitwrapper then
-                name:='$'+obj.symtable.realname^+'$'+p.realname+'$'+name+'$'+tostr(pd.defid);
-              finish_copied_procdef(pd,name,obj.symtable,obj);
-              sym:=pd.procsym;
-            end;
-          { add previously collected procoptions }
-          pd.procoptions:=pd.procoptions+procoptions;
-          { visibility }
-          pd.visibility:=p.visibility;
-
-          { new procsym? }
-          if not assigned(sym) or
-             (sym.owner<>p.owner)  then
-            begin
-              ps:=cprocsym.create(name);
-              obj.symtable.insert(ps);
-            end
-          else
-            ps:=tprocsym(sym);
-          { associate procsym with procdef}
-          pd.procsym:=ps;
-
-
-
-          { function/procedure }
-          accessorparapd:=nil;
-          if getter then
-            begin
-              pd.proctypeoption:=potype_function;
-              pd.synthetickind:=tsk_field_getter;
-              { result type }
-              pd.returndef:=p.propdef;
-              if (ppo_hasparameters in p.propoptions) and
-                 not assigned(orgaccesspd) then
-                accessorparapd:=pd;
-            end
-          else
-            begin
-              pd.proctypeoption:=potype_procedure;
-              pd.synthetickind:=tsk_field_setter;
-              pd.returndef:=voidtype;
-              if not assigned(orgaccesspd) then
-                begin
-                  { parameter with value to set }
-                  pvs:=cparavarsym.create('__fpc_newval__',10,vs_const,p.propdef,[]);
-                  pd.parast.insert(pvs);
-                end;
-              if (ppo_hasparameters in p.propoptions) and
-                 not assigned(orgaccesspd) then
-                accessorparapd:=pd;
-            end;
-
-          { create a property for the old symaccesslist with a new name, so that
-            we can reuse it in the implementation (rather than having to
-            translate the symaccesslist back to Pascal code) }
-          callthroughpropname:='__fpc__'+p.realname;
-          if getter then
-            callthroughpropname:=callthroughpropname+'__getter_wrapper'
-          else
-            callthroughpropname:=callthroughpropname+'__setter_wrapper';
-          callthroughprop:=cpropertysym.create(callthroughpropname);
-          callthroughprop.visibility:=p.visibility;
-
-          if getter then
-            p.makeduplicate(callthroughprop,accessorparapd,nil,paranr)
-          else
-            p.makeduplicate(callthroughprop,nil,accessorparapd,paranr);
-
-          callthroughprop.default:=longint($80000000);
-          callthroughprop.default:=0;
-          callthroughprop.propoptions:=callthroughprop.propoptions-[ppo_stored,ppo_enumerator_current,ppo_overrides,ppo_defaultproperty];
-          if sp_static in p.symoptions then
-            include(callthroughprop.symoptions, sp_static);
-          { copy original property target to callthrough property (and replace
-            original one with the new empty list; will be filled in later) }
-          tmpaccesslist:=callthroughprop.propaccesslist[accesstyp];
-          callthroughprop.propaccesslist[accesstyp]:=p.propaccesslist[accesstyp];
-          p.propaccesslist[accesstyp]:=tmpaccesslist;
-          p.owner.insert(callthroughprop);
-
-          pd.skpara:=callthroughprop;
-          { needs to be exported }
-          include(pd.procoptions,po_global);
-          { class property -> static class method }
-          if sp_static in p.symoptions then
-            pd.procoptions:=pd.procoptions+[po_classmethod,po_staticmethod];
-
-          { in case we made a copy of the original accessor, this has all been
-            done already }
-          if not assigned(orgaccesspd) then
-            begin
-              { calling convention, self, ... }
-              if obj.typ=recorddef then
-                handle_calling_convention(pd,[hcc_check])
-              else
-                handle_calling_convention(pd,hcc_all);
-              { register forward declaration with procsym }
-              proc_add_definition(pd);
-            end;
-
-          { make the property call this new function }
-          p.propaccesslist[accesstyp].addsym(sl_call,ps);
-          p.propaccesslist[accesstyp].procdef:=pd;
-        finally
-          symtablestack.pop(obj.symtable);
-        end;
-      end;
-
-
-    procedure jvm_create_getter_for_property(p: tpropertysym; orgaccesspd: tprocdef);
-      begin
-        jvm_create_getter_or_setter_for_property(p,orgaccesspd,true);
-      end;
-
-
-    procedure jvm_create_setter_for_property(p: tpropertysym; orgaccesspd: tprocdef);
-      begin
-        jvm_create_getter_or_setter_for_property(p,orgaccesspd,false);
-      end;
-
 end.
 end.

+ 383 - 2
compiler/jvm/symcpu.pas

@@ -182,6 +182,16 @@ type
   tcpuabsolutevarsymclass = class of tcpuabsolutevarsym;
   tcpuabsolutevarsymclass = class of tcpuabsolutevarsym;
 
 
   tcpupropertysym = class(tpropertysym)
   tcpupropertysym = class(tpropertysym)
+   protected
+    { when a private/protected field is exposed via a property with a higher
+      visibility, then we have to create a getter and/or setter with that same
+      higher visibility to make sure that using the property does not result
+      in JVM verification errors }
+    procedure create_getter_or_setter_for_property(orgaccesspd: tprocdef; getter: boolean);
+    procedure finalize_getter_or_setter_for_sym(getset: tpropaccesslisttypes; sym: tsym; fielddef: tdef; accessordef: tprocdef); override;
+    procedure maybe_create_overridden_getter_or_setter(getset: tpropaccesslisttypes);
+   public
+    procedure inherit_accessor(getset: tpropaccesslisttypes); override;
   end;
   end;
   tcpupropertysymclass = class of tcpupropertysym;
   tcpupropertysymclass = class of tcpupropertysym;
 
 
@@ -205,11 +215,382 @@ const
 implementation
 implementation
 
 
   uses
   uses
-    verbose,cutils,cclasses,
-    symconst,symbase,jvmdef,
+    verbose,cutils,cclasses,globals,
+    symconst,symbase,symtable,symcreat,jvmdef,
+    pdecsub,pjvm,
     paramgr;
     paramgr;
 
 
 
 
+  {****************************************************************************
+                               tcpuproptertysym
+  ****************************************************************************}
+
+  procedure tcpupropertysym.create_getter_or_setter_for_property(orgaccesspd: tprocdef; getter: boolean);
+    var
+      obj: tabstractrecorddef;
+      ps: tprocsym;
+      pvs: tparavarsym;
+      sym: tsym;
+      pd, parentpd, accessorparapd: tprocdef;
+      tmpaccesslist: tpropaccesslist;
+      callthroughpropname,
+      accessorname: string;
+      callthroughprop: tpropertysym;
+      accesstyp: tpropaccesslisttypes;
+      sktype: tsynthetickind;
+      procoptions: tprocoptions;
+      paranr: word;
+      explicitwrapper: boolean;
+    begin
+      obj:=current_structdef;
+      { if someone gets the idea to add a property to an external class
+        definition, don't try to wrap it since we cannot add methods to
+        external classes }
+      if oo_is_external in obj.objectoptions then
+        exit;
+      symtablestack.push(obj.symtable);
+
+      try
+        if getter then
+          accesstyp:=palt_read
+        else
+          accesstyp:=palt_write;
+
+        { we can't use str_parse_method_dec here because the type of the field
+          may not be visible at the Pascal level }
+
+        explicitwrapper:=
+          { private methods are not visibile outside the current class, so
+            no use in making life harder for us by introducing potential
+            (future or current) naming conflicts }
+          (visibility<>vis_private) and
+          (getter and
+           (prop_auto_getter_prefix<>'')) or
+          (not getter and
+           (prop_auto_setter_prefix<>''));
+        sym:=nil;
+        procoptions:=[];
+        if explicitwrapper then
+          begin
+            if getter then
+              accessorname:=prop_auto_getter_prefix+realname
+            else
+              accessorname:=prop_auto_setter_prefix+realname;
+            sym:=search_struct_member_no_helper(obj,upper(accessorname));
+            if getter then
+              sktype:=tsk_field_getter
+            else
+              sktype:=tsk_field_setter;
+            if assigned(sym) then
+              begin
+                if ((sym.typ<>procsym) or
+                    (tprocsym(sym).procdeflist.count<>1) or
+                    (tprocdef(tprocsym(sym).procdeflist[0]).synthetickind<>sktype)) and
+                   (not assigned(orgaccesspd) or
+                    (sym<>orgaccesspd.procsym)) then
+                  begin
+                    MessagePos2(fileinfo,parser_e_cannot_generate_property_getter_setter,accessorname,FullTypeName(tdef(sym.owner.defowner),nil)+'.'+accessorname);
+                    exit;
+                  end
+                else
+                  begin
+                    if accessorname<>sym.realname then
+                      MessagePos2(fileinfo,parser_w_case_difference_auto_property_getter_setter_prefix,sym.realname,accessorname);
+                    { is the specified getter/setter defined in the current
+                      struct and was it originally specified as the getter/
+                      setter for this property? If so, simply adjust its
+                      visibility if necessary.
+                    }
+                    if assigned(orgaccesspd) then
+                      parentpd:=orgaccesspd
+                    else
+                      parentpd:=tprocdef(tprocsym(sym).procdeflist[0]);
+                    if parentpd.owner.defowner=owner.defowner then
+                      begin
+                        if parentpd.visibility<visibility then
+                          begin
+                            parentpd.visibility:=visibility;
+                            include(parentpd.procoptions,po_auto_raised_visibility);
+                          end;
+                        { we are done, no need to create a wrapper }
+                        exit
+                      end
+                    { a parent already included this getter/setter -> try to
+                      override it }
+                    else if parentpd.visibility<>vis_private then
+                      begin
+                        if po_virtualmethod in parentpd.procoptions then
+                          begin
+                            procoptions:=procoptions+[po_virtualmethod,po_overridingmethod];
+                            if not(parentpd.synthetickind in [tsk_field_getter,tsk_field_setter]) then
+                              Message2(parser_w_overriding_property_getter_setter,accessorname,FullTypeName(tdef(parentpd.owner.defowner),nil));
+                          end;
+                        { otherwise we can't do anything, and
+                          proc_add_definition will give an error }
+                      end;
+                    { add method with the correct visibility }
+                    pd:=tprocdef(parentpd.getcopy);
+                    { get rid of the import accessorname for inherited virtual class methods,
+                      it has to be regenerated rather than amended }
+                    if [po_classmethod,po_virtualmethod]<=pd.procoptions then
+                      begin
+                        stringdispose(pd.import_name);
+                        exclude(pd.procoptions,po_has_importname);
+                      end;
+                    pd.visibility:=visibility;
+                    pd.procoptions:=pd.procoptions+procoptions;
+                    { ignore this artificially added procdef when looking for overloads }
+                    include(pd.procoptions,po_ignore_for_overload_resolution);
+                    finish_copied_procdef(pd,parentpd.procsym.realname,obj.symtable,obj);
+                    exclude(pd.procoptions,po_external);
+                    pd.synthetickind:=tsk_anon_inherited;
+                    { set the accessor in the property }
+                    propaccesslist[accesstyp].clear;
+                    propaccesslist[accesstyp].addsym(sl_call,pd.procsym);
+                    propaccesslist[accesstyp].procdef:=pd;
+                    exit;
+                  end;
+              end;
+            { make the artificial getter/setter virtual so we can override it in
+              children if necessary }
+            if not(sp_static in symoptions) and
+               (obj.typ=objectdef) then
+              include(procoptions,po_virtualmethod);
+            { prevent problems in Delphi mode }
+            include(procoptions,po_overload);
+          end
+        else
+          begin
+            { construct procsym accessorname (unique for this access; reusing the same
+              helper for multiple accesses to the same field is hard because the
+              propacesslist can contain subscript nodes etc) }
+            accessorname:=visibilityName[visibility];
+            replace(accessorname,' ','_');
+            if getter then
+              accessorname:=accessorname+'$getter'
+            else
+              accessorname:=accessorname+'$setter';
+          end;
+
+        { create procdef }
+        if not assigned(orgaccesspd) then
+          begin
+            pd:=cprocdef.create(normal_function_level);
+            if df_generic in obj.defoptions then
+              include(pd.defoptions,df_generic);
+            { method of this objectdef }
+            pd.struct:=obj;
+            { can only construct the artificial accessorname now, because it requires
+              pd.defid }
+            if not explicitwrapper then
+              accessorname:='$'+obj.symtable.realname^+'$'+realname+'$'+accessorname+'$'+tostr(pd.defid);
+          end
+        else
+          begin
+            { getter/setter could have parameters in case of indexed access
+              -> copy original procdef }
+            pd:=tprocdef(orgaccesspd.getcopy);
+            exclude(pd.procoptions,po_abstractmethod);
+            exclude(pd.procoptions,po_overridingmethod);
+            { can only construct the artificial accessorname now, because it requires
+              pd.defid }
+            if not explicitwrapper then
+              accessorname:='$'+obj.symtable.realname^+'$'+realname+'$'+accessorname+'$'+tostr(pd.defid);
+            finish_copied_procdef(pd,accessorname,obj.symtable,obj);
+            sym:=pd.procsym;
+          end;
+        { add previously collected procoptions }
+        pd.procoptions:=pd.procoptions+procoptions;
+        { visibility }
+        pd.visibility:=visibility;
+
+        { new procsym? }
+        if not assigned(sym) or
+           (sym.owner<>owner)  then
+          begin
+            ps:=cprocsym.create(accessorname);
+            obj.symtable.insert(ps);
+          end
+        else
+          ps:=tprocsym(sym);
+        { associate procsym with procdef}
+        pd.procsym:=ps;
+
+        { function/procedure }
+        accessorparapd:=nil;
+        if getter then
+          begin
+            pd.proctypeoption:=potype_function;
+            pd.synthetickind:=tsk_field_getter;
+            { result type }
+            pd.returndef:=propdef;
+            if (ppo_hasparameters in propoptions) and
+               not assigned(orgaccesspd) then
+              accessorparapd:=pd;
+          end
+        else
+          begin
+            pd.proctypeoption:=potype_procedure;
+            pd.synthetickind:=tsk_field_setter;
+            pd.returndef:=voidtype;
+            if not assigned(orgaccesspd) then
+              begin
+                { parameter with value to set }
+                pvs:=cparavarsym.create('__fpc_newval__',10,vs_const,propdef,[]);
+                pd.parast.insert(pvs);
+              end;
+            if (ppo_hasparameters in propoptions) and
+               not assigned(orgaccesspd) then
+              accessorparapd:=pd;
+          end;
+
+        { create a property for the old symaccesslist with a new accessorname, so that
+          we can reuse it in the implementation (rather than having to
+          translate the symaccesslist back to Pascal code) }
+        callthroughpropname:='__fpc__'+realname;
+        if getter then
+          callthroughpropname:=callthroughpropname+'__getter_wrapper'
+        else
+          callthroughpropname:=callthroughpropname+'__setter_wrapper';
+        callthroughprop:=cpropertysym.create(callthroughpropname);
+        callthroughprop.visibility:=visibility;
+
+        if getter then
+          makeduplicate(callthroughprop,accessorparapd,nil,paranr)
+        else
+          makeduplicate(callthroughprop,nil,accessorparapd,paranr);
+
+        callthroughprop.default:=longint($80000000);
+        callthroughprop.default:=0;
+        callthroughprop.propoptions:=callthroughprop.propoptions-[ppo_stored,ppo_enumerator_current,ppo_overrides,ppo_defaultproperty];
+        if sp_static in symoptions then
+          include(callthroughprop.symoptions, sp_static);
+        { copy original property target to callthrough property (and replace
+          original one with the new empty list; will be filled in later) }
+        tmpaccesslist:=callthroughprop.propaccesslist[accesstyp];
+        callthroughprop.propaccesslist[accesstyp]:=propaccesslist[accesstyp];
+        propaccesslist[accesstyp]:=tmpaccesslist;
+        owner.insert(callthroughprop);
+
+        pd.skpara:=callthroughprop;
+        { needs to be exported }
+        include(pd.procoptions,po_global);
+        { class property -> static class method }
+        if sp_static in symoptions then
+          pd.procoptions:=pd.procoptions+[po_classmethod,po_staticmethod];
+
+        { in case we made a copy of the original accessor, this has all been
+          done already }
+        if not assigned(orgaccesspd) then
+          begin
+            { calling convention, self, ... }
+            if obj.typ=recorddef then
+              handle_calling_convention(pd,[hcc_check])
+            else
+              handle_calling_convention(pd,hcc_all);
+            { register forward declaration with procsym }
+            proc_add_definition(pd);
+          end;
+
+        { make the property call this new function }
+        propaccesslist[accesstyp].addsym(sl_call,ps);
+        propaccesslist[accesstyp].procdef:=pd;
+      finally
+        symtablestack.pop(obj.symtable);
+      end;
+    end;
+
+
+  procedure tcpupropertysym.finalize_getter_or_setter_for_sym(getset: tpropaccesslisttypes; sym: tsym; fielddef: tdef; accessordef: tprocdef);
+    var
+      orgaccesspd: tprocdef;
+      pprefix: pshortstring;
+      wrongvisibility: boolean;
+    begin
+      inherited;
+      if getset=palt_read then
+        pprefix:=@prop_auto_getter_prefix
+      else
+        pprefix:=@prop_auto_setter_prefix;
+      case sym.typ of
+        procsym:
+          begin
+            orgaccesspd:=tprocdef(propaccesslist[getset].procdef);
+            wrongvisibility:=tprocdef(propaccesslist[getset].procdef).visibility<visibility;
+            { if the visibility of the accessor is lower than
+              the visibility of the property, wrap it so that
+              we can call it from all contexts in which the
+              property is visible }
+            if wrongvisibility or
+               ((pprefix^<>'') and
+                (sym.RealName<>pprefix^+RealName)) then
+              create_getter_or_setter_for_property(orgaccesspd,getset=palt_read)
+          end;
+        fieldvarsym:
+          begin
+            { if the visibility of the field is lower than the
+              visibility of the property, wrap it in a getter
+              so that we can access it from all contexts in
+              which the property is visibile }
+            if (pprefix^<>'') or
+               (tfieldvarsym(sym).visibility<visibility) then
+              create_getter_or_setter_for_property(nil,getset=palt_read);
+          end;
+        else
+          internalerror(2014061101);
+      end;
+    end;
+
+
+  procedure tcpupropertysym.maybe_create_overridden_getter_or_setter(getset: tpropaccesslisttypes);
+    var
+      sym: tsym;
+      accessordef: tprocdef;
+      psym: tpropertysym;
+    begin
+      { find the last defined getter/setter/field accessed by an inherited
+        property }
+      psym:=overriddenpropsym;
+      while not assigned(psym.propaccesslist[getset].firstsym) do
+        begin
+          psym:=psym.overriddenpropsym;
+          { if there is simply no getter/setter for this property, we're done }
+          if not assigned(psym) then
+            exit;
+        end;
+      sym:=psym.propaccesslist[getset].firstsym^.sym;
+      case sym.typ of
+        procsym:
+          begin
+            accessordef:=tprocdef(psym.propaccesslist[getset].procdef);
+            if accessordef.visibility>=visibility then
+              exit;
+          end;
+        fieldvarsym:
+          begin
+            if sym.visibility>=visibility then
+              exit;
+            accessordef:=nil;
+          end;
+        else
+          internalerror(2014061102);
+      end;
+      propaccesslist[getset]:=psym.propaccesslist[getset].getcopy;
+      finalize_getter_or_setter_for_sym(getset,sym,propdef,accessordef);
+    end;
+
+
+  procedure tcpupropertysym.inherit_accessor(getset: tpropaccesslisttypes);
+    begin
+      inherited;
+      { new property has higher visibility than previous one -> maybe override
+        the getters/setters }
+      if assigned(overriddenpropsym) and
+         (overriddenpropsym.visibility<visibility) then
+        maybe_create_overridden_getter_or_setter(getset);
+    end;
+
+
 {****************************************************************************
 {****************************************************************************
                              tcpuenumdef
                              tcpuenumdef
 ****************************************************************************}
 ****************************************************************************}

+ 1 - 0
compiler/m68k/aasmcpu.pas

@@ -469,6 +469,7 @@ type
               result:=operand_write;
               result:=operand_write;
           A_ADD, A_ADDQ, A_ADDX, A_SUB, A_SUBQ, A_SUBX,
           A_ADD, A_ADDQ, A_ADDX, A_SUB, A_SUBQ, A_SUBX,
           A_AND, A_LSR, A_LSL, A_ASR, A_ASL, A_EOR, A_EORI, A_OR,
           A_AND, A_LSR, A_LSL, A_ASR, A_ASL, A_EOR, A_EORI, A_OR,
+          A_ROL, A_ROR, A_ROXL, A_ROXR,
           A_MULS, A_MULU, A_DIVS, A_DIVU, A_DIVSL, A_DIVUL:
           A_MULS, A_MULU, A_DIVS, A_DIVU, A_DIVSL, A_DIVUL:
             if opnr=1 then
             if opnr=1 then
               result:=operand_readwrite;
               result:=operand_readwrite;

+ 36 - 3
compiler/m68k/aoptcpu.pas

@@ -1,8 +1,8 @@
 {
 {
-    Copyright (c) 1998-2004 by Jonas Maebe
+    Copyright (c) 1998-2014 by the Free Pascal development team
 
 
     This unit calls the optimization procedures to optimize the assembler
     This unit calls the optimization procedures to optimize the assembler
-    code for sparc
+    code for m68k
 
 
     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
@@ -28,14 +28,47 @@ unit aoptcpu;
   Interface
   Interface
 
 
     uses
     uses
-      cpubase, aoptobj, aoptcpub, aopt;
+      cpubase, aoptobj, aoptcpub, aopt, aasmtai;
 
 
     Type
     Type
       TCpuAsmOptimizer = class(TAsmOptimizer)
       TCpuAsmOptimizer = class(TAsmOptimizer)
+        function PeepHoleOptPass1Cpu(var p: tai): boolean; override;
       End;
       End;
 
 
   Implementation
   Implementation
 
 
+    uses
+      cutils, aasmcpu;
+
+  function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
+    var
+      next: tai;
+    begin
+      result:=false;
+      case p.typ of
+        ait_instruction:
+          begin
+            //asml.insertbefore(tai_comment.Create(strpnew('pass1 called for instr')), p);
+
+            { LEA (Ax),Ax is a NOP if src and dest reg is equal, so remove it. }
+            if getnextinstruction(p,next) and (taicpu(p).opcode = A_LEA) and
+               (not assigned(taicpu(p).oper[0]^.ref^.symbol)) and
+               (((taicpu(p).oper[0]^.ref^.base = taicpu(p).oper[1]^.reg) and
+               (taicpu(p).oper[0]^.ref^.index = NR_NO)) or
+               ((taicpu(p).oper[0]^.ref^.index = taicpu(p).oper[1]^.reg) and
+               (taicpu(p).oper[0]^.ref^.base = NR_NO))) and
+               (taicpu(p).oper[0]^.ref^.offset = 0) then
+              begin
+                //asml.insertbefore(tai_comment.Create(strpnew('LEA (Ax),Ax removed')), p);
+                asml.remove(p);
+                p.free;
+                p:=next;
+                result:=true;
+              end;
+          end;
+      end;
+    end;
+
 begin
 begin
   casmoptimizer:=TCpuAsmOptimizer;
   casmoptimizer:=TCpuAsmOptimizer;
 end.
 end.

+ 190 - 298
compiler/m68k/cgcpu.pas

@@ -42,7 +42,7 @@ unit cgcpu;
         procedure a_load_reg_cgpara(list : TAsmList;size : tcgsize;r : tregister;const cgpara : tcgpara);override;
         procedure a_load_reg_cgpara(list : TAsmList;size : tcgsize;r : tregister;const cgpara : tcgpara);override;
         procedure a_load_const_cgpara(list : TAsmList;size : tcgsize;a : tcgint;const cgpara : tcgpara);override;
         procedure a_load_const_cgpara(list : TAsmList;size : tcgsize;a : tcgint;const cgpara : tcgpara);override;
         procedure a_load_ref_cgpara(list : TAsmList;size : tcgsize;const r : treference;const cgpara : tcgpara);override;
         procedure a_load_ref_cgpara(list : TAsmList;size : tcgsize;const r : treference;const cgpara : tcgpara);override;
-        //procedure a_loadaddr_ref_cgpara(list : TAsmList;const r : treference;const cgpara : tcgpara);override;
+        procedure a_loadaddr_ref_cgpara(list : TAsmList;const r : treference;const cgpara : tcgpara);override;
 
 
         procedure a_call_name(list : TAsmList;const s : string; weak: boolean);override;
         procedure a_call_name(list : TAsmList;const s : string; weak: boolean);override;
         procedure a_call_reg(list : TAsmList;reg : tregister);override;
         procedure a_call_reg(list : TAsmList;reg : tregister);override;
@@ -61,17 +61,13 @@ unit cgcpu;
         procedure a_loadfpu_reg_ref(list: TAsmList; fromsize, tosize: tcgsize; reg: tregister; const ref: treference); override;
         procedure a_loadfpu_reg_ref(list: TAsmList; fromsize, tosize: tcgsize; reg: tregister; const ref: treference); override;
         procedure a_loadfpu_ref_cgpara(list : TAsmList; size : tcgsize;const ref : treference;const cgpara : TCGPara);override;
         procedure a_loadfpu_ref_cgpara(list : TAsmList; size : tcgsize;const ref : treference;const cgpara : TCGPara);override;
 
 
-        procedure a_loadmm_reg_reg(list: TAsmList;fromsize,tosize : tcgsize; reg1, reg2: tregister;shuffle : pmmshuffle); override;
-        procedure a_loadmm_ref_reg(list: TAsmList;fromsize,tosize : tcgsize; const ref: treference; reg: tregister;shuffle : pmmshuffle); override;
-        procedure a_loadmm_reg_ref(list: TAsmList;fromsize,tosize : tcgsize; reg: tregister; const ref: treference;shuffle : pmmshuffle); override;
-        procedure a_loadmm_reg_cgpara(list: TAsmList; size: tcgsize; reg: tregister;const locpara : TCGPara;shuffle : pmmshuffle); override;
-
         procedure a_op_const_reg(list : TAsmList; Op: TOpCG; size: tcgsize; a: tcgint; reg: TRegister); override;
         procedure a_op_const_reg(list : TAsmList; Op: TOpCG; size: tcgsize; a: tcgint; reg: TRegister); override;
         procedure a_op_const_ref(list : TAsmList; Op: TOpCG; size: TCGSize; a: tcgint; const ref: TReference); override;
         procedure a_op_const_ref(list : TAsmList; Op: TOpCG; size: TCGSize; a: tcgint; const ref: TReference); override;
-        procedure a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; reg1, reg2: TRegister); override;
+        procedure a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; src, dst: TRegister); override;
         procedure a_op_reg_ref(list : TAsmList; Op: TOpCG; size: TCGSize; reg: TRegister; const ref: TReference); override;
         procedure a_op_reg_ref(list : TAsmList; Op: TOpCG; size: TCGSize; reg: TRegister; const ref: TReference); override;
 
 
         procedure a_cmp_const_reg_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;a : tcgint;reg : tregister; l : tasmlabel);override;
         procedure a_cmp_const_reg_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;a : tcgint;reg : tregister; l : tasmlabel);override;
+        procedure a_cmp_const_ref_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;a : tcgint;const ref : treference; l : tasmlabel); override;
         procedure a_cmp_reg_reg_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel); override;
         procedure a_cmp_reg_reg_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel); override;
         procedure a_jmp_name(list : TAsmList;const s : string); override;
         procedure a_jmp_name(list : TAsmList;const s : string); override;
         procedure a_jmp_always(list : TAsmList;l: tasmlabel); override;
         procedure a_jmp_always(list : TAsmList;l: tasmlabel); override;
@@ -97,9 +93,9 @@ unit cgcpu;
         procedure sign_extend(list: TAsmList;_oldsize : tcgsize; reg: tregister);
         procedure sign_extend(list: TAsmList;_oldsize : tcgsize; reg: tregister);
         procedure sign_extend(list: TAsmList;_oldsize : tcgsize; _newsize : tcgsize; reg: tregister);
         procedure sign_extend(list: TAsmList;_oldsize : tcgsize; _newsize : tcgsize; reg: tregister);
 
 
-     protected
+        procedure g_stackpointer_alloc(list : TAsmList;localsize : longint);override;
         function fixref(list: TAsmList; var ref: treference): boolean;
         function fixref(list: TAsmList; var ref: treference): boolean;
-
+     protected
         procedure call_rtl_mul_const_reg(list:tasmlist;size:tcgsize;a:tcgint;reg:tregister;const name:string);
         procedure call_rtl_mul_const_reg(list:tasmlist;size:tcgsize;a:tcgint;reg:tregister;const name:string);
         procedure call_rtl_mul_reg_reg(list:tasmlist;reg1,reg2:tregister;const name:string);
         procedure call_rtl_mul_reg_reg(list:tasmlist;reg1,reg2:tregister;const name:string);
      private
      private
@@ -156,8 +152,8 @@ unit cgcpu;
        A_LSR,
        A_LSR,
        A_SUB,
        A_SUB,
        A_EOR,
        A_EOR,
-       A_NONE,
-       A_NONE
+       A_ROL,
+       A_ROR
       );
       );
 
 
       { opcode with extend bits table lookup, used by 64bit cg }
       { opcode with extend bits table lookup, used by 64bit cg }
@@ -402,52 +398,30 @@ unit cgcpu;
           inherited a_load_ref_cgpara(list,size,r,cgpara);
           inherited a_load_ref_cgpara(list,size,r,cgpara);
       end;
       end;
 
 
-{
+
     procedure tcg68k.a_loadaddr_ref_cgpara(list : TAsmList;const r : treference;const cgpara : tcgpara);
     procedure tcg68k.a_loadaddr_ref_cgpara(list : TAsmList;const r : treference;const cgpara : tcgpara);
       var
       var
-        tmpreg : tregister;
-        opsize : topsize;
+        tmpref : treference;
       begin
       begin
-        with r do
+        { 68k always passes arguments on the stack }
+        if use_push(cgpara) then
           begin
           begin
-            { i suppose this is not required for m68k (KB) }
-//            if (segment<>NR_NO) then
-//              cgmessage(cg_e_cant_use_far_pointer_there);
-            if not use_push(cgpara) then
-              begin
-                cgpara.check_simple_location;
-                opsize:=tcgsize2opsize[OS_ADDR];
-                if (segment=NR_NO) and (base=NR_NO) and (index=NR_NO) then
-                  begin
-                    if assigned(symbol) then
-//                      list.concat(Taicpu.Op_sym_ofs(A_PUSH,opsize,symbol,offset))
-                    else;
-//                      list.concat(Taicpu.Op_const(A_PUSH,opsize,offset));
-                  end
-                else if (segment=NR_NO) and (base=NR_NO) and (index<>NR_NO) and
-                        (offset=0) and (scalefactor=0) and (symbol=nil) then
-//                  list.concat(Taicpu.Op_reg(A_PUSH,opsize,index))
-                else if (segment=NR_NO) and (base<>NR_NO) and (index=NR_NO) and
-                        (offset=0) and (symbol=nil) then
-//                  list.concat(Taicpu.Op_reg(A_PUSH,opsize,base))
-                else
-                  begin
-                    tmpreg:=getaddressregister(list);
-                    a_loadaddr_ref_reg(list,r,tmpreg);
-//                    list.concat(taicpu.op_reg(A_PUSH,opsize,tmpreg));
-                  end;
-              end
-            else
-              inherited a_loadaddr_ref_cgpara(list,r,cgpara);
-          end;
+            //list.concat(tai_comment.create(strpnew('a_loadaddr_ref_cgpara: PEA')));
+            cgpara.check_simple_location;
+            tmpref:=r;
+            fixref(list,tmpref);
+            list.concat(taicpu.op_ref(A_PEA,S_NO,tmpref));
+          end
+        else
+          inherited a_loadaddr_ref_cgpara(list,r,cgpara);
       end;
       end;
-}
 
 
     function tcg68k.fixref(list: TAsmList; var ref: treference): boolean;
     function tcg68k.fixref(list: TAsmList; var ref: treference): boolean;
        var
        var
          hreg,idxreg : tregister;
          hreg,idxreg : tregister;
          href : treference;
          href : treference;
          instr : taicpu;
          instr : taicpu;
+         scale : aint;
        begin
        begin
          result:=false;
          result:=false;
          { The MC68020+ has extended
          { The MC68020+ has extended
@@ -565,76 +539,70 @@ unit cgcpu;
                  begin
                  begin
                    if assigned(ref.symbol) then
                    if assigned(ref.symbol) then
                      begin
                      begin
+                       //list.concat(tai_comment.create(strpnew('fixref: symbol')));
                        hreg:=cg.getaddressregister(list);
                        hreg:=cg.getaddressregister(list);
                        reference_reset_symbol(href,ref.symbol,ref.offset,ref.alignment);
                        reference_reset_symbol(href,ref.symbol,ref.offset,ref.alignment);
                        list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
                        list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
                        if ref.index<>NR_NO then
                        if ref.index<>NR_NO then
                          begin
                          begin
+                           { fold the symbol + offset into the base, not the base into the index,
+                             because that might screw up the scalefactor of the reference }
+                           //list.concat(tai_comment.create(strpnew('fixref: symbol + offset (index + base)')));
                            idxreg:=getaddressregister(list);
                            idxreg:=getaddressregister(list);
-                           instr:=taicpu.op_reg_reg(A_MOVE,S_L,ref.base,idxreg);
-                           //add_move_instruction(instr);
-                           list.concat(instr);
-                           list.concat(taicpu.op_reg_reg(A_ADD,S_L,ref.index,idxreg));
-                           ref.index:=idxreg;
+                           reference_reset_base(href,ref.base,0,ref.alignment);
+                           href.index:=hreg;
+                           hreg:=getaddressregister(list);
+                           list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
+                           ref.base:=hreg;
                          end
                          end
                        else
                        else
-                         ref.index:=ref.base;
-                       ref.base:=hreg;
+                         ref.index:=hreg;
+
                        ref.offset:=0;
                        ref.offset:=0;
                        ref.symbol:=nil;
                        ref.symbol:=nil;
-                     end;
-                   { once the above is verified to work the below code can be
-                     removed }
-                   {if assigned(ref.symbol) and (ref.index=NR_NO) then
-                     begin
-                       hreg:=cg.getaddressregister(list);
-                       reference_reset_symbol(href,ref.symbol,0,ref.alignment);
-                       list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
-                       ref.index:=ref.base;
-                       ref.base:=hreg;
-                       ref.symbol:=nil;
-                     end;
-                   if (ref.index<>NR_NO) and assigned(ref.symbol) then
-                     begin
-                       hreg:=getaddressregister(list);
-                       list.concat(taicpu.op_reg_reg(A_MOVE,S_L,ref.base,hreg));
-                       list.concat(taicpu.op_reg_reg(A_ADD,S_L,ref.index,hreg));
-                       ref.base:=hreg;
-                       ref.index:=NR_NO;
-                     end;}
-                   {if (ref.index <> NR_NO) and assigned(ref.symbol) then
-                      internalerror(2002081403);}
-                   { base + reg }
-                   if ref.index <> NR_NO then
-                      begin
+                       fixref:=true;
+                     end
+                   else
+                     { base + reg }
+                     if ref.index <> NR_NO then
+                       begin
                          { base + reg + offset }
                          { base + reg + offset }
                          if (ref.offset < low(shortint)) or (ref.offset > high(shortint)) then
                          if (ref.offset < low(shortint)) or (ref.offset > high(shortint)) then
                            begin
                            begin
-                              hreg:=getaddressregister(list);
-                              instr:=taicpu.op_reg_reg(A_MOVE,S_L,ref.base,hreg);
-                              //add_move_instruction(instr);
-                              list.concat(instr);
-                              list.concat(taicpu.op_const_reg(A_ADD,S_L,ref.offset,hreg));
-                              fixref:=true;
-                              ref.base:=hreg;
-                              ref.offset:=0;
-                              exit;
+                             hreg:=getaddressregister(list);
+                             if (ref.offset < low(smallint)) or (ref.offset > high(smallint)) then
+                               begin
+                                 instr:=taicpu.op_reg_reg(A_MOVE,S_L,ref.base,hreg);
+                                 //add_move_instruction(instr);
+                                 list.concat(instr);
+                                 list.concat(taicpu.op_const_reg(A_ADD,S_L,ref.offset,hreg));
+                               end
+                             else
+                               begin
+                                 //list.concat(tai_comment.create(strpnew('fixref: base + reg + offset lea')));
+                                 reference_reset_base(href,ref.base,ref.offset,ref.alignment);
+                                 list.concat(taicpu.op_ref_reg(A_LEA,S_NO,href,hreg));
+                               end;
+                             fixref:=true;
+                             ref.base:=hreg;
+                             ref.offset:=0;
+                             exit;
                            end;
                            end;
-                      end
-                   else
-                   { base + offset }
-                   if (ref.offset < low(smallint)) or (ref.offset > high(smallint)) then
-                     begin
-                       hreg:=getaddressregister(list);
-                       instr:=taicpu.op_reg_reg(A_MOVE,S_L,ref.base,hreg);
-                       //add_move_instruction(instr);
-                       list.concat(instr);
-                       list.concat(taicpu.op_const_reg(A_ADD,S_L,ref.offset,hreg));
-                       fixref:=true;
-                       ref.offset:=0;
-                       ref.base:=hreg;
-                       exit;
-                     end;
+                       end
+                     else
+                       { base + offset }
+                       if (ref.offset < low(smallint)) or (ref.offset > high(smallint)) then
+                         begin
+                           hreg:=getaddressregister(list);
+                           instr:=taicpu.op_reg_reg(A_MOVE,S_L,ref.base,hreg);
+                           //add_move_instruction(instr);
+                           list.concat(instr);
+                           list.concat(taicpu.op_const_reg(A_ADD,S_L,ref.offset,hreg));
+                           fixref:=true;
+                           ref.offset:=0;
+                           ref.base:=hreg;
+                           exit;
+                         end;
                  end
                  end
                else
                else
                  { Note: symbol -> ref would be supported as long as ref does not
                  { Note: symbol -> ref would be supported as long as ref does not
@@ -644,10 +612,12 @@ unit cgcpu;
                    begin
                    begin
                      hreg:=cg.getaddressregister(list);
                      hreg:=cg.getaddressregister(list);
                      idxreg:=ref.index;
                      idxreg:=ref.index;
+                     scale:=ref.scalefactor;
                      ref.index:=NR_NO;
                      ref.index:=NR_NO;
                      list.concat(taicpu.op_ref_reg(A_LEA,S_L,ref,hreg));
                      list.concat(taicpu.op_ref_reg(A_LEA,S_L,ref,hreg));
                      reference_reset_base(ref,hreg,0,ref.alignment);
                      reference_reset_base(ref,hreg,0,ref.alignment);
                      ref.index:=idxreg;
                      ref.index:=idxreg;
+                     ref.scalefactor:=scale;
                      fixref:=true;
                      fixref:=true;
                    end;
                    end;
              end;
              end;
@@ -726,35 +696,34 @@ unit cgcpu;
         else
         else
           sym:=current_asmdata.WeakRefAsmSymbol(s);
           sym:=current_asmdata.WeakRefAsmSymbol(s);
 
 
-        list.concat(taicpu.op_sym(A_JSR,S_NO,current_asmdata.RefAsmSymbol(s)));
+        list.concat(taicpu.op_sym(A_JSR,S_NO,sym));
       end;
       end;
 
 
 
 
     procedure tcg68k.a_call_reg(list : TAsmList;reg: tregister);
     procedure tcg68k.a_call_reg(list : TAsmList;reg: tregister);
       var
       var
         tmpref : treference;
         tmpref : treference;
-	tmpreg : tregister;
+        tmpreg : tregister;
         instr : taicpu;
         instr : taicpu;
       begin
       begin
-	if isaddressregister(reg) then
-	  begin
-	    { if we have an address register, we can jump to the address directly }
+        if isaddressregister(reg) then
+          begin
+            { if we have an address register, we can jump to the address directly }
             reference_reset_base(tmpref,reg,0,4);
             reference_reset_base(tmpref,reg,0,4);
-	  end
-	else
-	  begin
-	    { if we have a data register, we need to move it to an address register first }
-	    tmpreg:=getaddressregister(list);
+          end
+        else
+          begin
+            { if we have a data register, we need to move it to an address register first }
+            tmpreg:=getaddressregister(list);
             reference_reset_base(tmpref,tmpreg,0,4);
             reference_reset_base(tmpref,tmpreg,0,4);
             instr:=taicpu.op_reg_reg(A_MOVE,S_L,reg,tmpreg);
             instr:=taicpu.op_reg_reg(A_MOVE,S_L,reg,tmpreg);
             add_move_instruction(instr);
             add_move_instruction(instr);
             list.concat(instr);
             list.concat(instr);
-	  end;
-	list.concat(taicpu.op_ref(A_JSR,S_NO,tmpref));
+          end;
+        list.concat(taicpu.op_ref(A_JSR,S_NO,tmpref));
      end;
      end;
 
 
 
 
-
     procedure tcg68k.a_load_const_reg(list : TAsmList;size : tcgsize;a : tcgint;register : tregister);
     procedure tcg68k.a_load_const_reg(list : TAsmList;size : tcgsize;a : tcgint;register : tregister);
       var
       var
         opsize: topsize;
         opsize: topsize;
@@ -772,7 +741,10 @@ unit cgcpu;
                  ((longint(a) = -1) or ((longint(a) > 0) and (longint(a) < 8))) then
                  ((longint(a) = -1) or ((longint(a) > 0) and (longint(a) < 8))) then
                 list.concat(taicpu.op_const_reg(A_MOV3Q,S_L,longint(a),register))
                 list.concat(taicpu.op_const_reg(A_MOV3Q,S_L,longint(a),register))
               else
               else
-                list.concat(taicpu.op_const_reg(A_MOVE,S_L,longint(a),register));
+                { We don't have to specify the size here, the assembler will decide the size of
+                  the operand it needs. If this ends up as a MOVEA.W, that will sign extend the
+                  value in the dest. reg to full 32 bits (specific to Ax regs only) }
+                list.concat(taicpu.op_const_reg(A_MOVEA,S_NO,longint(a),register));
           end
           end
         else
         else
         if a = 0 then
         if a = 0 then
@@ -827,7 +799,7 @@ unit cgcpu;
             ) then
             ) then
           begin
           begin
             hreg:=getintregister(list,tosize);
             hreg:=getintregister(list,tosize);
-            list.concat(taicpu.op_const_reg(A_MOVE,tcgsize2opsize[tosize],longint(a),hreg));
+            a_load_const_reg(list,tosize,a,hreg);
             list.concat(taicpu.op_reg_ref(A_MOVE,tcgsize2opsize[tosize],hreg,href));
             list.concat(taicpu.op_reg_ref(A_MOVE,tcgsize2opsize[tosize],hreg,href));
           end
           end
         else
         else
@@ -837,17 +809,14 @@ unit cgcpu;
 
 
     procedure tcg68k.a_load_reg_ref(list : TAsmList;fromsize,tosize : tcgsize;register : tregister;const ref : treference);
     procedure tcg68k.a_load_reg_ref(list : TAsmList;fromsize,tosize : tcgsize;register : tregister;const ref : treference);
       var
       var
-       href : treference;
-        size : tcgsize;
+        href : treference;
       begin
       begin
         href := ref;
         href := ref;
         fixref(list,href);
         fixref(list,href);
         if tcgsize2size[fromsize]<tcgsize2size[tosize] then
         if tcgsize2size[fromsize]<tcgsize2size[tosize] then
-          size:=fromsize
-        else
-          size:=tosize;
+          a_load_reg_reg(list,fromsize,tosize,register,register);
         { move to destination reference }
         { move to destination reference }
-        list.concat(taicpu.op_reg_ref(A_MOVE,TCGSize2OpSize[size],register,href));
+        list.concat(taicpu.op_reg_ref(A_MOVE,TCGSize2OpSize[tosize],register,href));
       end;
       end;
 
 
 
 
@@ -959,17 +928,9 @@ unit cgcpu;
 
 
 
 
     procedure tcg68k.a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);
     procedure tcg68k.a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);
-     var
-       href : treference;
-//       p: pointer;
+      var
+        href : treference;
       begin
       begin
-         { TODO: FIX ME!!! take a look on this mess again...}
-//        if getregtype(r)=R_ADDRESSREGISTER then
-//          begin
-//            writeln('address reg?!?');
-//            p:=nil; dword(p^):=0; {DEBUG CODE... :D )
-//            internalerror(2002072901);
-//          end;
         href:=ref;
         href:=ref;
         fixref(list, href);
         fixref(list, href);
         list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,r));
         list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,r));
@@ -994,7 +955,6 @@ unit cgcpu;
      var
      var
       opsize : topsize;
       opsize : topsize;
       href : treference;
       href : treference;
-      tmpreg : tregister;
       begin
       begin
         opsize := tcgsize2opsize[fromsize];
         opsize := tcgsize2opsize[fromsize];
         { extended is not supported, since it is not available on Coldfire }
         { extended is not supported, since it is not available on Coldfire }
@@ -1049,38 +1009,11 @@ unit cgcpu;
       end;
       end;
 
 
 
 
-    procedure tcg68k.a_loadmm_reg_reg(list: TAsmList;fromsize,tosize : tcgsize; reg1, reg2: tregister;shuffle : pmmshuffle);
-      begin
-        internalerror(20020729);
-      end;
-
-
-    procedure tcg68k.a_loadmm_ref_reg(list: TAsmList;fromsize,tosize : tcgsize; const ref: treference; reg: tregister;shuffle : pmmshuffle);
-      begin
-        internalerror(20020729);
-      end;
-
-
-    procedure tcg68k.a_loadmm_reg_ref(list: TAsmList;fromsize,tosize : tcgsize; reg: tregister; const ref: treference;shuffle : pmmshuffle);
-      begin
-        internalerror(20020729);
-      end;
-
-
-    procedure tcg68k.a_loadmm_reg_cgpara(list: TAsmList; size: tcgsize; reg: tregister;const locpara : TCGPara;shuffle : pmmshuffle);
-      begin
-        internalerror(20020729);
-      end;
-
-
     procedure tcg68k.a_op_const_reg(list : TAsmList; Op: TOpCG; size: tcgsize; a: tcgint; reg: TRegister);
     procedure tcg68k.a_op_const_reg(list : TAsmList; Op: TOpCG; size: tcgsize; a: tcgint; reg: TRegister);
       var
       var
        scratch_reg : tregister;
        scratch_reg : tregister;
        scratch_reg2: tregister;
        scratch_reg2: tregister;
        opcode : tasmop;
        opcode : tasmop;
-       r,r2 : Tregister;
-       instr : taicpu;
-       paraloc1,paraloc2,paraloc3 : tcgpara;
       begin
       begin
         optimize_op_const(size, op, a);
         optimize_op_const(size, op, a);
         opcode := topcg2tasmop[op];
         opcode := topcg2tasmop[op];
@@ -1098,7 +1031,7 @@ unit cgcpu;
           OP_SUB:
           OP_SUB:
               begin
               begin
                 { add/sub works the same way, so have it unified here }
                 { add/sub works the same way, so have it unified here }
-                if (a >= 1) and (a <= 8) and not isaddressregister(reg) then
+                if (a >= 1) and (a <= 8) then
                   if (op = OP_ADD) then
                   if (op = OP_ADD) then
                     opcode:=A_ADDQ
                     opcode:=A_ADDQ
                   else
                   else
@@ -1159,6 +1092,8 @@ unit cgcpu;
                         call_rtl_mul_const_reg(list, size, a, reg,'fpc_mul_longint');
                         call_rtl_mul_const_reg(list, size, a, reg,'fpc_mul_longint');
                   end;
                   end;
               end;
               end;
+          OP_ROL,
+          OP_ROR,
           OP_SAR,
           OP_SAR,
           OP_SHL,
           OP_SHL,
           OP_SHR :
           OP_SHR :
@@ -1198,16 +1133,13 @@ unit cgcpu;
         opsize := TCGSize2OpSize[size];
         opsize := TCGSize2OpSize[size];
 
 
         { on ColdFire all arithmetic operations are only possible on 32bit }
         { on ColdFire all arithmetic operations are only possible on 32bit }
-        if not isvalidreference(ref) or
-           ((current_settings.cputype in cpu_coldfire) and (opsize <> S_L)
+        if ((current_settings.cputype in cpu_coldfire) and (opsize <> S_L)
            and not (op in [OP_NONE,OP_MOVE])) then
            and not (op in [OP_NONE,OP_MOVE])) then
           begin
           begin
             inherited;
             inherited;
             exit;
             exit;
           end;
           end;
 
 
-        href:=ref;
-        fixref(list,href);
         case op of
         case op of
           OP_NONE :
           OP_NONE :
             begin
             begin
@@ -1221,6 +1153,8 @@ unit cgcpu;
           OP_ADD,
           OP_ADD,
           OP_SUB :
           OP_SUB :
             begin
             begin
+              href:=ref;
+              fixref(list,href);
               { add/sub works the same way, so have it unified here }
               { add/sub works the same way, so have it unified here }
               if (a >= 1) and (a <= 8) then
               if (a >= 1) and (a <= 8) then
                 begin
                 begin
@@ -1245,10 +1179,9 @@ unit cgcpu;
         end;
         end;
       end;
       end;
 
 
-    procedure tcg68k.a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; reg1, reg2: TRegister);
+    procedure tcg68k.a_op_reg_reg(list : TAsmList; Op: TOpCG; size: TCGSize; src, dst: TRegister);
       var
       var
-        hreg1, hreg2,r,r2: tregister;
-        instr : taicpu;
+        hreg1, hreg2: tregister;
         opcode : tasmop;
         opcode : tasmop;
         opsize : topsize;
         opsize : topsize;
       begin
       begin
@@ -1265,18 +1198,18 @@ unit cgcpu;
                 if current_settings.cputype in cpu_coldfire then
                 if current_settings.cputype in cpu_coldfire then
                   begin
                   begin
                     { operation only allowed only a longword }
                     { operation only allowed only a longword }
-                    sign_extend(list, size, reg1);
-                    sign_extend(list, size, reg2);
+                    sign_extend(list, size, src);
+                    sign_extend(list, size, dst);
                   end;
                   end;
-                list.concat(taicpu.op_reg_reg(opcode, opsize, reg1, reg2));
+                list.concat(taicpu.op_reg_reg(opcode, opsize, src, dst));
               end;
               end;
           OP_AND,OP_OR,
           OP_AND,OP_OR,
           OP_SAR,OP_SHL,
           OP_SAR,OP_SHL,
           OP_SHR,OP_XOR:
           OP_SHR,OP_XOR:
               begin
               begin
                 { load to data registers }
                 { load to data registers }
-                hreg1 := force_to_dataregister(list, size, reg1);
-                hreg2 := force_to_dataregister(list, size, reg2);
+                hreg1 := force_to_dataregister(list, size, src);
+                hreg2 := force_to_dataregister(list, size, dst);
 
 
                 if current_settings.cputype in cpu_coldfire then
                 if current_settings.cputype in cpu_coldfire then
                   begin
                   begin
@@ -1294,7 +1227,7 @@ unit cgcpu;
                 list.concat(taicpu.op_reg_reg(opcode, opsize, hreg1, hreg2));
                 list.concat(taicpu.op_reg_reg(opcode, opsize, hreg1, hreg2));
 
 
                 { move back result into destination register }
                 { move back result into destination register }
-                move_if_needed(list, size, hreg2, reg2);
+                move_if_needed(list, size, hreg2, dst);
               end;
               end;
           OP_DIV,
           OP_DIV,
           OP_IDIV :
           OP_IDIV :
@@ -1307,14 +1240,14 @@ unit cgcpu;
                 if (current_settings.cputype <> cpu_mc68020) and
                 if (current_settings.cputype <> cpu_mc68020) and
                    (not (current_settings.cputype in cpu_coldfire)) then
                    (not (current_settings.cputype in cpu_coldfire)) then
                   if op = OP_MUL then
                   if op = OP_MUL then
-                    call_rtl_mul_reg_reg(list,reg1,reg2,'fpc_mul_dword')
+                    call_rtl_mul_reg_reg(list,src,dst,'fpc_mul_dword')
                   else
                   else
-                    call_rtl_mul_reg_reg(list,reg1,reg2,'fpc_mul_longint')
+                    call_rtl_mul_reg_reg(list,src,dst,'fpc_mul_longint')
                 else
                 else
                   begin
                   begin
                     { 68020+ and ColdFire codepath, probably could be improved }
                     { 68020+ and ColdFire codepath, probably could be improved }
-                    hreg1 := force_to_dataregister(list, size, reg1);
-                    hreg2 := force_to_dataregister(list, size, reg2);
+                    hreg1 := force_to_dataregister(list, size, src);
+                    hreg2 := force_to_dataregister(list, size, dst);
 
 
                     sign_extend(list, size, hreg1);
                     sign_extend(list, size, hreg1);
                     sign_extend(list, size, hreg2);
                     sign_extend(list, size, hreg2);
@@ -1322,7 +1255,7 @@ unit cgcpu;
                     list.concat(taicpu.op_reg_reg(opcode, opsize, hreg1, hreg2));
                     list.concat(taicpu.op_reg_reg(opcode, opsize, hreg1, hreg2));
 
 
                     { move back result into destination register }
                     { move back result into destination register }
-                    move_if_needed(list, size, hreg2, reg2);
+                    move_if_needed(list, size, hreg2, dst);
                   end;
                   end;
               end;
               end;
           OP_NEG,
           OP_NEG,
@@ -1331,12 +1264,10 @@ unit cgcpu;
                 { if there are two operands, move the register,
                 { if there are two operands, move the register,
                   since the operation will only be done on the result
                   since the operation will only be done on the result
                   register. }
                   register. }
-                if reg1 <> NR_NO then
-                  hreg1:=reg1
-                else
-                  hreg1:=reg2;
+                if (src<>dst) then
+                  a_load_reg_reg(list,size,size,src,dst);
 
 
-                hreg2 := force_to_dataregister(list, size, hreg1);
+                hreg2 := force_to_dataregister(list, size, dst);
 
 
                 { coldfire only supports long version }
                 { coldfire only supports long version }
                 if current_settings.cputype in cpu_ColdFire then
                 if current_settings.cputype in cpu_ColdFire then
@@ -1345,7 +1276,7 @@ unit cgcpu;
                 list.concat(taicpu.op_reg(opcode, opsize, hreg2));
                 list.concat(taicpu.op_reg(opcode, opsize, hreg2));
 
 
                 { move back the result to the result register if needed }
                 { move back the result to the result register if needed }
-                move_if_needed(list, size, hreg2, reg2);
+                move_if_needed(list, size, hreg2, dst);
               end;
               end;
         else
         else
             internalerror(20020729);
             internalerror(20020729);
@@ -1357,14 +1288,14 @@ unit cgcpu;
       var
       var
         opcode : tasmop;
         opcode : tasmop;
         opsize : topsize;
         opsize : topsize;
+        href   : treference;
       begin
       begin
         opcode := topcg2tasmop[op];
         opcode := topcg2tasmop[op];
         opsize := TCGSize2OpSize[size];
         opsize := TCGSize2OpSize[size];
 
 
         { on ColdFire all arithmetic operations are only possible on 32bit 
         { on ColdFire all arithmetic operations are only possible on 32bit 
           and addressing modes are limited }
           and addressing modes are limited }
-        if not isvalidreference(ref) or
-           ((current_settings.cputype in cpu_coldfire) and (opsize <> S_L)) then
+        if ((current_settings.cputype in cpu_coldfire) and (opsize <> S_L)) then
           begin
           begin
             inherited;
             inherited;
             exit;
             exit;
@@ -1374,8 +1305,10 @@ unit cgcpu;
           OP_ADD,
           OP_ADD,
           OP_SUB :
           OP_SUB :
             begin
             begin
+              href:=ref;
+              fixref(list,href);
               { add/sub works the same way, so have it unified here }
               { add/sub works the same way, so have it unified here }
-              list.concat(taicpu.op_reg_ref(opcode, opsize, reg, ref));
+              list.concat(taicpu.op_reg_ref(opcode, opsize, reg, href));
             end;
             end;
           else begin
           else begin
 //            list.concat(tai_comment.create(strpnew('a_op_reg_ref inherited')));
 //            list.concat(tai_comment.create(strpnew('a_op_reg_ref inherited')));
@@ -1442,6 +1375,27 @@ unit cgcpu;
          a_jmp_cond(list,cmp_op,l);
          a_jmp_cond(list,cmp_op,l);
       end;
       end;
 
 
+    procedure tcg68k.a_cmp_const_ref_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;a : tcgint;const ref : treference; l : tasmlabel);
+      var
+        tmpref: treference;
+      begin
+        { optimize for usage of TST here, so ref compares against zero, which is the 
+          most common case by far in the RTL code at least (KB) }
+        if (a = 0) then
+          begin
+            //list.concat(tai_comment.create(strpnew('a_cmp_const_ref_label with TST')));
+            tmpref:=ref;
+            fixref(list,tmpref);
+            list.concat(taicpu.op_ref(A_TST,tcgsize2opsize[size],tmpref));
+            a_jmp_cond(list,cmp_op,l);
+          end
+        else
+          begin
+            //list.concat(tai_comment.create(strpnew('a_cmp_const_ref_label inherited')));
+            inherited;
+          end;
+      end;
+
     procedure tcg68k.a_cmp_reg_reg_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel);
     procedure tcg68k.a_cmp_reg_reg_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel);
       begin
       begin
          list.concat(taicpu.op_reg_reg(A_CMP,tcgsize2opsize[size],reg1,reg2));
          list.concat(taicpu.op_reg_reg(A_CMP,tcgsize2opsize[size],reg1,reg2));
@@ -1512,36 +1466,20 @@ unit cgcpu;
      var
      var
          helpsize : longint;
          helpsize : longint;
          i : byte;
          i : byte;
-         reg8,reg32 : tregister;
-         swap : boolean;
          hregister : tregister;
          hregister : tregister;
          iregister : tregister;
          iregister : tregister;
          jregister : tregister;
          jregister : tregister;
          hp1 : treference;
          hp1 : treference;
          hp2 : treference;
          hp2 : treference;
          hl : tasmlabel;
          hl : tasmlabel;
-         hl2: tasmlabel;
-         popaddress : boolean;
          srcref,dstref : treference;
          srcref,dstref : treference;
-         alignsize : tcgsize;
          orglen : tcgint;
          orglen : tcgint;
       begin
       begin
-         popaddress := false;
-
-//	 writeln('concatcopy:',len);
-
-         { this should never occur }
-         if len > 65535 then
-           internalerror(0);
-
          hregister := getintregister(list,OS_INT);
          hregister := getintregister(list,OS_INT);
-//         if delsource then
-//            reference_release(list,source);
-
          orglen:=len;
          orglen:=len;
 
 
          { from 12 bytes movs is being used }
          { from 12 bytes movs is being used }
-         if {(not loadref) and} ((len<=8) or (not(cs_opt_size in current_settings.optimizerswitches) and (len<=12))) then
+         if ((len<=8) or (not(cs_opt_size in current_settings.optimizerswitches) and (len<=12))) then
            begin
            begin
               srcref := source;
               srcref := source;
               dstref := dest;
               dstref := dest;
@@ -1558,14 +1496,7 @@ unit cgcpu;
               { move a word }
               { move a word }
               if len>1 then
               if len>1 then
                 begin
                 begin
-                   if (orglen<sizeof(aint)) and
-                       (source.base=NR_FRAME_POINTER_REG) and
-                       (source.offset>0) then
-                     { copy of param to local location }
-                     alignsize:=OS_INT
-                   else
-                     alignsize:=OS_16;
-                   a_load_ref_reg(list,alignsize,alignsize,srcref,hregister);
+                   a_load_ref_reg(list,OS_16,OS_16,srcref,hregister);
                    a_load_reg_ref(list,OS_16,OS_16,hregister,dstref);
                    a_load_reg_ref(list,OS_16,OS_16,hregister,dstref);
                    inc(srcref.offset,2);
                    inc(srcref.offset,2);
                    inc(dstref.offset,2);
                    inc(dstref.offset,2);
@@ -1574,14 +1505,7 @@ unit cgcpu;
               { move a single byte }
               { move a single byte }
               if len>0 then
               if len>0 then
                 begin
                 begin
-                   if (orglen<sizeof(aint)) and
-                       (source.base=NR_FRAME_POINTER_REG) and
-                       (source.offset>0) then
-                     { copy of param to local location }
-                     alignsize:=OS_INT
-                   else
-                     alignsize:=OS_8;
-                   a_load_ref_reg(list,alignsize,alignsize,srcref,hregister);
+                   a_load_ref_reg(list,OS_8,OS_8,srcref,hregister);
                    a_load_reg_ref(list,OS_8,OS_8,hregister,dstref);
                    a_load_reg_ref(list,OS_8,OS_8,hregister,dstref);
                 end
                 end
            end
            end
@@ -1599,11 +1523,7 @@ unit cgcpu;
               { iregister = source }
               { iregister = source }
               { jregister = destination }
               { jregister = destination }
 
 
-{              if loadref then
-                 cg.a_load_ref_reg(list,OS_INT,OS_INT,source,iregister)
-              else}
-                 a_loadaddr_ref_reg(list,source,iregister);
-
+              a_loadaddr_ref_reg(list,source,iregister);
               a_loadaddr_ref_reg(list,dest,jregister);
               a_loadaddr_ref_reg(list,dest,jregister);
 
 
               { double word move only on 68020+ machines }
               { double word move only on 68020+ machines }
@@ -1611,15 +1531,13 @@ unit cgcpu;
               { use fast loop mode }
               { use fast loop mode }
               if (current_settings.cputype=cpu_MC68020) then
               if (current_settings.cputype=cpu_MC68020) then
                 begin
                 begin
+                   //list.concat(tai_comment.create(strpnew('g_concatcopy tight copy loop 020+')));
                    helpsize := len - len mod 4;
                    helpsize := len - len mod 4;
                    len := len mod 4;
                    len := len mod 4;
-                   list.concat(taicpu.op_const_reg(A_MOVE,S_L,helpsize div 4,hregister));
-                   current_asmdata.getjumplabel(hl2);
-                   a_jmp_always(list,hl2);
+                   a_load_const_reg(list,OS_INT,(helpsize div 4)-1,hregister);
                    current_asmdata.getjumplabel(hl);
                    current_asmdata.getjumplabel(hl);
                    a_label(list,hl);
                    a_label(list,hl);
                    list.concat(taicpu.op_ref_ref(A_MOVE,S_L,hp1,hp2));
                    list.concat(taicpu.op_ref_ref(A_MOVE,S_L,hp1,hp2));
-                   a_label(list,hl2);
                    list.concat(taicpu.op_reg_sym(A_DBRA,S_L,hregister,hl));
                    list.concat(taicpu.op_reg_sym(A_DBRA,S_L,hregister,hl));
                    if len > 1 then
                    if len > 1 then
                      begin
                      begin
@@ -1632,14 +1550,11 @@ unit cgcpu;
               else
               else
                 begin
                 begin
                    { Fast 68010 loop mode with no possible alignment problems }
                    { Fast 68010 loop mode with no possible alignment problems }
-                   helpsize := len;
-                   list.concat(taicpu.op_const_reg(A_MOVE,S_L,helpsize,hregister));
-                   current_asmdata.getjumplabel(hl2);
-                   a_jmp_always(list,hl2);
+                   //list.concat(tai_comment.create(strpnew('g_concatcopy tight byte copy loop')));
+                   a_load_const_reg(list,OS_INT,len - 1,hregister);
                    current_asmdata.getjumplabel(hl);
                    current_asmdata.getjumplabel(hl);
                    a_label(list,hl);
                    a_label(list,hl);
                    list.concat(taicpu.op_ref_ref(A_MOVE,S_B,hp1,hp2));
                    list.concat(taicpu.op_ref_ref(A_MOVE,S_B,hp1,hp2));
-                   a_label(list,hl2);
                    if current_settings.cputype in cpu_coldfire then
                    if current_settings.cputype in cpu_coldfire then
                      begin
                      begin
                        { Coldfire does not support DBRA }
                        { Coldfire does not support DBRA }
@@ -1649,18 +1564,7 @@ unit cgcpu;
                    else
                    else
                      list.concat(taicpu.op_reg_sym(A_DBRA,S_L,hregister,hl));
                      list.concat(taicpu.op_reg_sym(A_DBRA,S_L,hregister,hl));
                 end;
                 end;
-
-              { restore the registers that we have just used olny if they are used! }
-              if jregister = NR_A1 then
-                hp2.base := NR_NO;
-              if iregister = NR_A0 then
-                hp1.base := NR_NO;
-//              reference_release(list,hp1);
-//              reference_release(list,hp2);
            end;
            end;
-
-//           if delsource then
-//               tg.ungetiftemp(list,source);
     end;
     end;
 
 
     procedure tcg68k.g_overflowcheck(list: TAsmList; const l:tlocation; def:tdef);
     procedure tcg68k.g_overflowcheck(list: TAsmList; const l:tlocation; def:tdef);
@@ -1668,57 +1572,31 @@ unit cgcpu;
       end;
       end;
 
 
     procedure tcg68k.g_proc_entry(list: TAsmList; localsize: longint; nostackframe:boolean);
     procedure tcg68k.g_proc_entry(list: TAsmList; localsize: longint; nostackframe:boolean);
-      var
-        r,rsp: TRegister;
-        ref  : TReference;
       begin
       begin
+        { Carl's original code used 2x MOVE instead of LINK when localsize = 0.
+          However, a LINK seems faster than two moves on everything from 68000
+          to '060, so the two move branch here was dropped. (KB) }
         if not nostackframe then
         if not nostackframe then
           begin
           begin
-	    if localsize<>0 then
-	      begin
-	        { size can't be negative }
-		if (localsize < 0) then
-		  internalerror(2006122601);
-
-                { Not to complicate the code generator too much, and since some }
-                { of the systems only support this format, the localsize cannot }
-                { exceed 32K in size.                                           }
-                if (localsize > high(smallint)) then
-                  CGMessage(cg_e_localsize_too_big);
-
-                list.concat(taicpu.op_reg_const(A_LINK,S_W,NR_FRAME_POINTER_REG,-localsize));
-	      end
-	    else
-	      begin
-	        list.concat(taicpu.op_reg_const(A_LINK,S_W,NR_FRAME_POINTER_REG,0));
-(*
-		{ FIXME! - Carl's original code uses this method. However,
-		  according to the 68060 users manual, a LINK is faster than
-		  two moves. So, use a link in #0 case too, for now. I'm not
-		  really sure tho', that LINK supports #0 disposition, but i
-		  see no reason why it shouldn't support it. (KB) }
-
-	        { when localsize = 0, use two moves, instead of link }
-		r:=NR_FRAME_POINTER_REG;
-		rsp:=NR_STACK_POINTER_REG;
-
-	        reference_reset_base(ref,NR_STACK_POINTER_REG,0);
-		ref.direction:=dir_dec;
-                list.concat(taicpu.op_reg_ref(A_MOVE,S_L,r,ref));
-                instr:=taicpu.op_reg_reg(A_MOVE,S_L,rsp,r);
-                add_move_instruction(instr); mwould also be needed
-                list.concat(instr);
-		*)
-	      end;
+            { size can't be negative }
+            if (localsize < 0) then
+              internalerror(2006122601);
+
+            { Not to complicate the code generator too much, and since some }
+            { of the systems only support this format, the localsize cannot }
+            { exceed 32K in size.                                           }
+            if (localsize > high(smallint)) then
+              CGMessage(cg_e_localsize_too_big);
+
+            list.concat(taicpu.op_reg_const(A_LINK,S_W,NR_FRAME_POINTER_REG,-localsize));
           end;
           end;
       end;
       end;
 
 
     procedure tcg68k.g_proc_exit(list : TAsmList; parasize: longint; nostackframe: boolean);
     procedure tcg68k.g_proc_exit(list : TAsmList; parasize: longint; nostackframe: boolean);
       var
       var
         r,hregister : TRegister;
         r,hregister : TRegister;
-        spr : TRegister;
-        fpr : TRegister;
         ref : TReference;
         ref : TReference;
+        ref2: TReference;
       begin
       begin
         if not nostackframe then
         if not nostackframe then
           begin
           begin
@@ -1752,15 +1630,23 @@ unit cgcpu;
                     hregister:=NR_A0;
                     hregister:=NR_A0;
                     cg.a_reg_alloc(list,hregister);
                     cg.a_reg_alloc(list,hregister);
                     reference_reset_base(ref,NR_STACK_POINTER_REG,0,4);
                     reference_reset_base(ref,NR_STACK_POINTER_REG,0,4);
-                    ref.direction:=dir_inc;
                     list.concat(taicpu.op_ref_reg(A_MOVE,S_L,ref,hregister));
                     list.concat(taicpu.op_ref_reg(A_MOVE,S_L,ref,hregister));
 
 
+                    { instead of using a postincrement above (which also writes the     }
+                    { stackpointer reg) simply add 4 to the parasize, the instructions  }
+                    { below then take that size into account as well, so SP reg is only }
+                    { written once (KB) }
+                    parasize:=parasize+4;
+
                     r:=NR_SP;
                     r:=NR_SP;
                     { can we do a quick addition ... }
                     { can we do a quick addition ... }
-                    if (parasize > 0) and (parasize < 9) then
+                    if (parasize < 9) then
                        list.concat(taicpu.op_const_reg(A_ADDQ,S_L,parasize,r))
                        list.concat(taicpu.op_const_reg(A_ADDQ,S_L,parasize,r))
                     else { nope ... }
                     else { nope ... }
-                       list.concat(taicpu.op_const_reg(A_ADD,S_L,parasize,r));
+                       begin
+                         reference_reset_base(ref2,NR_STACK_POINTER_REG,parasize,4);
+                         list.concat(taicpu.op_ref_reg(A_LEA,S_NO,ref2,r));
+                       end;
 
 
                     reference_reset_base(ref,hregister,0,4);
                     reference_reset_base(ref,hregister,0,4);
                     list.concat(taicpu.op_ref(A_JMP,S_NO,ref));
                     list.concat(taicpu.op_ref(A_JMP,S_NO,ref));
@@ -2041,9 +1927,11 @@ unit cgcpu;
                     { offset in the wrapper needs to be adjusted for the stored
                     { offset in the wrapper needs to be adjusted for the stored
                       return address }
                       return address }
                     reference_reset_base(href,reference.index,reference.offset-sizeof(pint),sizeof(pint));
                     reference_reset_base(href,reference.index,reference.offset-sizeof(pint),sizeof(pint));
-                    list.concat(taicpu.op_ref_reg(A_MOVE,S_L,href,NR_D0));
-                    list.concat(taicpu.op_const_reg(A_SUB,S_L,ioffset,NR_D0));
-                    list.concat(taicpu.op_reg_ref(A_MOVE,S_L,NR_D0,href));
+                    { plain 68k could use SUBI on href directly, but this way it works on Coldfire too
+                      and it's probably smaller code for the majority of cases (if ioffset small, the
+                      load will use MOVEQ) (KB) }
+                    a_load_const_reg(list,OS_ADDR,ioffset,NR_D0);
+                    list.concat(taicpu.op_reg_ref(A_SUB,S_L,NR_D0,href));
                   end
                   end
                 else
                 else
                   internalerror(2013100703);
                   internalerror(2013100703);
@@ -2083,14 +1971,13 @@ unit cgcpu;
         procedure op_ona0methodaddr;
         procedure op_ona0methodaddr;
         var
         var
           href : treference;
           href : treference;
-          offs : longint;
         begin
         begin
           if (procdef.extnumber=$ffff) then
           if (procdef.extnumber=$ffff) then
             Internalerror(2013100701);
             Internalerror(2013100701);
           reference_reset_base(href,NR_A0,tobjectdef(procdef.struct).vmtmethodoffset(procdef.extnumber),4);
           reference_reset_base(href,NR_A0,tobjectdef(procdef.struct).vmtmethodoffset(procdef.extnumber),4);
           list.concat(taicpu.op_ref_reg(A_MOVE,S_L,href,NR_A0));
           list.concat(taicpu.op_ref_reg(A_MOVE,S_L,href,NR_A0));
           reference_reset_base(href,NR_A0,0,4);
           reference_reset_base(href,NR_A0,0,4);
-          list.concat(taicpu.op_ref(A_JMP,S_L,href));
+          list.concat(taicpu.op_ref(A_JMP,S_NO,href));
         end;
         end;
 
 
       var
       var
@@ -2129,18 +2016,23 @@ unit cgcpu;
           end
           end
         { case 0 }
         { case 0 }
         else
         else
-          list.concat(taicpu.op_sym(A_JMP,S_L,current_asmdata.RefAsmSymbol(procdef.mangledname)));
+          list.concat(taicpu.op_sym(A_JMP,S_NO,current_asmdata.RefAsmSymbol(procdef.mangledname)));
 
 
         List.concat(Tai_symbol_end.Createname(labelname));
         List.concat(Tai_symbol_end.Createname(labelname));
       end;
       end;
 
 
 
 
+    procedure tcg68k.g_stackpointer_alloc(list : TAsmList;localsize : longint);
+      begin
+        list.concat(taicpu.op_const_reg(A_SUB,S_L,localsize,NR_STACK_POINTER_REG));
+      end;
+
+
 {****************************************************************************}
 {****************************************************************************}
 {                               TCG64F68K                                    }
 {                               TCG64F68K                                    }
 {****************************************************************************}
 {****************************************************************************}
     procedure tcg64f68k.a_op64_reg_reg(list : TAsmList;op:TOpCG;size: tcgsize; regsrc,regdst : tregister64);
     procedure tcg64f68k.a_op64_reg_reg(list : TAsmList;op:TOpCG;size: tcgsize; regsrc,regdst : tregister64);
       var
       var
-        hreg1, hreg2 : tregister;
         opcode : tasmop;
         opcode : tasmop;
         xopcode : tasmop;
         xopcode : tasmop;
         instr : taicpu;
         instr : taicpu;

+ 4 - 3
compiler/m68k/cpubase.pas

@@ -516,9 +516,10 @@ implementation
     function inverse_cond(const c: TAsmCond): TAsmCond; {$ifdef USEINLINE}inline;{$endif USEINLINE}
     function inverse_cond(const c: TAsmCond): TAsmCond; {$ifdef USEINLINE}inline;{$endif USEINLINE}
       const
       const
         inverse:array[TAsmCond] of TAsmCond=(C_None,
         inverse:array[TAsmCond] of TAsmCond=(C_None,
-{ TODO: TODO, this is just a copy!}
-           C_CC,C_LS,C_CS,C_LT,C_EQ,C_MI,C_F,C_NE,
-           C_GE,C_PL,C_GT,C_T,C_HI,C_VC,C_LE,C_VS
+         //C_CC,C_LS,C_CS,C_LT,C_EQ,C_MI,C_F,C_NE,
+           C_CS,C_HI,C_CC,C_GE,C_NE,C_PL,C_T,C_EQ,
+         //C_GE,C_PL,C_GT,C_T,C_HI,C_VC,C_LE,C_VS
+           C_LT,C_MI,C_LE,C_F,C_LS,C_VS,C_GT,C_VC
         );
         );
       begin
       begin
         result := inverse[c];
         result := inverse[c];

+ 1 - 1
compiler/m68k/cpunode.pas

@@ -38,7 +38,7 @@ unit cpunode;
          n68kcal,
          n68kcal,
 //       nppccon,
 //       nppccon,
 //       nppcflw,
 //       nppcflw,
-//       n68kmem,
+         n68kmem,
 //       nppcset,
 //       nppcset,
 //       nppcinl,
 //       nppcinl,
 //       nppcopt,
 //       nppcopt,

+ 63 - 191
compiler/m68k/cpupara.pas

@@ -19,8 +19,6 @@
 
 
  ****************************************************************************
  ****************************************************************************
 }
 }
-{ Generates the argument location information for 680x0.
-}
 unit cpupara;
 unit cpupara;
 
 
 {$i fpcdefs.inc}
 {$i fpcdefs.inc}
@@ -41,7 +39,8 @@ unit cpupara;
          rtl are used.
          rtl are used.
        }
        }
        tcpuparamanager = class(tparamanager)
        tcpuparamanager = class(tparamanager)
-          procedure getintparaloc(pd : tabstractprocdef; nr : longint; var cgpara : tcgpara);override;
+          function ret_in_param(def:tdef;pd:tabstractprocdef):boolean;override;
+          function param_use_paraloc(const cgpara:tcgpara):boolean;override;
           function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;override;
           function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;override;
           function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
           function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
           function get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;override;
           function get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;override;
@@ -82,94 +81,24 @@ unit cpupara;
       end;
       end;
 
 
 
 
-    procedure tcpuparamanager.getintparaloc(pd : tabstractprocdef; nr : longint; var cgpara : tcgpara);
+    function tcpuparamanager.param_use_paraloc(const cgpara:tcgpara):boolean;
       var
       var
         paraloc : pcgparalocation;
         paraloc : pcgparalocation;
-        psym: tparavarsym;
-        pdef: tdef;
       begin
       begin
-         if nr<1 then
-           internalerror(2002070801);
-         psym:=tparavarsym(pd.paras[nr-1]);
-         pdef:=psym.vardef;
-         if push_addr_param(psym.varspez,pdef,pd.proccalloption) then
-           pdef:=getpointerdef(pdef);
-         cgpara.reset;
-         cgpara.size:=def_cgsize(pdef);
-         cgpara.intsize:=tcgsize2size[cgpara.size];
-         cgpara.alignment:=std_param_align;
-         cgpara.def:=pdef;
-         paraloc:=cgpara.add_location;
-         with paraloc^ do
-           begin
-              { warning : THIS ONLY WORKS WITH INTERNAL ROUTINES,
-                WHICH MUST ALWAYS PASS 4-BYTE PARAMETERS!!
-              }
-              loc:=LOC_REFERENCE;
-              reference.index:=NR_STACK_POINTER_REG;
-              reference.offset:=target_info.first_parm_offset+nr*4;
-              size:=def_cgsize(pdef);
-              def:=pdef;
-           end;
-      end;
-
-    function getparaloc(p : tdef) : tcgloc;
-
-      begin
-         result:=LOC_REFERENCE;
-         (* Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
-           if push_addr_param for the def is true
-         case p.typ of
-            orddef:
-              result:=LOC_REGISTER;
-            floatdef:
-              result:=LOC_FPUREGISTER;
-            enumdef:
-              result:=LOC_REGISTER;
-            pointerdef:
-              result:=LOC_REGISTER;
-            formaldef:
-              result:=LOC_REGISTER;
-            classrefdef:
-              result:=LOC_REGISTER;
-            recorddef:
-              if (target_info.abi<>abi_powerpc_aix) then
-                result:=LOC_REFERENCE
-              else
-                result:=LOC_REGISTER;
-            objectdef:
-              if is_object(p) then
-                result:=LOC_REFERENCE
-              else
-                result:=LOC_REGISTER;
-            stringdef:
-              if is_shortstring(p) or is_longstring(p) then
-                result:=LOC_REFERENCE
-              else
-                result:=LOC_REGISTER;
-            procvardef:
-              if (po_methodpointer in tprocvardef(p).procoptions) then
-                result:=LOC_REFERENCE
-              else
-                result:=LOC_REGISTER;
-            filedef:
-              result:=LOC_REGISTER;
-            arraydef:
-              result:=LOC_REFERENCE;
-            setdef:
-              if is_smallset(p) then
-                result:=LOC_REGISTER
-              else
-                result:=LOC_REFERENCE;
-            variantdef:
-              result:=LOC_REFERENCE;
-            { avoid problems with errornous definitions }
-            errordef:
-              result:=LOC_REGISTER;
-            else
-              internalerror(2002071001);
-         end;
-         *)
+        if not assigned(cgpara.location) then
+          internalerror(200410102);
+        result:=true;
+        { All locations are LOC_REFERENCE }
+        paraloc:=cgpara.location;
+        while assigned(paraloc) do
+          begin
+            if (paraloc^.loc<>LOC_REFERENCE) then
+              begin
+                result:=false;
+                exit;
+              end;
+            paraloc:=paraloc^.next;
+          end;
       end;
       end;
 
 
 
 
@@ -188,7 +117,7 @@ unit cpupara;
           formaldef :
           formaldef :
             result:=true;
             result:=true;
           recorddef:
           recorddef:
-            result:=true;
+            result:=false;
           arraydef:
           arraydef:
             result:=(tarraydef(def).highrange>=tarraydef(def).lowrange) or
             result:=(tarraydef(def).highrange>=tarraydef(def).lowrange) or
                              is_open_array(def) or
                              is_open_array(def) or
@@ -201,7 +130,8 @@ unit cpupara;
           stringdef :
           stringdef :
             result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
             result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
           procvardef :
           procvardef :
-            result:=po_methodpointer in tprocvardef(def).procoptions;
+            { Handling of methods must match that of records }
+            result:=false;
         end;
         end;
       end;
       end;
 
 
@@ -212,6 +142,23 @@ unit cpupara;
         curfloatreg:=RS_FP0;
         curfloatreg:=RS_FP0;
       end;
       end;
 
 
+    function tcpuparamanager.ret_in_param(def:tdef;pd:tabstractprocdef):boolean;
+      begin
+        if handle_common_ret_in_param(def,pd,result) then
+          exit;
+
+        case def.typ of
+          recorddef:
+            if def.size in [1,2,4] then
+              begin
+                result:=false;
+                exit;
+              end;
+        end;
+        result:=inherited ret_in_param(def,pd);
+      end;
+
+
     function tcpuparamanager.get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;
     function tcpuparamanager.get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;
       var
       var
         paraloc : pcgparalocation;
         paraloc : pcgparalocation;
@@ -296,29 +243,21 @@ unit cpupara;
         hp           : tparavarsym;
         hp           : tparavarsym;
         paracgsize   : tcgsize;
         paracgsize   : tcgsize;
         paralen      : aint;
         paralen      : aint;
-        parasize     : longint;
-	paradef      : tdef;
+        paradef      : tdef;
         i            : longint;
         i            : longint;
-	loc          : tcgloc;
-	nextintreg,
-	nextfloatreg : tsuperregister;
-	stack_offset : longint;
+        stack_offset : longint;
         firstparaloc : boolean;
         firstparaloc : boolean;
 
 
       begin
       begin
         result:=0;
         result:=0;
-	nextintreg:=curintreg;
-	nextfloatreg:=curfloatreg;
-	stack_offset:=cur_stack_offset;
-
-        parasize:=0;
+        stack_offset:=cur_stack_offset;
 
 
         for i:=0 to paras.count-1 do
         for i:=0 to paras.count-1 do
           begin
           begin
             hp:=tparavarsym(paras[i]);
             hp:=tparavarsym(paras[i]);
-	    paradef:=hp.vardef;
+            paradef:=hp.vardef;
 
 
-	    { syscall for AmigaOS can have already a paraloc set }
+            { syscall for AmigaOS can have already a paraloc set }
             if (vo_has_explicit_paraloc in hp.varoptions) then
             if (vo_has_explicit_paraloc in hp.varoptions) then
               begin
               begin
                 if not(vo_is_syscall_lib in hp.varoptions) then
                 if not(vo_is_syscall_lib in hp.varoptions) then
@@ -331,13 +270,10 @@ unit cpupara;
             if (p.proccalloption in cstylearrayofconst) and
             if (p.proccalloption in cstylearrayofconst) and
                is_array_of_const(paradef) then
                is_array_of_const(paradef) then
               begin
               begin
-{$ifdef DEBUG_CHARLIE}
-                writeln('loc register');
-{$endif DEBUG_CHARLIE}
                 paraloc:=hp.paraloc[side].add_location;
                 paraloc:=hp.paraloc[side].add_location;
                 { hack: the paraloc must be valid, but is not actually used }
                 { hack: the paraloc must be valid, but is not actually used }
                 paraloc^.loc:=LOC_REGISTER;
                 paraloc^.loc:=LOC_REGISTER;
-		paraloc^.register:=NR_D0;
+                paraloc^.register:=NR_D0;
                 paraloc^.size:=OS_ADDR;
                 paraloc^.size:=OS_ADDR;
                 paraloc^.def:=voidpointertype;
                 paraloc^.def:=voidpointertype;
                 break;
                 break;
@@ -345,11 +281,7 @@ unit cpupara;
 
 
             if push_addr_param(hp.varspez,paradef,p.proccalloption) then
             if push_addr_param(hp.varspez,paradef,p.proccalloption) then
               begin
               begin
-{$ifdef DEBUG_CHARLIE}
-                writeln('loc register');
-{$endif DEBUG_CHARLIE}
                 paradef:=getpointerdef(paradef);
                 paradef:=getpointerdef(paradef);
-                loc:=LOC_REGISTER;
                 paracgsize := OS_ADDR;
                 paracgsize := OS_ADDR;
                 paralen := tcgsize2size[OS_ADDR];
                 paralen := tcgsize2size[OS_ADDR];
               end
               end
@@ -360,10 +292,9 @@ unit cpupara;
                 else
                 else
                   paralen:=tcgsize2size[def_cgsize(paradef)];
                   paralen:=tcgsize2size[def_cgsize(paradef)];
 
 
-                loc:=getparaloc(paradef);
                 paracgsize:=def_cgsize(paradef);
                 paracgsize:=def_cgsize(paradef);
                 { for things like formaldef }
                 { for things like formaldef }
-                if (paracgsize=OS_NO) then
+                if (paracgsize=OS_NO) and (paradef.typ<>recorddef) then
                   begin
                   begin
                     paracgsize:=OS_ADDR;
                     paracgsize:=OS_ADDR;
                     paralen := tcgsize2size[OS_ADDR];
                     paralen := tcgsize2size[OS_ADDR];
@@ -388,90 +319,34 @@ unit cpupara;
             while (paralen > 0) do
             while (paralen > 0) do
               begin
               begin
                 paraloc:=hp.paraloc[side].add_location;
                 paraloc:=hp.paraloc[side].add_location;
-                (*
-                  by default, the m68k doesn't know any register parameters  (FK)
-                if (loc = LOC_REGISTER) and
-                   (nextintreg <= RS_D2) then
-                  begin
-		    //writeln('loc register');
-                    paraloc^.loc := loc;
-                    { make sure we don't lose whether or not the type is signed }
-                    if (paradef.typ <> orddef) then
-                      paracgsize := int_cgsize(paralen);
-                    if (paracgsize in [OS_NO,OS_64,OS_S64]) then
-                      paraloc^.size := OS_INT
-                    else
-                      paraloc^.size := paracgsize;
-                    paraloc^.register:=newreg(R_INTREGISTER,nextintreg,R_SUBNONE);
-                    inc(nextintreg);
-                    dec(paralen,tcgsize2size[paraloc^.size]);
-                  end
-                else if (loc = LOC_FPUREGISTER) and
-                        (nextfloatreg <= RS_FP2) then
-                  begin
-//		    writeln('loc fpuregister');
-                    paraloc^.loc:=loc;
-                    paraloc^.size := paracgsize;
-                    paraloc^.register:=newreg(R_FPUREGISTER,nextfloatreg,R_SUBWHOLE);
-                    inc(nextfloatreg);
-                    dec(paralen,tcgsize2size[paraloc^.size]);
-                  end
-                else { LOC_REFERENCE }
-                *)
+
+                paraloc^.loc:=LOC_REFERENCE;
+                paraloc^.def:=get_paraloc_def(paradef,paralen,firstparaloc);
+                if (paradef.typ=floatdef) then
+                  paraloc^.size:=int_float_cgsize(paralen)
+                else
+                  paraloc^.size:=int_cgsize(paralen);
+
+                paraloc^.reference.offset:=stack_offset;
+                if (side = callerside) then
+                  paraloc^.reference.index:=NR_STACK_POINTER_REG
+                else
                   begin
                   begin
-{$ifdef DEBUG_CHARLIE}
-		    writeln('loc reference');
-{$endif DEBUG_CHARLIE}
-                    paraloc^.loc:=LOC_REFERENCE;
-                    paraloc^.def:=get_paraloc_def(paradef,paralen,firstparaloc);
-                    if paradef.typ<>orddef then
-                      paracgsize:=int_cgsize(paralen);
-                    if paracgsize=OS_NO then
-                      paraloc^.size:=OS_INT
-                    else
-                      paraloc^.size:=paracgsize;
-                    if (side = callerside) then
-                      paraloc^.reference.index:=NR_STACK_POINTER_REG
-                    else
-                      paraloc^.reference.index:=NR_FRAME_POINTER_REG;
-                    paraloc^.reference.offset:=stack_offset;
-                    inc(stack_offset,align(paralen,4));
-                    paralen := 0;
+                    paraloc^.reference.index:=NR_FRAME_POINTER_REG;
+                    { M68K is a big-endian target }
+                    if (paralen<tcgsize2size[OS_INT]) then
+                      inc(paraloc^.reference.offset,4-paralen);
                   end;
                   end;
+                inc(stack_offset,align(paralen,4));
+                paralen := 0;
+
                 firstparaloc:=false;
                 firstparaloc:=false;
               end;
               end;
           end;
           end;
          result:=stack_offset;
          result:=stack_offset;
-//	 writeln('stack offset:',stack_offset);
       end;
       end;
 
 
 
 
-{
-
-            if push_addr_param(hp.varspez,paradef,p.proccalloption) then
-              paracgsize:=OS_ADDR
-            else
-              begin
-                paracgsize:=def_cgsize(paradef);
-                if paracgsize=OS_NO then
-                  paracgsize:=OS_ADDR;
-              end;
-            hp.paraloc[side].size:=paracgsize;
-            hp.paraloc[side].Alignment:=std_param_align;
-            paraloc:=hp.paraloc[side].add_location;
-            paraloc^.size:=paracgsize;
-            paraloc^.loc:=LOC_REFERENCE;
-            if side=callerside then
-              paraloc^.reference.index:=NR_STACK_POINTER_REG
-            else
-              paraloc^.reference.index:=NR_FRAME_POINTER_REG;
-            paraloc^.reference.offset:=target_info.first_parm_offset+parasize;
-          end;
-	create_funcretloc_info(p,side);
-        result:=parasize;
-      end;
-}
-
     function tcpuparamanager.parse_loc_string_to_register(var locreg: tregister; const s : string): boolean;
     function tcpuparamanager.parse_loc_string_to_register(var locreg: tregister; const s : string): boolean;
       begin
       begin
         locreg:=std_regnum_search(lowercase(s));
         locreg:=std_regnum_search(lowercase(s));
@@ -516,10 +391,7 @@ unit cpupara;
 
 
 
 
     procedure tcpuparamanager.createtempparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;can_use_final_stack_loc : boolean;var cgpara:TCGPara);
     procedure tcpuparamanager.createtempparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;can_use_final_stack_loc : boolean;var cgpara:TCGPara);
-      var
-        paraloc : pcgparalocation;
       begin
       begin
-        paraloc:=parasym.paraloc[callerside].location;
         { Never a need for temps when value is pushed (calls inside parameters
         { Never a need for temps when value is pushed (calls inside parameters
           will simply allocate even more stack space for their parameters) }
           will simply allocate even more stack space for their parameters) }
         if not(use_fixed_stack) then
         if not(use_fixed_stack) then

+ 8 - 0
compiler/m68k/cputarg.pas

@@ -70,6 +70,14 @@ implementation
   {$ifndef NoDbgDwarf}
   {$ifndef NoDbgDwarf}
       ,dbgdwarf
       ,dbgdwarf
   {$endif NoDbgDwarf}
   {$endif NoDbgDwarf}
+
+{**************************************
+             Optimizer
+**************************************}
+
+    {$ifndef NOOPT}
+      , aoptcpu
+    {$endif NOOPT}
       ;
       ;
 
 
 end.
 end.

+ 15 - 133
compiler/m68k/n68kadd.pas

@@ -47,7 +47,6 @@ interface
           procedure second_cmpordinal;override;
           procedure second_cmpordinal;override;
           procedure second_cmpsmallset;override;
           procedure second_cmpsmallset;override;
           procedure second_cmp64bit;override;
           procedure second_cmp64bit;override;
-          procedure second_cmpboolean;override;
        public
        public
           function pass_1:tnode;override;
           function pass_1:tnode;override;
        end;
        end;
@@ -366,11 +365,9 @@ implementation
     procedure t68kaddnode.second_addfloat;
     procedure t68kaddnode.second_addfloat;
       var
       var
         op    : TAsmOp;
         op    : TAsmOp;
-        cmpop : boolean;
       begin
       begin
         pass_left_right;
         pass_left_right;
 
 
-        cmpop:=false;
         case nodetype of
         case nodetype of
           addn :
           addn :
             op:=A_FADD;
             op:=A_FADD;
@@ -380,12 +377,6 @@ implementation
             op:=A_FSUB;
             op:=A_FSUB;
           slashn :
           slashn :
             op:=A_FDIV;
             op:=A_FDIV;
-          ltn,lten,gtn,gten,
-          equaln,unequaln :
-            begin
-//              op:=A_FCMPO;
-              cmpop:=true;
-            end;
           else
           else
             internalerror(200403182);
             internalerror(200403182);
         end;
         end;
@@ -400,37 +391,20 @@ implementation
         hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
         hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
 
 
         // initialize de result
         // initialize de result
-        if not cmpop then
-          begin
-            location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
-            if left.location.loc = LOC_FPUREGISTER then
-              location.register := left.location.register
-            else if right.location.loc = LOC_FPUREGISTER then
-              location.register := right.location.register
-            else
-              location.register := cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
-          end
+        location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
+        if left.location.loc = LOC_FPUREGISTER then
+          location.register := left.location.register
+        else if right.location.loc = LOC_FPUREGISTER then
+          location.register := right.location.register
         else
         else
-         begin
-           location_reset(location,LOC_FLAGS,OS_NO);
-           // FIX ME!
-//           location.resflags := getresflags;
-         end;
+          location.register := cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
 
 
         // emit the actual operation
         // emit the actual operation
-        if not cmpop then
-          begin
-          {
-            current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op,
-              location.register,left.location.register,
-              right.location.register))
-             }
-          end
-        else
-          begin
-{            current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op,
-              newreg(R_SPECIALREGISTER,location.resflags.cr,R_SUBNONE),left.location.register,right.location.register))}
-          end;
+        {
+          current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op,
+            location.register,left.location.register,
+            right.location.register))
+        }
       end;
       end;
 
 
 
 
@@ -506,19 +480,11 @@ implementation
          lten,
          lten,
          gten:
          gten:
            begin
            begin
-             tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
+             tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,left.location.size);
              if right.location.loc=LOC_CONSTANT then
              if right.location.loc=LOC_CONSTANT then
-               begin
-                 current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_MOVE,S_L,right.location.value,tmpreg));
-                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_AND,S_L,tmpreg,left.location.register));
-                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,S_L,tmpreg,left.location.register));
-               end
-             else
-               begin
-                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_MOVE,S_L,right.location.register,tmpreg));
-                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_AND,S_L,tmpreg,left.location.register));
-                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,S_L,tmpreg,left.location.register));
-               end;
+               hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,right.resultdef,false);
+             cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_AND,OS_32,left.location.register,right.location.register,tmpreg);
+             current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,S_L,tmpreg,right.location.register));
              location.resflags:=F_E;
              location.resflags:=F_E;
            end;
            end;
          else
          else
@@ -619,90 +585,6 @@ implementation
             right.location.register,left.location.register));
             right.location.register,left.location.register));
      end;
      end;
 
 
-{*****************************************************************************
-                                Boolean
-*****************************************************************************}
-
-    procedure t68kaddnode.second_cmpboolean;
-      var
-        cgop      : TOpCg;
-        cgsize  : TCgSize;
-        isjump  : boolean;
-        otl,ofl : tasmlabel;
-      begin
-//        writeln('second_cmpboolean');
-        { ToDo : add support for pasbool64 and bool64bit }
-        if (torddef(left.resultdef).ordtype in [pasbool8,bool8bit]) or
-           (torddef(right.resultdef).ordtype in [pasbool8,bool8bit]) then
-         cgsize:=OS_8
-        else
-          if (torddef(left.resultdef).ordtype in [pasbool16,bool16bit]) or
-             (torddef(right.resultdef).ordtype in [pasbool16,bool16bit]) then
-           cgsize:=OS_16
-        else
-           cgsize:=OS_32;
-
-        if (cs_full_boolean_eval in current_settings.localswitches) or
-           (nodetype in [unequaln,ltn,lten,gtn,gten,equaln,xorn]) then
-          begin
-            if left.nodetype in [ordconstn,realconstn] then
-             swapleftright;
-
-            isjump:=(left.expectloc=LOC_JUMP);
-            if isjump then
-              begin
-                 otl:=current_procinfo.CurrTrueLabel;
-                 current_asmdata.getjumplabel(current_procinfo.CurrTrueLabel);
-                 ofl:=current_procinfo.CurrFalseLabel;
-                 current_asmdata.getjumplabel(current_procinfo.CurrFalseLabel);
-              end;
-            secondpass(left);
-            if left.location.loc in [LOC_FLAGS,LOC_JUMP] then begin
-//             writeln('ajjaj');
-             hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,cgsize_orddef(cgsize),false);
-//             writeln('reccs?');
-            end;
-            if isjump then
-             begin
-               current_procinfo.CurrTrueLabel:=otl;
-               current_procinfo.CurrFalseLabel:=ofl;
-             end;
-
-            isjump:=(right.expectloc=LOC_JUMP);
-            if isjump then
-              begin
-                 otl:=current_procinfo.CurrTrueLabel;
-                 current_asmdata.getjumplabel(current_procinfo.CurrTrueLabel);
-                 ofl:=current_procinfo.CurrFalseLabel;
-                 current_asmdata.getjumplabel(current_procinfo.CurrFalseLabel);
-              end;
-            secondpass(right);
-            if right.location.loc in [LOC_FLAGS,LOC_JUMP] then
-             hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,cgsize_orddef(cgsize),false);
-            if isjump then
-             begin
-               current_procinfo.CurrTrueLabel:=otl;
-               current_procinfo.CurrFalseLabel:=ofl;
-             end;
-
-         location_reset(location,LOC_FLAGS,OS_NO);
-
-         force_reg_left_right(true,false);
-
-            if (left.location.loc = LOC_CONSTANT) then
-              swapleftright;
-
-         if (right.location.loc <> LOC_CONSTANT) then
-           current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,S_L,
-             left.location.register,right.location.register))
-         else
-           current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_CMP,S_L,
-             longint(right.location.value),left.location.register));
-         location.resflags := getresflags(true);
-        end;
-
-        //release_reg_left_right;
-      end;
 
 
     function t68kaddnode.pass_1:tnode;
     function t68kaddnode.pass_1:tnode;
       var
       var

+ 51 - 99
compiler/m68k/n68kmat.pas

@@ -31,16 +31,15 @@ interface
     type
     type
 
 
 
 
-      tm68knotnode = class(tnotnode)
-         procedure pass_generate_code;override;
+      tm68knotnode = class(tcgnotnode)
+         procedure second_boolean;override;
       end;
       end;
 
 
       tm68kmoddivnode = class(tcgmoddivnode)
       tm68kmoddivnode = class(tcgmoddivnode)
-      private
-        procedure call_rtl_divmod_reg_reg(denum,num:tregister;const name:string);
       public
       public
-         procedure emit_div_reg_reg(signed: boolean;denum,num : tregister);override;
-         procedure emit_mod_reg_reg(signed: boolean;denum,num : tregister);override;
+        function first_moddivint: tnode;override;
+        procedure emit_div_reg_reg(signed: boolean;denum,num : tregister);override;
+        procedure emit_mod_reg_reg(signed: boolean;denum,num : tregister);override;
       end;
       end;
 
 
       tm68kshlshrnode = class(tshlshrnode)
       tm68kshlshrnode = class(tshlshrnode)
@@ -68,113 +67,78 @@ implementation
                                TM68KNOTNODE
                                TM68KNOTNODE
 *****************************************************************************}
 *****************************************************************************}
 
 
-    procedure tm68knotnode.pass_generate_code;
+    procedure tm68knotnode.second_boolean;
       var
       var
-         hl : tasmlabel;
+        hreg: tregister;
          opsize : tcgsize;
          opsize : tcgsize;
          loc : tcgloc;
          loc : tcgloc;
       begin
       begin
-         opsize:=def_cgsize(resultdef);
-         if is_boolean(resultdef) then
+        if not handle_locjump then
           begin
           begin
-            { the second pass could change the location of left }
-            { if it is a register variable, so we've to do      }
-            { this before the case statement                    }
-            if left.expectloc<>LOC_JUMP then
-              begin
-                secondpass(left);
-                loc:=left.location.loc;
-              end
-            else
-              loc:=LOC_JUMP;
-
-            case loc of
-              LOC_JUMP :
-                begin
-                  location_reset(location,LOC_JUMP,OS_NO);
-                  hl:=current_procinfo.CurrTrueLabel;
-                  current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
-                  current_procinfo.CurrFalseLabel:=hl;
-                  secondpass(left);
-                  maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars);
-                  hl:=current_procinfo.CurrTrueLabel;
-                  current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel;
-                  current_procinfo.CurrFalseLabel:=hl;
-                end;
+            secondpass(left);
+            opsize:=def_cgsize(resultdef);
+            case left.location.loc of
               LOC_FLAGS :
               LOC_FLAGS :
                 begin
                 begin
                   location_copy(location,left.location);
                   location_copy(location,left.location);
-//                  location_release(current_asmdata.CurrAsmList,left.location);
                   inverse_flags(location.resflags);
                   inverse_flags(location.resflags);
                 end;
                 end;
-              LOC_CONSTANT,
+              LOC_REFERENCE,
+              LOC_CREFERENCE:
+                begin
+                  tcg68k(cg).fixref(current_asmdata.CurrAsmList,left.location.reference);
+                  if is_64bit(resultdef) then
+                   begin
+                     hreg:=cg.GetIntRegister(current_asmdata.CurrAsmList,OS_32);
+                     cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_32,OS_32,left.location.reference,hreg);
+                     inc(left.location.reference.offset,4);
+                     cg.a_op_ref_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,left.location.reference,hreg);
+                   end
+                 else
+                   current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_TST,tcgsize2opsize[opsize],left.location.reference));
+                   location_reset(location,LOC_FLAGS,OS_NO);
+                   location.resflags:=F_E;
+                end;
               LOC_REGISTER,
               LOC_REGISTER,
               LOC_CREGISTER,
               LOC_CREGISTER,
-              LOC_REFERENCE,
-              LOC_CREFERENCE,
               LOC_SUBSETREG,
               LOC_SUBSETREG,
               LOC_CSUBSETREG,
               LOC_CSUBSETREG,
               LOC_SUBSETREF,
               LOC_SUBSETREF,
               LOC_CSUBSETREF:
               LOC_CSUBSETREF:
                 begin
                 begin
-                  hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,resultdef,true);
-                  current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_TST,tcgsize2opsize[opsize],left.location.register));
-//                  location_release(current_asmdata.CurrAsmList,left.location);
+                  if is_64bit(resultdef) then
+                    begin
+                      hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,resultdef,false);
+                      current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_OR,S_L,left.location.register64.reghi,left.location.register64.reglo));
+                    end
+                  else
+                    begin
+                      hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,resultdef,true);
+                      current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_TST,tcgsize2opsize[opsize],left.location.register));
+                    end;
                   location_reset(location,LOC_FLAGS,OS_NO);
                   location_reset(location,LOC_FLAGS,OS_NO);
                   location.resflags:=F_E;
                   location.resflags:=F_E;
                 end;
                 end;
-             else
-                internalerror(200203223);
+            else
+              internalerror(200203223);
             end;
             end;
-          end
-         else if is_64bitint(left.resultdef) then
-           begin
-              secondpass(left);
-              location_copy(location,left.location);
-              hlcg.location_force_reg(current_asmdata.CurrAsmList,location,left.resultdef,u64inttype,false);
-              cg64.a_op64_loc_reg(current_asmdata.CurrAsmList,OP_NOT,OS_64,location,
-                joinreg64(location.register64.reglo,location.register64.reghi));
-           end
-         else
-          begin
-             secondpass(left);
-             hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,false);
-             location_copy(location,left.location);
-             if location.loc=LOC_CREGISTER then
-              location.register := cg.getintregister(current_asmdata.CurrAsmList,opsize);
-             { perform the NOT operation }
-             cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NOT,opsize,location.register,left.location.register);
           end;
           end;
       end;
       end;
 
 
-  procedure tm68kmoddivnode.call_rtl_divmod_reg_reg(denum,num:tregister;const name:string);
-    var
-      paraloc1,paraloc2 : tcgpara;
-      pd : tprocdef;
-    begin
-      pd:=search_system_proc(name);
-      paraloc1.init;
-      paraloc2.init;
-      paramanager.getintparaloc(pd,1,paraloc1);
-      paramanager.getintparaloc(pd,2,paraloc2);
-      cg.a_load_reg_cgpara(current_asmdata.CurrAsmList,OS_32,num,paraloc2);
-      cg.a_load_reg_cgpara(current_asmdata.CurrAsmList,OS_32,denum,paraloc1);
-      paramanager.freecgpara(current_asmdata.CurrAsmList,paraloc2);
-      paramanager.freecgpara(current_asmdata.CurrAsmList,paraloc1);
-      cg.alloccpuregisters(current_asmdata.CurrAsmList,R_ADDRESSREGISTER,paramanager.get_volatile_registers_address(pd.proccalloption));
-      cg.alloccpuregisters(current_asmdata.CurrAsmList,R_INTREGISTER,paramanager.get_volatile_registers_int(pd.proccalloption));
-      cg.a_call_name(current_asmdata.CurrAsmList,name,false);
-      cg.dealloccpuregisters(current_asmdata.CurrAsmList,R_INTREGISTER,paramanager.get_volatile_registers_int(pd.proccalloption));
-      cg.dealloccpuregisters(current_asmdata.CurrAsmList,R_ADDRESSREGISTER,paramanager.get_volatile_registers_address(pd.proccalloption));
-      cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_FUNCTION_RESULT_REG);
-      cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_32,OS_32,NR_FUNCTION_RESULT_REG,num);
-      paraloc2.done;
-      paraloc1.done;
-    end;
 
 
 {*****************************************************************************
 {*****************************************************************************
                                TM68KMODDIVNODE
                                TM68KMODDIVNODE
 *****************************************************************************}
 *****************************************************************************}
+
+  function tm68kmoddivnode.first_moddivint: tnode;
+    begin
+      if current_settings.cputype=cpu_MC68020 then
+        result:=nil
+      else
+        result:=inherited first_moddivint;
+    end;
+
+
   procedure tm68kmoddivnode.emit_div_reg_reg(signed: boolean;denum,num : tregister);
   procedure tm68kmoddivnode.emit_div_reg_reg(signed: boolean;denum,num : tregister);
    begin
    begin
      if current_settings.cputype=cpu_MC68020 then
      if current_settings.cputype=cpu_MC68020 then
@@ -185,13 +149,7 @@ implementation
            current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_DIVU,S_L,denum,num));
            current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_DIVU,S_L,denum,num));
        end
        end
      else
      else
-       begin
-         { On MC68000/68010/Coldfire we must pass through RTL routines }
-         if signed then
-           call_rtl_divmod_reg_reg(denum,num,'fpc_div_longint')
-         else
-           call_rtl_divmod_reg_reg(denum,num,'fpc_div_dword');
-       end;
+       InternalError(2014062801);
    end;
    end;
 
 
 
 
@@ -213,13 +171,7 @@ implementation
            current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_DIVUL,S_L,denum,num,tmpreg));
            current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_DIVUL,S_L,denum,num,tmpreg));
        end
        end
      else
      else
-       begin
-         { On MC68000/68010/coldfire we must pass through RTL routines }
-         if signed then
-           call_rtl_divmod_reg_reg(denum,num,'fpc_mod_longint')
-         else
-           call_rtl_divmod_reg_reg(denum,num,'fpc_mod_dword');
-       end;
+       InternalError(2014062802);
     end;
     end;
 
 
 
 

+ 36 - 19
compiler/m68k/n68kmem.pas

@@ -28,11 +28,12 @@ interface
     uses
     uses
       globtype,
       globtype,
       cgbase,cpuinfo,cpubase,
       cgbase,cpuinfo,cpubase,
+      symtype,
       node,nmem,ncgmem;
       node,nmem,ncgmem;
 
 
     type
     type
        t68kvecnode = class(tcgvecnode)
        t68kvecnode = class(tcgvecnode)
-          procedure update_reference_reg_mul(maybe_const_reg:tregister;l:aint);override;
+          procedure update_reference_reg_mul(maybe_const_reg: tregister;regsize: tdef; l: aint);override;
           //procedure pass_generate_code;override;
           //procedure pass_generate_code;override;
        end;
        end;
 
 
@@ -59,39 +60,53 @@ implementation
     { the live range of the LOC_CREGISTER will most likely overlap the   }
     { the live range of the LOC_CREGISTER will most likely overlap the   }
     { the live range of the target LOC_(C)REGISTER)                      }
     { the live range of the target LOC_(C)REGISTER)                      }
     { The passed register may be a LOC_CREGISTER as well.                }
     { The passed register may be a LOC_CREGISTER as well.                }
-    procedure t68kvecnode.update_reference_reg_mul(maybe_const_reg:tregister;l:aint);
+    procedure t68kvecnode.update_reference_reg_mul(maybe_const_reg: tregister;regsize: tdef; l: aint);
       var
       var
         hreg: tregister;
         hreg: tregister;
-        hreg2: tregister;
+        scaled: boolean;
       begin
       begin
+        scaled:=false;
+        //current_asmdata.CurrAsmList.concat(tai_comment.create(strpnew('updref: called')));
         if l<>1 then
         if l<>1 then
           begin
           begin
+            //current_asmdata.CurrAsmList.concat(tai_comment.create(strpnew('updref: l <> 1')));
             hreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
             hreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
             { if we have a possibility, setup a scalefactor instead of the MUL }
             { if we have a possibility, setup a scalefactor instead of the MUL }
-            if (location.reference.base=NR_NO) or (location.reference.index<>NR_NO) or
+            if (location.reference.index<>NR_NO) or
+               (current_settings.cputype in [cpu_mc68000]) or
                ((current_settings.cputype in cpu_coldfire) and not (l in [2,4])) or
                ((current_settings.cputype in cpu_coldfire) and not (l in [2,4])) or
                not (l in [2,4,8]) then
                not (l in [2,4,8]) then
-              cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_IMUL,OS_ADDR,l,maybe_const_reg,hreg)
+              begin
+                //current_asmdata.CurrAsmList.concat(tai_comment.create(strpnew('updref: mul')));
+                cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_IMUL,OS_ADDR,l,maybe_const_reg,hreg);
+              end
             else
             else
               begin
               begin
+                //current_asmdata.CurrAsmList.concat(tai_comment.create(strpnew('updref: scale')));
                 cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,maybe_const_reg,hreg);
                 cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,maybe_const_reg,hreg);
-                location.reference.scalefactor:=l;
+                scaled:=true;
               end;
               end;
-            { prefer an address reg, if we will be a base, otherwise for indexes
-              a data register is better choice }
-            if location.reference.base=NR_NO then
-              begin
-                hreg2:=cg.getaddressregister(current_asmdata.CurrAsmList);
-                cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,hreg,hreg2);
-                maybe_const_reg:=hreg2;
-              end
-            else
-              maybe_const_reg:=hreg;
+            maybe_const_reg:=hreg;
           end;
           end;
-        if location.reference.base=NR_NO then
-          location.reference.base:=maybe_const_reg
+
+        if (location.reference.base=NR_NO) and not (scaled) then
+          begin
+           { prefer an address reg, if we will be a base, for indexes any register works }
+            if isintregister(maybe_const_reg) then
+              begin
+                //current_asmdata.CurrAsmList.concat(tai_comment.create(strpnew('updref: copytoa')));
+                hreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
+                cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,maybe_const_reg,hreg);
+                maybe_const_reg:=hreg;
+              end;
+            location.reference.base:=maybe_const_reg;
+          end
         else if location.reference.index=NR_NO then
         else if location.reference.index=NR_NO then
-          location.reference.index:=maybe_const_reg
+          begin
+            location.reference.index:=maybe_const_reg;
+            if (scaled) then
+              location.reference.scalefactor:=l;
+          end
         else
         else
           begin
           begin
             hreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
             hreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
@@ -99,6 +114,8 @@ implementation
             reference_reset_base(location.reference,hreg,0,location.reference.alignment);
             reference_reset_base(location.reference,hreg,0,location.reference.alignment);
             { insert new index register }
             { insert new index register }
             location.reference.index:=maybe_const_reg;
             location.reference.index:=maybe_const_reg;
+            if (scaled) then
+              location.reference.scalefactor:=l;
           end;
           end;
           { update alignment }
           { update alignment }
           if (location.reference.alignment=0) then
           if (location.reference.alignment=0) then

+ 352 - 4
compiler/mips/aoptcpu.pas

@@ -32,14 +32,19 @@ unit aoptcpu;
 
 
     Type
     Type
       TCpuAsmOptimizer = class(TAsmOptimizer)
       TCpuAsmOptimizer = class(TAsmOptimizer)
+        function GetNextInstructionUsingReg(Current: tai;
+          var Next: tai; reg: TRegister): Boolean;
+        function RegUsedAfterInstruction(reg: Tregister; p: tai;
+          var AllUsedRegs: TAllUsedRegs): Boolean;
         function TryRemoveMov(var p: tai; opcode: TAsmOp): boolean;
         function TryRemoveMov(var p: tai; opcode: TAsmOp): boolean;
         function PeepHoleOptPass1Cpu(var p: tai): boolean; override;
         function PeepHoleOptPass1Cpu(var p: tai): boolean; override;
+        procedure PeepHoleOptPass2; override;
       End;
       End;
 
 
   Implementation
   Implementation
 
 
      uses
      uses
-       aasmcpu;
+       globals,aasmbase,aasmcpu,cpuinfo,verbose;
 
 
 
 
   function MatchInstruction(const instr: tai; const op: TAsmOp): boolean;
   function MatchInstruction(const instr: tai; const op: TAsmOp): boolean;
@@ -65,6 +70,137 @@ unit aoptcpu;
     end;
     end;
 
 
 
 
+  function regLoadedWithNewValue(reg: tregister; hp: tai): boolean;
+    var
+      p: taicpu;
+    begin
+      p:=taicpu(hp);
+      result:=false;
+      if not ((assigned(hp)) and (hp.typ=ait_instruction)) then
+        exit;
+
+      case p.opcode of
+        { These instructions do not write into a register at all }
+        A_NOP,
+        A_C_EQ_D,A_C_EQ_S,A_C_LE_D,A_C_LE_S,A_C_LT_D,A_C_LT_S,
+        A_BA,A_BC,
+        A_SB,A_SH,A_SW,A_SWL,A_SWR,A_SWC1,A_SDC1:
+          exit;
+      end;
+
+      result:=(p.ops>0) and (p.oper[0]^.typ=top_reg) and
+        (p.oper[0]^.reg=reg);
+    end;
+
+
+  function CanBeCMOV(p: tai): boolean;
+    begin
+      result:=assigned(p) and (p.typ=ait_instruction) and
+        (taicpu(p).opcode in [A_MOV_D,A_MOV_S,A_MOVE]);
+    end;
+
+
+  procedure ChangeToCMOV(p: taicpu; cond: tasmcond; reg: tregister);
+    begin
+      case cond of
+        C_COP1TRUE:
+          case p.opcode of
+            A_MOV_D: p.opcode:=A_MOVT_D;
+            A_MOV_S: p.opcode:=A_MOVT_S;
+            A_MOVE:  p.opcode:=A_MOVT;
+          else
+            InternalError(2014061701);
+          end;
+        C_COP1FALSE:
+          case p.opcode of
+            A_MOV_D: p.opcode:=A_MOVF_D;
+            A_MOV_S: p.opcode:=A_MOVF_S;
+            A_MOVE:  p.opcode:=A_MOVF;
+          else
+            InternalError(2014061702);
+          end;
+        C_EQ:
+          case p.opcode of
+            A_MOV_D: p.opcode:=A_MOVZ_D;
+            A_MOV_S: p.opcode:=A_MOVZ_S;
+            A_MOVE:  p.opcode:=A_MOVZ;
+          else
+            InternalError(2014061703);
+          end;
+        C_NE:
+          case p.opcode of
+            A_MOV_D: p.opcode:=A_MOVN_D;
+            A_MOV_S: p.opcode:=A_MOVN_S;
+            A_MOVE:  p.opcode:=A_MOVN;
+          else
+            InternalError(2014061704);
+          end;
+      else
+        InternalError(2014061705);
+      end;
+      p.ops:=3;
+      p.loadreg(2,reg);
+    end;
+
+
+  function instructionLoadsFromReg(const reg: TRegister; const hp: tai): boolean;
+    var
+      p: taicpu;
+      i: longint;
+    begin
+      result:=false;
+      if not (assigned(hp) and (hp.typ=ait_instruction)) then
+        exit;
+      p:=taicpu(hp);
+
+      i:=1;
+      while(i<p.ops) do
+        begin
+          case p.oper[I]^.typ of
+            top_reg:
+              result:=(p.oper[I]^.reg=reg) and (I<2);
+            top_ref:
+              result:=
+                (p.oper[I]^.ref^.base=reg) or
+                (p.oper[I]^.ref^.index=reg);
+          end;
+          if result then exit; {Bailout if we found something}
+          Inc(I);
+        end;
+    end;
+
+
+  function TCpuAsmOptimizer.GetNextInstructionUsingReg(Current: tai;
+    var Next: tai; reg: TRegister): Boolean;
+    begin
+      Next:=Current;
+      repeat
+        Result:=GetNextInstruction(Next,Next);
+      until {not(cs_opt_level3 in current_settings.optimizerswitches) or} not(Result) or (Next.typ<>ait_instruction) or (RegInInstruction(reg,Next)) or
+        (is_calljmp(taicpu(Next).opcode));
+      if Result and is_calljmp(taicpu(next).opcode) then
+        begin
+          result:=false;
+          next:=nil;
+        end;
+    end;
+
+
+  function TCpuAsmOptimizer.RegUsedAfterInstruction(reg: Tregister; p: tai;
+    var AllUsedRegs: TAllUsedRegs): Boolean;
+    begin
+      AllUsedRegs[getregtype(reg)].Update(tai(p.Next),true);
+      RegUsedAfterInstruction :=
+        AllUsedRegs[getregtype(reg)].IsUsed(reg) and
+        not(regLoadedWithNewValue(reg,p)) and
+        (
+          not(GetNextInstruction(p,p)) or
+          instructionLoadsFromReg(reg,p) or
+          not(regLoadedWithNewValue(reg,p))
+        );
+    end;
+
+
   function TCpuAsmOptimizer.TryRemoveMov(var p: tai; opcode: TAsmOp): boolean;
   function TCpuAsmOptimizer.TryRemoveMov(var p: tai; opcode: TAsmOp): boolean;
     var
     var
       next,hp1: tai;
       next,hp1: tai;
@@ -79,9 +215,13 @@ unit aoptcpu;
         opcode may be A_MOVE, A_MOV_s, A_MOV_d, etc.
         opcode may be A_MOVE, A_MOV_s, A_MOV_d, etc.
       }
       }
       result:=false;
       result:=false;
-      if GetNextInstruction(p,next) and
+      if (taicpu(p).ops>1) and
+         GetNextInstructionUsingReg(p,next,taicpu(p).oper[0]^.reg) and
          MatchInstruction(next,opcode) and
          MatchInstruction(next,opcode) and
-         MatchOperand(taicpu(next).oper[1]^,taicpu(p).oper[0]^.reg) then
+         MatchOperand(taicpu(next).oper[1]^,taicpu(p).oper[0]^.reg) and
+         { the destination register of mov cannot be used between p and next }
+         (not RegUsedBetween(taicpu(next).oper[0]^.reg,p,next)) then
+
         begin
         begin
           dealloc:=FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.Next));
           dealloc:=FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.Next));
           if assigned(dealloc) then
           if assigned(dealloc) then
@@ -124,12 +264,49 @@ unit aoptcpu;
   function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
   function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
     var
     var
       next,next2: tai;
       next,next2: tai;
+      TmpUsedRegs: TAllUsedRegs;
     begin
     begin
       result:=false;
       result:=false;
       case p.typ of
       case p.typ of
         ait_instruction:
         ait_instruction:
           begin
           begin
             case taicpu(p).opcode of
             case taicpu(p).opcode of
+              A_SLL:
+                begin
+                  { if this is a sign extension... }
+                  if (taicpu(p).oper[2]^.typ=top_const) and
+                    GetNextInstruction(p,next) and
+                    MatchInstruction(next,A_SRA) and
+                    IsSameReg(taicpu(p),taicpu(next)) and
+                    (taicpu(next).oper[2]^.typ=top_const) and
+                    (taicpu(next).oper[2]^.val=taicpu(p).oper[2]^.val) and
+                    (taicpu(next).oper[2]^.val=16) and
+                    { ...followed by 16-bit store (possibly with PIC simplification, etc. in between) }
+                    GetNextInstructionUsingReg(next,next2,taicpu(p).oper[0]^.reg) and
+                    MatchInstruction(next2,A_SH) and
+                    (taicpu(next2).oper[0]^.typ=top_reg) and
+                    (taicpu(next2).oper[0]^.reg=taicpu(p).oper[0]^.reg) and
+                    { the initial register may not be reused }
+                    (not RegUsedBetween(taicpu(p).oper[1]^.reg,next,next2)) then
+                    begin
+                      CopyUsedRegs(TmpUsedRegs);
+                      UpdateUsedRegs(TmpUsedRegs, tai(p.next));
+                      UpdateUsedRegs(TmpUsedRegs, tai(next.next));
+                      if not RegUsedAfterInstruction(taicpu(p).oper[0]^.reg,next2,TmpUsedRegs) then
+                        begin
+                          taicpu(next2).loadreg(0,taicpu(p).oper[1]^.reg);
+                          asml.remove(p);
+                          asml.remove(next);
+                          p.free;
+                          next.free;
+                          p:=next2;
+                        end;
+                      ReleaseUsedRegs(TmpUsedRegs);
+                    end
+                  else
+                    TryRemoveMov(p,A_MOVE);
+                end;
+
               A_SRL:
               A_SRL:
                 begin
                 begin
                   { Remove 'andi' in sequences
                   { Remove 'andi' in sequences
@@ -185,6 +362,25 @@ unit aoptcpu;
                       next.free;
                       next.free;
                       next2.free;
                       next2.free;
                     end
                     end
+                  { Remove zero extension if register is used only for byte/word memory store }
+                  else if (taicpu(p).oper[2]^.typ=top_const) and
+                    GetNextInstruction(p,next) and
+                    ((taicpu(p).oper[2]^.val=255) and MatchInstruction(next,A_SB)) or
+                    ((taicpu(p).oper[2]^.val=65535) and MatchInstruction(next,A_SH)) and
+                    (taicpu(next).oper[0]^.typ=top_reg) and
+                    (taicpu(next).oper[0]^.reg=taicpu(p).oper[0]^.reg) then
+                    begin
+                      CopyUsedRegs(TmpUsedRegs);
+                      UpdateUsedRegs(TmpUsedRegs, tai(p.next));
+                      if not RegUsedAfterInstruction(taicpu(p).oper[0]^.reg,next,TmpUsedRegs) then
+                        begin
+                          taicpu(next).loadreg(0,taicpu(p).oper[1]^.reg);
+                          asml.remove(p);
+                          p.free;
+                          p:=next;
+                        end;
+                      ReleaseUsedRegs(TmpUsedRegs);
+                    end
                   else
                   else
                     TryRemoveMov(p,A_MOVE);
                     TryRemoveMov(p,A_MOVE);
                 end;
                 end;
@@ -194,7 +390,7 @@ unit aoptcpu;
               A_SUB,A_SUBU,
               A_SUB,A_SUBU,
               A_SRA,A_SRAV,
               A_SRA,A_SRAV,
               A_SRLV,
               A_SRLV,
-              A_SLL,A_SLLV,
+              A_SLLV,
               A_AND,A_OR,A_XOR,A_ORI,A_XORI:
               A_AND,A_OR,A_XOR,A_ORI,A_XORI:
                 TryRemoveMov(p,A_MOVE);
                 TryRemoveMov(p,A_MOVE);
 
 
@@ -212,6 +408,158 @@ unit aoptcpu;
       end;
       end;
     end;
     end;
 
 
+
+  procedure TCpuAsmOptimizer.PeepHoleOptPass2;
+    var
+      p: tai;
+      l: longint;
+      hp1,hp2,hp3: tai;
+      condition: tasmcond;
+      condreg: tregister;
+    begin
+      { Currently, everything below is mips4+ }
+      if (current_settings.cputype<cpu_mips4) then
+        exit;
+      p:=BlockStart;
+      ClearUsedRegs;
+      while (p<>BlockEnd) Do
+        begin
+          UpdateUsedRegs(tai(p.next));
+          case p.typ of
+            ait_instruction:
+              begin
+                case taicpu(p).opcode of
+                  A_BC:
+                    begin
+                      condreg:=NR_NO;
+                      if (taicpu(p).condition in [C_COP1TRUE,C_COP1FALSE]) then
+                        { TODO: must be taken from "p" if/when codegen makes use of multiple %fcc }
+                        condreg:=NR_FCC0
+                      else if (taicpu(p).condition in [C_EQ,C_NE]) then
+                        begin
+                          if (taicpu(p).oper[0]^.reg=NR_R0) then
+                            condreg:=taicpu(p).oper[1]^.reg
+                          else if (taicpu(p).oper[1]^.reg=NR_R0) then
+                            condreg:=taicpu(p).oper[0]^.reg
+                        end;
+
+                      if (condreg<>NR_NO) then
+                        begin
+                          { check for
+                              bCC   xxx
+                              <several movs>
+                          xxx:
+                          }
+                          l:=0;
+                          GetNextInstruction(p, hp1);
+                          while CanBeCMOV(hp1) do       // CanBeCMOV returns False for nil or labels
+                            begin
+                              inc(l);
+                              GetNextInstruction(hp1,hp1);
+                            end;
+                          if assigned(hp1) then
+                            begin
+                              if FindLabel(tasmlabel(taicpu(p).oper[taicpu(p).ops-1]^.ref^.symbol),hp1) then
+                                begin
+                                  if (l<=4) and (l>0) then
+                                    begin
+                                      condition:=inverse_cond(taicpu(p).condition);
+                                      hp2:=p;
+                                      GetNextInstruction(p,hp1);
+                                      p:=hp1;
+                                      repeat
+                                        ChangeToCMOV(taicpu(hp1),condition,condreg);
+                                        GetNextInstruction(hp1,hp1);
+                                      until not CanBeCMOV(hp1);
+                                      { wait with removing else GetNextInstruction could
+                                        ignore the label if it was the only usage in the
+                                        jump moved away }
+                                      tasmlabel(taicpu(hp2).oper[taicpu(hp2).ops-1]^.ref^.symbol).decrefs;
+                                      RemoveDelaySlot(hp2);
+                                      asml.remove(hp2);
+                                      hp2.free;
+                                      continue;
+                                    end;
+                                end
+                              else
+                                begin
+                                  { check further for
+                                        bCC   xxx
+                                        <several movs 1>
+                                        b     yyy
+                                    xxx:
+                                        <several movs 2>
+                                    yyy:
+                                  }
+                                  { hp2 points to jmp yyy }
+                                  hp2:=hp1;
+                                  { skip hp1 to xxx }
+                                  GetNextInstruction(hp1, hp1);
+                                  if assigned(hp2) and
+                                    assigned(hp1) and
+                                    (l<=3) and
+                                    (hp2.typ=ait_instruction) and
+                                    (taicpu(hp2).opcode=A_BA) and
+                                    { real label and jump, no further references to the
+                                      label are allowed }
+                                    (tasmlabel(taicpu(p).oper[taicpu(p).ops-1]^.ref^.symbol).getrefs<=2) and
+                                    FindLabel(tasmlabel(taicpu(p).oper[taicpu(p).ops-1]^.ref^.symbol),hp1) then
+                                    begin
+                                      l:=0;
+                                      { skip hp1 to <several moves 2> }
+                                      GetNextInstruction(hp1, hp1);
+                                      while CanBeCMOV(hp1) do
+                                        begin
+                                          inc(l);
+                                          GetNextInstruction(hp1, hp1);
+                                        end;
+                                      { hp1 points to yyy: }
+                                      if assigned(hp1) and
+                                        FindLabel(tasmlabel(taicpu(hp2).oper[taicpu(hp2).ops-1]^.ref^.symbol),hp1) then
+                                        begin
+                                          condition:=inverse_cond(taicpu(p).condition);
+                                          GetNextInstruction(p,hp1);
+                                          hp3:=p;
+                                          p:=hp1;
+                                          repeat
+                                            ChangeToCMOV(taicpu(hp1),condition,condreg);
+                                            GetNextInstruction(hp1,hp1);
+                                          until not CanBeCMOV(hp1);
+                                          { hp2 is still at b yyy }
+                                          GetNextInstruction(hp2,hp1);
+                                          { hp2 is now at xxx: }
+                                          condition:=inverse_cond(condition);
+                                          GetNextInstruction(hp1,hp1);
+                                          { hp1 is now at <several movs 2> }
+                                          repeat
+                                            ChangeToCMOV(taicpu(hp1),condition,condreg);
+                                            GetNextInstruction(hp1,hp1);
+                                          until not CanBeCMOV(hp1);
+                                          { remove bCC }
+                                          tasmlabel(taicpu(hp3).oper[taicpu(hp3).ops-1]^.ref^.symbol).decrefs;
+                                          RemoveDelaySlot(hp3);
+                                          asml.remove(hp3);
+                                          hp3.free;
+                                          { remove jmp }
+                                          tasmlabel(taicpu(hp2).oper[taicpu(hp2).ops-1]^.ref^.symbol).decrefs;
+                                          RemoveDelaySlot(hp2);
+                                          asml.remove(hp2);
+                                          hp2.free;
+                                          continue;
+                                        end;
+                                    end;
+                                end;
+                            end;
+                        end;
+                    end;
+                end;
+              end;
+          end;
+          UpdateUsedRegs(p);
+          p:=tai(p.next);
+        end;
+    end;
+
 begin
 begin
   casmoptimizer:=TCpuAsmOptimizer;
   casmoptimizer:=TCpuAsmOptimizer;
 end.
 end.

+ 24 - 1
compiler/mips/cgcpu.pas

@@ -76,6 +76,7 @@ type
     procedure g_flags2reg(list: tasmlist; size: TCgSize; const f: TResFlags; reg: tregister); override;
     procedure g_flags2reg(list: tasmlist; size: TCgSize; const f: TResFlags; reg: tregister); override;
     procedure a_jmp_always(List: tasmlist; l: TAsmLabel); override;
     procedure a_jmp_always(List: tasmlist; l: TAsmLabel); override;
     procedure a_jmp_name(list: tasmlist; const s: string); override;
     procedure a_jmp_name(list: tasmlist; const s: string); override;
+    procedure a_mul_reg_reg_pair(list: tasmlist; size: tcgsize; src1,src2,dstlo,dsthi: tregister); override;
     procedure g_overflowCheck(List: tasmlist; const Loc: TLocation; def: TDef); override;
     procedure g_overflowCheck(List: tasmlist; const Loc: TLocation; def: TDef); override;
     procedure g_overflowCheck_loc(List: tasmlist; const Loc: TLocation; def: TDef; ovloc: tlocation); override;
     procedure g_overflowCheck_loc(List: tasmlist; const Loc: TLocation; def: TDef; ovloc: tlocation); override;
     procedure g_proc_entry(list: tasmlist; localsize: longint; nostackframe: boolean); override;
     procedure g_proc_entry(list: tasmlist; localsize: longint; nostackframe: boolean); override;
@@ -1154,6 +1155,24 @@ procedure TCGMIPS.g_flags2reg(list: tasmlist; size: tcgsize; const f: tresflags;
   end;
   end;
 
 
 
 
+procedure TCGMIPS.a_mul_reg_reg_pair(list: tasmlist; size: tcgsize; src1,src2,dstlo,dsthi: tregister);
+var
+  asmop: tasmop;
+begin
+  case size of
+    OS_32:  asmop:=A_MULTU;
+    OS_S32: asmop:=A_MULT;
+  else
+    InternalError(2014060802);
+  end;
+  list.concat(taicpu.op_reg_reg(asmop,src1,src2));
+  if (dstlo<>NR_NO) then
+    list.concat(taicpu.op_reg(A_MFLO,dstlo));
+  if (dsthi<>NR_NO) then
+    list.concat(taicpu.op_reg(A_MFHI,dsthi));
+end;
+
+
 procedure TCGMIPS.g_overflowCheck(List: tasmlist; const Loc: TLocation; def: TDef);
 procedure TCGMIPS.g_overflowCheck(List: tasmlist; const Loc: TLocation; def: TDef);
 begin
 begin
 // this is an empty procedure
 // this is an empty procedure
@@ -1199,7 +1218,11 @@ begin
   a_reg_alloc(list,NR_STACK_POINTER_REG);
   a_reg_alloc(list,NR_STACK_POINTER_REG);
 
 
   if nostackframe then
   if nostackframe then
-    exit;
+    begin
+      list.concat(taicpu.op_none(A_P_SET_NOMIPS16));
+      list.concat(taicpu.op_none(A_P_SET_NOREORDER));
+      exit;
+    end;
 
 
   if (pi_needs_stackframe in current_procinfo.flags) then
   if (pi_needs_stackframe in current_procinfo.flags) then
     a_reg_alloc(list,NR_FRAME_POINTER_REG);
     a_reg_alloc(list,NR_FRAME_POINTER_REG);

+ 11 - 1
compiler/mips/cpubase.pas

@@ -377,10 +377,20 @@ unit cpubase;
     function std_regname(r:Tregister):string;
     function std_regname(r:Tregister):string;
       var
       var
         p : tregisterindex;
         p : tregisterindex;
+        hr : tregister;
       begin
       begin
-        p:=findreg_by_number_table(r,regnumber_index);
+        hr:=r;
+        case getsubreg(hr) of
+          R_SUBFD:
+            setsubreg(hr, R_SUBFS);
+          R_SUBL, R_SUBW, R_SUBD, R_SUBQ:
+            setsubreg(hr, R_SUBD);
+        end;
+        p:=findreg_by_number_table(hr,regnumber_index);
         if p<>0 then
         if p<>0 then
           result:=std_regname_table[p]
           result:=std_regname_table[p]
+        else if getregtype(r)=R_SPECIALREGISTER then
+          result:=tostr(getsupreg(r))
         else
         else
           result:=generic_regname(r);
           result:=generic_regname(r);
       end;
       end;

+ 1 - 19
compiler/mips/cpugas.pas

@@ -55,30 +55,12 @@ unit cpugas;
       cutils, systems, cpuinfo,
       cutils, systems, cpuinfo,
       globals, verbose, itcpugas, cgbase, cgutils;
       globals, verbose, itcpugas, cgbase, cgutils;
 
 
-    function gas_std_regname(r:Tregister):string;
-      var
-        hr: tregister;
-      begin
-        { Double uses the same table as single }
-        hr := r;
-        case getsubreg(hr) of
-          R_SUBFD:
-            setsubreg(hr, R_SUBFS);
-          R_SUBL, R_SUBW, R_SUBD, R_SUBQ:
-           setsubreg(hr, R_SUBD);
-        end;
-        if getregtype(r)=R_SPECIALREGISTER then
-          result:=tostr(getsupreg(r))
-        else
-          result:=std_regname(hr);
-      end;
-
 
 
       function asm_regname(reg : TRegister) : string;
       function asm_regname(reg : TRegister) : string;
 
 
         begin
         begin
           if use_std_regnames then
           if use_std_regnames then
-            asm_regname:='$'+gas_std_regname(reg)
+            asm_regname:='$'+std_regname(reg)
           else
           else
             asm_regname:=gas_regname(reg);
             asm_regname:=gas_regname(reg);
         end;
         end;

+ 1 - 1
compiler/mips/cpuinfo.pas

@@ -209,7 +209,7 @@ const
    supported_optimizerswitches = [cs_opt_regvar,cs_opt_loopunroll,cs_opt_nodecse,
    supported_optimizerswitches = [cs_opt_regvar,cs_opt_loopunroll,cs_opt_nodecse,
                                   cs_opt_reorder_fields,cs_opt_fastmath];
                                   cs_opt_reorder_fields,cs_opt_fastmath];
 
 
-   level1optimizerswitches = [cs_opt_level1];
+   level1optimizerswitches = genericlevel1optimizerswitches;
    level2optimizerswitches = level1optimizerswitches + [cs_opt_regvar,cs_opt_stackframe,cs_opt_nodecse];
    level2optimizerswitches = level1optimizerswitches + [cs_opt_regvar,cs_opt_stackframe,cs_opt_nodecse];
    level3optimizerswitches = level2optimizerswitches + [cs_opt_loopunroll];
    level3optimizerswitches = level2optimizerswitches + [cs_opt_loopunroll];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];

+ 12 - 9
compiler/mips/mipsreg.dat

@@ -72,12 +72,15 @@ F29,$02,$06,$1D,f29,$f29,61,61
 F30,$02,$06,$1E,f30,$f30,62,62
 F30,$02,$06,$1E,f30,$f30,62,62
 F31,$02,$06,$1F,f31,$f31,63,63
 F31,$02,$06,$1F,f31,$f31,63,63
 
 
-PC,$05,$00,$00,PC,pc,-1,-1
-HI,$05,$00,$01,HI,hi,68,68
-LO,$05,$00,$02,LO,lo,69,69
-CR,$05,$00,$03,CR,cr,70,70
-FCR0,$05,$00,$04,fcr0,fcr0,71,71
-FCR25,$05,$00,$05,fcr25,fcr25,72,72
-FCR26,$05,$00,$06,fcr26,fcr26,73,73
-FCR28,$05,$00,$07,fcr28,fcr28,74,74
-FCSR,$05,$00,$08,fcsr,fcsr,75,75
+; Range 0..31 of R_SPECIALREGISTER is used without symbolic names
+; and actual register they refer to depends on instruction.
+
+; mips4+ floating-point condition code registers (1-bit)
+FCC0,$05,$00,$20,fcc0,$fcc0,-1,-1
+FCC1,$05,$00,$21,fcc1,$fcc1,-1,-1
+FCC2,$05,$00,$22,fcc2,$fcc2,-1,-1
+FCC3,$05,$00,$23,fcc3,$fcc3,-1,-1
+FCC4,$05,$00,$24,fcc4,$fcc4,-1,-1
+FCC5,$05,$00,$25,fcc5,$fcc5,-1,-1
+FCC6,$05,$00,$26,fcc6,$fcc6,-1,-1
+FCC7,$05,$00,$27,fcc7,$fcc7,-1,-1

+ 14 - 9
compiler/mips/ncpumat.pas

@@ -87,16 +87,21 @@ begin
   numerator := left.location.Register;
   numerator := left.location.Register;
 
 
   if (nodetype = divn) and
   if (nodetype = divn) and
-    (right.nodetype = ordconstn) and
-    ispowerof2(tordconstnode(right).Value.svalue, power) then
+    (right.nodetype = ordconstn) then
   begin
   begin
-    tmpreg := cg.GetIntRegister(current_asmdata.CurrAsmList, OS_INT);
-    cg.a_op_const_reg_reg(current_asmdata.CurrAsmList, OP_SAR, OS_INT, 31, numerator, tmpreg);
-    { if signed, tmpreg=right value-1, otherwise 0 }
-    cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_AND, OS_INT, tordconstnode(right).Value.svalue - 1, tmpreg);
-    { add left value }
-    cg.a_op_reg_reg(current_asmdata.CurrAsmList, OP_ADD, OS_INT, numerator, tmpreg);
-    cg.a_op_const_reg_reg(current_asmdata.CurrAsmList, OP_SAR, OS_INT, aword(power), tmpreg, location.register);
+    if ispowerof2(tordconstnode(right).Value.svalue, power) then
+    begin
+      tmpreg := cg.GetIntRegister(current_asmdata.CurrAsmList, OS_INT);
+      cg.a_op_const_reg_reg(current_asmdata.CurrAsmList, OP_SAR, OS_INT, 31, numerator, tmpreg);
+      { if signed, tmpreg=right value-1, otherwise 0 }
+      cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_AND, OS_INT, tordconstnode(right).Value.svalue - 1, tmpreg);
+      { add left value }
+      cg.a_op_reg_reg(current_asmdata.CurrAsmList, OP_ADD, OS_INT, numerator, tmpreg);
+      cg.a_op_const_reg_reg(current_asmdata.CurrAsmList, OP_SAR, OS_INT, aword(power), tmpreg, location.register);
+    end
+    else
+      cg.g_div_const_reg_reg(current_asmdata.CurrAsmList,def_cgsize(resultdef),
+        tordconstnode(right).value.svalue,numerator,location.register);
   end
   end
   else
   else
   begin
   begin

+ 16 - 0
compiler/mips/opcode.inc

@@ -189,4 +189,20 @@ A_MTC0,
 A_SDBBP,
 A_SDBBP,
 A_WRPGPR,
 A_WRPGPR,
 A_ERET,
 A_ERET,
+A_MTHC1,
+A_MFHC1,
+A_SEB,
+A_SEH,
+A_MOVT,
+A_MOVF,
+A_MOVT_S,
+A_MOVF_S,
+A_MOVT_D,
+A_MOVF_D,
+A_MOVN,
+A_MOVZ,
+A_MOVN_S,
+A_MOVZ_S,
+A_MOVN_D,
+A_MOVZ_D,
 A_END_DEF
 A_END_DEF

+ 5 - 1
compiler/mips/racpugas.pas

@@ -566,8 +566,12 @@ Interface
             condition := actcondition;
             condition := actcondition;
             if is_calljmp(opcode) then
             if is_calljmp(opcode) then
               ConvertCalljmp(instr);
               ConvertCalljmp(instr);
-            if (opcode in [A_MTC0,A_MFC0]) then
+            { Coprocessor-related instructions have operands referring to both coprocessor registers
+              and general-purpose ones. The input representation "$<number>" is the same for both,
+              but symbolic names must not be used for non-GPRs on output. }
+            if (opcode in [A_MTC0,A_MFC0,A_CFC1,A_CTC1{,A_CFC2,A_CTC2}]) then
               begin
               begin
+                { operands are 1-based here }
                 if (ops<2) or (operands[2].opr.typ<>OPR_REGISTER) then
                 if (ops<2) or (operands[2].opr.typ<>OPR_REGISTER) then
                   message(asmr_e_syn_operand);
                   message(asmr_e_syn_operand);
                 operands[2].opr.reg:=newreg(R_SPECIALREGISTER,getsupreg(operands[2].opr.reg),R_SUBNONE);
                 operands[2].opr.reg:=newreg(R_SPECIALREGISTER,getsupreg(operands[2].opr.reg),R_SUBNONE);

+ 0 - 31
compiler/mips/rgcpu.pas

@@ -34,7 +34,6 @@ unit rgcpu;
 
 
     type
     type
       trgcpu=class(trgobj)
       trgcpu=class(trgobj)
-        procedure add_constraints(reg:tregister);override;
         function get_spill_subreg(r : tregister) : tsubregister;override;
         function get_spill_subreg(r : tregister) : tsubregister;override;
         procedure do_spill_read(list: TAsmList; pos: tai; const spilltemp: treference; tempreg: tregister; orgsupreg: tsuperregister); override;
         procedure do_spill_read(list: TAsmList; pos: tai; const spilltemp: treference; tempreg: tregister; orgsupreg: tsuperregister); override;
         procedure do_spill_written(list: TAsmList; pos: tai; const spilltemp: treference; tempreg: tregister; orgsupreg: tsuperregister); override;
         procedure do_spill_written(list: TAsmList; pos: tai; const spilltemp: treference; tempreg: tregister; orgsupreg: tsuperregister); override;
@@ -52,36 +51,6 @@ implementation
       verbose,cutils,
       verbose,cutils,
       cgobj;
       cgobj;
 
 
-    procedure trgcpu.add_constraints(reg:tregister);
-      var
-        supreg,i : Tsuperregister;
-      begin
-        case getsubreg(reg) of
-          { Let 64bit floats conflict with all odd float regs }
-          R_SUBFD:
-            begin
-              supreg:=getsupreg(reg);
-              i:=RS_F1;
-              while (i<=RS_F31) do
-                begin
-                  add_edge(supreg,i);
-                  inc(i,2);
-                end;
-            end;
-          { Let 64bit ints conflict with all odd int regs }
-          R_SUBQ:
-            begin
-              supreg:=getsupreg(reg);
-              i:=RS_R1;
-              while (i<=RS_R31) do
-                begin
-                  add_edge(supreg,i);
-                  inc(i,2);
-                end;
-            end;
-        end;
-      end;
-
 
 
     function trgcpu.get_spill_subreg(r : tregister) : tsubregister;
     function trgcpu.get_spill_subreg(r : tregister) : tsubregister;
       begin
       begin

+ 8 - 9
compiler/mips/rmipscon.inc

@@ -64,12 +64,11 @@ NR_F28 = tregister($0206001C);
 NR_F29 = tregister($0206001D);
 NR_F29 = tregister($0206001D);
 NR_F30 = tregister($0206001E);
 NR_F30 = tregister($0206001E);
 NR_F31 = tregister($0206001F);
 NR_F31 = tregister($0206001F);
-NR_PC = tregister($05000000);
-NR_HI = tregister($05000001);
-NR_LO = tregister($05000002);
-NR_CR = tregister($05000003);
-NR_FCR0 = tregister($05000004);
-NR_FCR25 = tregister($05000005);
-NR_FCR26 = tregister($05000006);
-NR_FCR28 = tregister($05000007);
-NR_FCSR = tregister($05000008);
+NR_FCC0 = tregister($05000020);
+NR_FCC1 = tregister($05000021);
+NR_FCC2 = tregister($05000022);
+NR_FCC3 = tregister($05000023);
+NR_FCC4 = tregister($05000024);
+NR_FCC5 = tregister($05000025);
+NR_FCC6 = tregister($05000026);
+NR_FCC7 = tregister($05000027);

+ 7 - 8
compiler/mips/rmipsdwf.inc

@@ -65,11 +65,10 @@
 62,
 62,
 63,
 63,
 -1,
 -1,
-68,
-69,
-70,
-71,
-72,
-73,
-74,
-75
+-1,
+-1,
+-1,
+-1,
+-1,
+-1,
+-1

+ 8 - 9
compiler/mips/rmipsgas.inc

@@ -64,12 +64,11 @@
 '$f29',
 '$f29',
 '$f30',
 '$f30',
 '$f31',
 '$f31',
-'pc',
-'hi',
-'lo',
-'cr',
-'fcr0',
-'fcr25',
-'fcr26',
-'fcr28',
-'fcsr'
+'$fcc0',
+'$fcc1',
+'$fcc2',
+'$fcc3',
+'$fcc4',
+'$fcc5',
+'$fcc6',
+'$fcc7'

+ 4 - 5
compiler/mips/rmipsgri.inc

@@ -63,13 +63,12 @@
 40,
 40,
 41,
 41,
 42,
 42,
-0,
+65,
+66,
+67,
 68,
 68,
 69,
 69,
 70,
 70,
 71,
 71,
 72,
 72,
-73,
-66,
-67,
-65
+0

+ 1 - 1
compiler/mips/rmipsnor.inc

@@ -1,2 +1,2 @@
 { don't edit, this file is generated from mipsreg.dat }
 { don't edit, this file is generated from mipsreg.dat }
-74
+73

+ 8 - 9
compiler/mips/rmipsnum.inc

@@ -64,12 +64,11 @@ NR_F28,
 NR_F29,
 NR_F29,
 NR_F30,
 NR_F30,
 NR_F31,
 NR_F31,
-NR_PC,
-NR_HI,
-NR_LO,
-NR_CR,
-NR_FCR0,
-NR_FCR25,
-NR_FCR26,
-NR_FCR28,
-NR_FCSR
+NR_FCC0,
+NR_FCC1,
+NR_FCC2,
+NR_FCC3,
+NR_FCC4,
+NR_FCC5,
+NR_FCC6,
+NR_FCC7

+ 1 - 2
compiler/mips/rmipsrni.inc

@@ -71,5 +71,4 @@
 69,
 69,
 70,
 70,
 71,
 71,
-72,
-73
+72

+ 4 - 5
compiler/mips/rmipssri.inc

@@ -1,9 +1,5 @@
 { don't edit, this file is generated from mipsreg.dat }
 { don't edit, this file is generated from mipsreg.dat }
-68,
-66,
 0,
 0,
-67,
-65,
 5,
 5,
 6,
 6,
 7,
 7,
@@ -41,11 +37,14 @@
 40,
 40,
 41,
 41,
 42,
 42,
+65,
+66,
+67,
+68,
 69,
 69,
 70,
 70,
 71,
 71,
 72,
 72,
-73,
 31,
 31,
 29,
 29,
 27,
 27,

+ 7 - 8
compiler/mips/rmipssta.inc

@@ -65,11 +65,10 @@
 62,
 62,
 63,
 63,
 -1,
 -1,
-68,
-69,
-70,
-71,
-72,
-73,
-74,
-75
+-1,
+-1,
+-1,
+-1,
+-1,
+-1,
+-1

+ 8 - 9
compiler/mips/rmipsstd.inc

@@ -64,12 +64,11 @@
 'f29',
 'f29',
 'f30',
 'f30',
 'f31',
 'f31',
-'PC',
-'HI',
-'LO',
-'CR',
-'fcr0',
-'fcr25',
-'fcr26',
-'fcr28',
-'fcsr'
+'fcc0',
+'fcc1',
+'fcc2',
+'fcc3',
+'fcc4',
+'fcc5',
+'fcc6',
+'fcc7'

+ 8 - 9
compiler/mips/rmipssup.inc

@@ -64,12 +64,11 @@ RS_F28 = $1C;
 RS_F29 = $1D;
 RS_F29 = $1D;
 RS_F30 = $1E;
 RS_F30 = $1E;
 RS_F31 = $1F;
 RS_F31 = $1F;
-RS_PC = $00;
-RS_HI = $01;
-RS_LO = $02;
-RS_CR = $03;
-RS_FCR0 = $04;
-RS_FCR25 = $05;
-RS_FCR26 = $06;
-RS_FCR28 = $07;
-RS_FCSR = $08;
+RS_FCC0 = $20;
+RS_FCC1 = $21;
+RS_FCC2 = $22;
+RS_FCC3 = $23;
+RS_FCC4 = $24;
+RS_FCC5 = $25;
+RS_FCC6 = $26;
+RS_FCC7 = $27;

+ 16 - 0
compiler/mips/strinst.inc

@@ -189,4 +189,20 @@
 'sdbbp',
 'sdbbp',
 'wrpgpr',
 'wrpgpr',
 'eret',
 'eret',
+'mthc1',
+'mfhc1',
+'seb',
+'seh',
+'movt',
+'movf',
+'movt.s',
+'movf.s',
+'movt.d',
+'movf.d',
+'movn',
+'movz',
+'movn.s',
+'movz.s',
+'movn.d',
+'movz.d',
 'end_def'
 'end_def'

+ 158 - 73
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 24910 + 1
+#   Based on errore.msg of SVN revision 28127
 #
 #
 #   This file is part of the Free Pascal Compiler
 #   This file is part of the Free Pascal Compiler
 #   Copyright (c) 1998-2014 by the Free Pascal Development team
 #   Copyright (c) 1998-2014 by the Free Pascal Development team
@@ -143,7 +143,7 @@ general_f_oserror=01025_F_Betriebsystemfehler: $1
 #
 #
 # Scanner
 # Scanner
 #
 #
-# 02094 is the last used one
+# 02098 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
@@ -155,7 +155,7 @@ scan_f_end_of_file=02000_F_Unerwartetes Dateiende
 % this typically happens in one of the following cases:
 % this typically happens in one of the following cases:
 % \begin{itemize}
 % \begin{itemize}
 % \item The source file ends before the final \var{end.} statement. This
 % \item The source file ends before the final \var{end.} statement. This
-% happens mostly when the \var{begin} and \var{end} statements aren't
+% happens mostly when the \var{begin} and \var{end} statements are not
 % balanced;
 % balanced;
 % \item An include file ends in the middle of a statement.
 % \item An include file ends in the middle of a statement.
 % \item A comment was not closed.
 % \item A comment was not closed.
@@ -212,7 +212,7 @@ scan_e_error_in_preproc_expr=02019_E_Syntaxfehler im Kontext einer $if Direktive
 scan_w_macro_cut_after_255_chars=02020_W_Inhalt des Makros wurde nach der Auswertung bei 255 Zeichen abgeschnitten
 scan_w_macro_cut_after_255_chars=02020_W_Inhalt des Makros wurde nach der Auswertung bei 255 Zeichen abgeschnitten
 % The contents of macros cannot be longer than 255 characters.
 % The contents of macros cannot be longer than 255 characters.
 scan_e_endif_without_if=02021_E_ENDIF ohne IF(N)DEF
 scan_e_endif_without_if=02021_E_ENDIF ohne IF(N)DEF
-% Your \var{\{\$IFDEF ..\}} and {\{\$ENDIF\}} statements aren't balanced.
+% Your \var{\{\$IFDEF ..\}} and {\{\$ENDIF\}} statements are not balanced.
 scan_f_user_defined=02022_F_Benutzerdefiniert: $1
 scan_f_user_defined=02022_F_Benutzerdefiniert: $1
 % A user defined fatal error occurred. See also the \progref
 % A user defined fatal error occurred. See also the \progref
 scan_e_user_defined=02023_E_Benutzerdefiniert: $1
 scan_e_user_defined=02023_E_Benutzerdefiniert: $1
@@ -300,7 +300,7 @@ scan_e_wrong_switch_toggle=02052_E_Parameter f
 scan_e_resourcefiles_not_supported=02053_E_Resourcedateien werden vom aktuellen Zielbetriebssystem nicht unterst�tzt
 scan_e_resourcefiles_not_supported=02053_E_Resourcedateien werden vom aktuellen Zielbetriebssystem nicht unterst�tzt
 % The target you are compiling for doesn't support resource files.
 % The target you are compiling for doesn't support resource files.
 scan_w_include_env_not_found=02054_W_$1 ist keine Umgebungsvariable
 scan_w_include_env_not_found=02054_W_$1 ist keine Umgebungsvariable
-% The included environment variable can't be found in the environment; it will
+% The included environment variable cannot be found in the environment; it will
 % be replaced by an empty string instead.
 % be replaced by an empty string instead.
 scan_e_invalid_maxfpureg_value=02055_E_Nicht erlaubter Wert f�r MAXFPUREGISTER-Direktive
 scan_e_invalid_maxfpureg_value=02055_E_Nicht erlaubter Wert f�r MAXFPUREGISTER-Direktive
 % Valid values for this directive are 0..8 and NORMAL/DEFAULT.
 % Valid values for this directive are 0..8 and NORMAL/DEFAULT.
@@ -401,6 +401,18 @@ scan_e_illegal_peflag=02093_E_Ung
 scan_e_illegal_peoptflag=02094_E_Ung�ltiges Argument f�r SETPEOPTFLAGS
 scan_e_illegal_peoptflag=02094_E_Ung�ltiges Argument f�r SETPEOPTFLAGS
 % The given argument for SETPEOPTFLAGS is neither a correct named value nor an
 % The given argument for SETPEOPTFLAGS is neither a correct named value nor an
 % ordinal value
 % ordinal value
+scan_e_unsupported_switch=02095_E_Direktive $1 wird auf diesem Zielbetriebssystem nicht unterst�tzt
+% Not all compiler directives are supported on all targets.
+scan_w_invalid_stacksize=02096_W_Die spezifizierte Gr”áe des Stack ist auáerhalb des g�ltigen Bereichs der Platform. Setzen der Gr”áe des Stack ignoriert.
+% The valid range for the stack size is 1024 - 67107839 on 32-bit and 64-bit
+% platforms and 1024 - 65520 on 16-bit platforms. Additionally, for Turbo Pascal 7
+% compatibility reasons, specifying a stack size of 65521 on 16-bit platforms
+% actually sets the stack size to 65520.
+scan_w_heapmax_lessthan_heapmin=02097_W_Die spezifizierte GrӇe des HeapMax ist kleiner als der des HeapMin. Setzen der GrӇe des HeapMax ignoriert.
+% The HeapMax value (if specified) must be greater than or equal to the HeapMin
+% value. Otherwise, the HeapMax value is ignored.
+scan_w_hugepointernormalization_not_support=02098_W_HUGEPOINTERNORMALIZATION wird auf der Zielplatform nicht unterst�tzt
+% The \var{\{\$HUGEPOINTERNORMALIZATION\}} directive is not supported by the target platform.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -408,7 +420,7 @@ scan_e_illegal_peoptflag=02094_E_Ung
 #
 #
 # Parser
 # Parser
 #
 #
-# 03334 is the last used one
+# 03338 is the last used one
 #
 #
 % \section{Parser messages}
 % \section{Parser messages}
 % This section lists all parser messages. The parser takes care of the
 % This section lists all parser messages. The parser takes care of the
@@ -524,8 +536,8 @@ parser_w_use_extended_syntax_for_objects=03042_W_Benutzen Sie die erweiterte Syn
 % called), although space will be allocated. You should issue the
 % called), although space will be allocated. You should issue the
 % \var{new(a,init)} statement. This will allocate space, and call the
 % \var{new(a,init)} statement. This will allocate space, and call the
 % constructor of the object.
 % constructor of the object.
-parser_w_no_new_dispose_on_void_pointers=03043_W_Verwendung von NEW oder DISPOSE mit untypisierten Pointern ist ohne Aussage
-parser_e_no_new_dispose_on_void_pointers=03044_E_Verwendung von NEW oder DISPOSE mit untypisierten Pointern ist nicht m”glich
+parser_w_no_new_dispose_on_void_pointers=03043_W_Verwendung von NEW oder DISPOSE mit untypisierten Zeigern ist ohne Aussage
+parser_e_no_new_dispose_on_void_pointers=03044_E_Verwendung von NEW oder DISPOSE mit untypisierten Zeigern ist nicht m”glich
 % You cannot use \var{new(p)} or \var{dispose(p)} if \var{p} is an untyped pointer
 % You cannot use \var{new(p)} or \var{dispose(p)} if \var{p} is an untyped pointer
 % because no size is associated to an untyped pointer.
 % because no size is associated to an untyped pointer.
 % It is accepted for compatibility in \var{TP} and \var{DELPHI} modes, but the
 % It is accepted for compatibility in \var{TP} and \var{DELPHI} modes, but the
@@ -869,7 +881,7 @@ parser_e_threadvars_only_sg=03147_E_Threadvariablen k
 % because every thread has its own stack and local variables
 % because every thread has its own stack and local variables
 % are stored on the stack.
 % are stored on the stack.
 parser_f_direct_assembler_not_allowed=03148_F_Direkter Assembler wird f+r bin„res Ausgabeformat nicht unterst�tzt
 parser_f_direct_assembler_not_allowed=03148_F_Direkter Assembler wird f+r bin„res Ausgabeformat nicht unterst�tzt
-% You can't use direct assembler when using a binary writer. Choose an
+% You cannot use direct assembler when using a binary writer. Choose an
 % other output format or use another assembler reader.
 % other output format or use another assembler reader.
 parser_w_no_objpas_use_mode=03149_W_Laden Sie die OBJPAS Unit nicht manuell, benutzen Sie statdessen {$mode objfpc} oder {$mode delphi}
 parser_w_no_objpas_use_mode=03149_W_Laden Sie die OBJPAS Unit nicht manuell, benutzen Sie statdessen {$mode objfpc} oder {$mode delphi}
 % You are trying to load the \file{ObjPas} unit manually from a \var{uses} clause.
 % You are trying to load the \file{ObjPas} unit manually from a \var{uses} clause.
@@ -886,13 +898,13 @@ parser_e_resourcestring_only_sg=03152_E_Resourcestrings d
 % Resourcestring cannot be declared local, only global or using the static
 % Resourcestring cannot be declared local, only global or using the static
 % directive.
 % directive.
 parser_e_exit_with_argument_not__possible=03153_E_EXIT mit Argument darf hier nicht verwendet werden
 parser_e_exit_with_argument_not__possible=03153_E_EXIT mit Argument darf hier nicht verwendet werden
-% An exit statement with an argument for the return value can't be used here. This
+% An exit statement with an argument for the return value cannot be used here. This
 % can happen for example in \var{try..except} or \var{try..finally} blocks.
 % can happen for example in \var{try..except} or \var{try..finally} blocks.
 parser_e_stored_property_must_be_boolean=03154_E_Der Typ des STORED-Symbols muss boolesch sein
 parser_e_stored_property_must_be_boolean=03154_E_Der Typ des STORED-Symbols muss boolesch sein
 % If you specify a storage symbol in a property declaration, it must be a
 % If you specify a storage symbol in a property declaration, it must be a
 % boolean type.
 % boolean type.
 parser_e_ill_property_storage_sym=03155_E_Dieses Symbol ist als Speichersymbol unzul„ssig
 parser_e_ill_property_storage_sym=03155_E_Dieses Symbol ist als Speichersymbol unzul„ssig
-% You can't use this type of symbol as storage specifier in property
+% You cannot use this type of symbol as storage specifier in property
 % declaration. You can use only methods with the result type boolean,
 % declaration. You can use only methods with the result type boolean,
 % boolean class fields or boolean constants.
 % boolean class fields or boolean constants.
 parser_e_only_publishable_classes_can_be_published=03156_E_Nur Klassen, die im "$M+"-Modus �bersetzt wurden, d�rfen published sein
 parser_e_only_publishable_classes_can_be_published=03156_E_Nur Klassen, die im "$M+"-Modus �bersetzt wurden, d�rfen published sein
@@ -950,14 +962,14 @@ parser_e_interface_id_expected=03169_E_Interface-Bezeichner erwartet
 % \end{verbatim}
 % \end{verbatim}
 % and the \var{interface} before the dot is not listed in the inheritance list.
 % and the \var{interface} before the dot is not listed in the inheritance list.
 parser_e_type_cant_be_used_in_array_index=03170_E_Der Typ "$1" kann nicht als Array-Index verwendet werden
 parser_e_type_cant_be_used_in_array_index=03170_E_Der Typ "$1" kann nicht als Array-Index verwendet werden
-% Types like \var{qword} or \var{int64} aren't allowed as array index type.
+% Types like \var{qword} or \var{int64} are not allowed as array index type.
 parser_e_no_con_des_in_interfaces=03171_E_Kon- und Destruktoren sind in Interfaces nicht erlaubt
 parser_e_no_con_des_in_interfaces=03171_E_Kon- und Destruktoren sind in Interfaces nicht erlaubt
-% Constructor and destructor declarations aren't allowed in interfaces.
+% Constructor and destructor declarations are not allowed in interfaces.
 % In the most cases method \var{QueryInterface} of \var{IUnknown} can
 % In the most cases method \var{QueryInterface} of \var{IUnknown} can
 % be used to create a new interface.
 % be used to create a new interface.
 parser_e_no_access_specifier_in_interfaces=03172_E_Zugriffsbezeichner k”nnen in INTERFACEs und OBJCPROTOCOLs nicht benutzt werden
 parser_e_no_access_specifier_in_interfaces=03172_E_Zugriffsbezeichner k”nnen in INTERFACEs und OBJCPROTOCOLs nicht benutzt werden
 % The access specifiers \var{public}, \var{private}, \var{protected} and
 % The access specifiers \var{public}, \var{private}, \var{protected} and
-% \var{published} can't be used in interfaces, Objective-C protocols and categories because all methods
+% \var{published} cannot be used in interfaces, Objective-C protocols and categories because all methods
 % of an interface/protocol/category must be public.
 % of an interface/protocol/category must be public.
 parser_e_no_vars_in_interfaces=03173_E_Ein Interface, ein Helfer, ein Objective-C Protokoll oder eine Kategorie darf keine Felder enthalten
 parser_e_no_vars_in_interfaces=03173_E_Ein Interface, ein Helfer, ein Objective-C Protokoll oder eine Kategorie darf keine Felder enthalten
 % Declarations of fields are not allowed in interfaces, helpers and Objective-C protocols and categories.
 % Declarations of fields are not allowed in interfaces, helpers and Objective-C protocols and categories.
@@ -981,7 +993,7 @@ parser_e_varargs_need_cdecl_and_external=03178_E_Verwendung von VarArgs (oder '.
 % \var{cdecl}, \var{cppdecl} and \var{mwpascal}. This functionality
 % \var{cdecl}, \var{cppdecl} and \var{mwpascal}. This functionality
 % is only supported to provide a compatible interface to C functions like printf.
 % is only supported to provide a compatible interface to C functions like printf.
 parser_e_self_call_by_value=03179_E_Self muss ein Call-By-Value-Parameter sein
 parser_e_self_call_by_value=03179_E_Self muss ein Call-By-Value-Parameter sein
-% You can't declare \var{Self} as a const or var parameter, it must always be
+% You cannot declare \var{Self} as a const or var parameter, it must always be
 % a call-by-value parameter.
 % a call-by-value parameter.
 parser_e_interface_has_no_guid=03180_E_Interface "$1" hat keine Interface-Identifikation
 parser_e_interface_has_no_guid=03180_E_Interface "$1" hat keine Interface-Identifikation
 % When you want to assign an interface to a constant, then the interface
 % When you want to assign an interface to a constant, then the interface
@@ -1044,7 +1056,7 @@ parser_e_paraloc_only_one_para=03197_E_Jedes Argument muss seine eigene "locatio
 % \begin{verbatim}
 % \begin{verbatim}
 % procedure p(i,j : longint 'r1');
 % procedure p(i,j : longint 'r1');
 % \end{verbatim}
 % \end{verbatim}
-% aren't allowed.
+% are not allowed.
 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.
@@ -1111,7 +1123,7 @@ parser_w_implicit_uses_of_variants_unit=03211_W_Implizite Verwendung einer Varia
 % compiler has implicitly added the Variants unit to the uses list. To remove this warning
 % compiler has implicitly added the Variants unit to the uses list. To remove this warning
 % the Variants unit needs to be added to the uses statement.
 % the Variants unit needs to be added to the uses statement.
 parser_e_no_static_method_in_interfaces=03212_E_Class und statische Methoden k”nnen nicht in INTERFACES verwendet werden
 parser_e_no_static_method_in_interfaces=03212_E_Class und statische Methoden k”nnen nicht in INTERFACES verwendet werden
-% The specifier \var{class} and directive \var{static} can't be used in interfaces
+% The specifier \var{class} and directive \var{static} cannot be used in interfaces
 % because all methods of an interface must be public.
 % because all methods of an interface must be public.
 parser_e_arithmetic_operation_overflow=03213_E_šberlauf in arithmetischer Operation
 parser_e_arithmetic_operation_overflow=03213_E_šberlauf in arithmetischer Operation
 % An operation on two integer values produced an overflow.
 % An operation on two integer values produced an overflow.
@@ -1120,7 +1132,7 @@ parser_e_protected_or_private_expected=03214_E_Protected oder private erwartet
 parser_e_illegal_slice=03215_E_SLICE kann nicht ausserhalb der Parameterliste benutzt werden
 parser_e_illegal_slice=03215_E_SLICE kann nicht ausserhalb der Parameterliste benutzt werden
 % \var{slice} can be used only for arguments accepting an open array parameter.
 % \var{slice} can be used only for arguments accepting an open array parameter.
 parser_e_dispinterface_cant_have_parent=03216_E_Ein DISPINTERFACE kann keine Elternklasse haben.
 parser_e_dispinterface_cant_have_parent=03216_E_Ein DISPINTERFACE kann keine Elternklasse haben.
-% A DISPINTERFACE is a special type of interface which can't have a parent class. Dispinterface always derive from IDispatch type.
+% A DISPINTERFACE is a special type of interface which cannot have a parent class. Dispinterface always derive from IDispatch type.
 parser_e_dispinterface_needs_a_guid=03217_E_Ein DISPINTERFACE ben”tigt einen GUID
 parser_e_dispinterface_needs_a_guid=03217_E_Ein DISPINTERFACE ben”tigt einen GUID
 % A DISPINTERFACE always needs an interface identification (a GUID).
 % A DISPINTERFACE always needs an interface identification (a GUID).
 parser_w_overridden_methods_not_same_ret=03218_W_šberschriebene Methoden m�ssen einen entsprechenden R�ckgabetyp haben. Dieser Code kann abst�rzen, weil er von einem Delphi Parser Bug abh„ngt (Methode "$2" wird durch "$1" �berschrieben, die einen anderen R�ckgabetyp hat).
 parser_w_overridden_methods_not_same_ret=03218_W_šberschriebene Methoden m�ssen einen entsprechenden R�ckgabetyp haben. Dieser Code kann abst�rzen, weil er von einem Delphi Parser Bug abh„ngt (Methode "$2" wird durch "$1" �berschrieben, die einen anderen R�ckgabetyp hat).
@@ -1162,7 +1174,7 @@ parser_e_no_funcret_specified=03227_E_Kein Funktionsergebnistyp f
 % The first time you declare a function you have to declare it completely,
 % The first time you declare a function you have to declare it completely,
 % including all parameters and the result type.
 % including all parameters and the result type.
 parser_e_special_onlygenerics=03228_E_Spezialisierung wird nur f�r generische Typen unterst�tzt
 parser_e_special_onlygenerics=03228_E_Spezialisierung wird nur f�r generische Typen unterst�tzt
-% Types which are not generics can't be specialized.
+% Types which are not generics cannot be specialized.
 parser_e_no_generics_as_params=03229_E_Generische Typen k”nnen bei der Spezialisierung generischer Typen nicht als Parameter benutzt werden
 parser_e_no_generics_as_params=03229_E_Generische Typen k”nnen bei der Spezialisierung generischer Typen nicht als Parameter benutzt werden
 % When specializing a generic, only non-generic types can be used as parameters.
 % When specializing a generic, only non-generic types can be used as parameters.
 parser_e_type_object_constants=03230_E_Konstanten eines Objekts, das ein VMT enth„lt, sind unzul„ssig
 parser_e_type_object_constants=03230_E_Konstanten eines Objekts, das ein VMT enth„lt, sind unzul„ssig
@@ -1398,16 +1410,16 @@ parser_e_forward_intf_declaration_must_be_resolved=03298_E_Die Vorw
 parser_e_no_record_published=03299_E_Record -Typen k”nnen keine ”ffentlichen Abschnitte (published sections) haben
 parser_e_no_record_published=03299_E_Record -Typen k”nnen keine ”ffentlichen Abschnitte (published sections) haben
 % Published sections can be used only inside classes.
 % Published sections can be used only inside classes.
 parser_e_no_destructor_in_records=03300_E_Destruktoren sind in Records und Helfern nicht erlaubt
 parser_e_no_destructor_in_records=03300_E_Destruktoren sind in Records und Helfern nicht erlaubt
-% Destructor declarations aren't allowed in records or helpers.
+% Destructor declarations are not allowed in records or helpers.
 parser_e_class_methods_only_static_in_records=03301_E_Klassenmethoden m�ssen in Records statisch sein
 parser_e_class_methods_only_static_in_records=03301_E_Klassenmethoden m�ssen in Records statisch sein
-% Class methods declarations aren't allowed in records without static modifier.
+% Class methods declarations are not allowed in records without static modifier.
 % Records have no inheritance and therefore non static class methods have no sence for them.
 % Records have no inheritance and therefore non static class methods have no sence for them.
 parser_e_no_parameterless_constructor_in_records=03302_E_Konstruktoren ohne Parameter sind in Records und Record/Typhelfern nicht erlaubt
 parser_e_no_parameterless_constructor_in_records=03302_E_Konstruktoren ohne Parameter sind in Records und Record/Typhelfern nicht erlaubt
 % Constructor declarations with no arguments aren't allowed in records or record/type helpers.
 % Constructor declarations with no arguments aren't allowed in records or record/type helpers.
 parser_e_at_least_one_argument_must_be_of_type=03303_E_Entweder das Ergebnis oder mindestens ein Parameter m�ssen vom Typ "$1" sein
 parser_e_at_least_one_argument_must_be_of_type=03303_E_Entweder das Ergebnis oder mindestens ein Parameter m�ssen vom Typ "$1" sein
 % It is required that either the result of the routine or at least one of its parameters be of the specified type.
 % It is required that either the result of the routine or at least one of its parameters be of the specified type.
 % For example class operators either take an instance of the structured type in which they are defined, or they return one.
 % For example class operators either take an instance of the structured type in which they are defined, or they return one.
-parser_e_cant_use_type_parameters_here=03304_E_Typ-Parameter k”nnen initialization/finalization erfordern - Sie k”nnen deshalb nicht in varianten Rekords verwendet werden
+parser_e_cant_use_type_parameters_here=03304_E_Typ-Parameter k”nnen initialization/finalization erfordern - Sie k”nnen deshalb nicht in varianten Records verwendet werden
 % Type parameters may be specialized with types which (e.g. \var{ansistring}) need initialization/finalization
 % Type parameters may be specialized with types which (e.g. \var{ansistring}) need initialization/finalization
 % code which is implicitly generated by the compiler. 
 % code which is implicitly generated by the compiler. 
 parser_e_externals_no_section=03305_E_"external" deklarierte Variablen d�rfen nicht in einer "custom section" sein
 parser_e_externals_no_section=03305_E_"external" deklarierte Variablen d�rfen nicht in einer "custom section" sein
@@ -1415,12 +1427,12 @@ parser_e_externals_no_section=03305_E_"external" deklarierte Variablen d
 parser_e_section_no_locals=03306_E_Nicht-statische und nicht-globale Variablen d�rfen keine Direktive "section" haben
 parser_e_section_no_locals=03306_E_Nicht-statische und nicht-globale Variablen d�rfen keine Direktive "section" haben
 % A variable placed in a custom section is always statically allocated so it must be either a static or global variable.
 % A variable placed in a custom section is always statically allocated so it must be either a static or global variable.
 parser_e_not_allowed_in_helper=03307_E_"$1" ist in Helfertypen nicht erlaubt
 parser_e_not_allowed_in_helper=03307_E_"$1" ist in Helfertypen nicht erlaubt
-% Some directives and specifiers like "virtual", "dynamic", "override" aren't
+% Some directives and specifiers like "virtual", "dynamic", "override" are not
 % allowed inside helper types in mode ObjFPC (they are ignored in mode Delphi),
 % allowed inside helper types in mode ObjFPC (they are ignored in mode Delphi),
 % because they have no meaning within helpers. Also "abstract" isn't allowed in
 % because they have no meaning within helpers. Also "abstract" isn't allowed in
 % either mode.
 % either mode.
 parser_e_no_class_constructor_in_helpers=03308_E_Klassenkonstruktoren sind in Helfern nicht erlaubt
 parser_e_no_class_constructor_in_helpers=03308_E_Klassenkonstruktoren sind in Helfern nicht erlaubt
-% Class constructor declarations aren't allowed in helpers.
+% Class constructor declarations are not allowed in helpers.
 parser_e_inherited_not_in_record=03309_E_"inherited" ist in einem Record nicht erlaubt
 parser_e_inherited_not_in_record=03309_E_"inherited" ist in einem Record nicht erlaubt
 % As records don't suppport inheritance the use of "inherited" is prohibited for
 % As records don't suppport inheritance the use of "inherited" is prohibited for
 % these as well as for record helpers (in mode "Delphi" only).
 % these as well as for record helpers (in mode "Delphi" only).
@@ -1438,7 +1450,7 @@ parser_e_implements_no_mapping=03313_E_Das Interface "$1" kann keine Methoden-Au
 parser_e_invalid_codepage=03314_E_Ung�ltige Codepage
 parser_e_invalid_codepage=03314_E_Ung�ltige Codepage
 % When declaring a string with a given codepage, the range of valid codepages values is limited
 % When declaring a string with a given codepage, the range of valid codepages values is limited
 % to 0 to 65535.
 % to 0 to 65535.
-parser_e_final_only_const_var=03315_E_Nur Felder (var-Sektionen) und Konstanten k”nnen in Object-Typen final sein
+parser_e_final_only_const_var=03315_E_Nur Felder (var-Sektionen) und Konstanten k”nnen in Objekt-Typen final sein
 % A final (class) field must be assigned a single value in the (class) constructor, and cannot
 % A final (class) field must be assigned a single value in the (class) constructor, and cannot
 % be overwritten afterwards. A final (typed) constant is read-only.
 % be overwritten afterwards. A final (typed) constant is read-only.
 parser_e_final_only_external=03316_E_Finale Felder werden derzeit nur in externen Klassen unterst�tzt
 parser_e_final_only_external=03316_E_Finale Felder werden derzeit nur in externen Klassen unterst�tzt
@@ -1509,6 +1521,23 @@ parser_e_dir_not_allowed=03333_E_Direktive "$1" ist hier nicht erlaubt
 % is not allowed for instance methods or class operators.
 % is not allowed for instance methods or class operators.
 parser_e_no_assembler_in_generic=03334_E_Assemblerbl”cke sind innerhalb von "generics" nicht erlaubt
 parser_e_no_assembler_in_generic=03334_E_Assemblerbl”cke sind innerhalb von "generics" nicht erlaubt
 % The use of assembler blocks/routines is not allowed inside generics.
 % The use of assembler blocks/routines is not allowed inside generics.
+parser_e_property_only_sgr=03335_E_Eigenschaften sind nur statisch, global oder in strukturierten Typen erlaubt
+% Properties cannot be declared local, only global, using the static
+% directive or inside structured types.
+parser_e_overloaded_have_same_mangled_name=03336_E_šberladene Routinen haben den gleichen "mangled" Namen
+% Some platforms, such as the JVM platform, encode the parameters in the routine name in
+% a prescribed way, and this encoding may map different Pascal types to the same encoded
+% (a.k.a.\ ``mangled'') name. This error can only be solved by removing or changing the
+% conflicting definitions' parameter declarations or routine names.
+parser_e_default_value_val_const=03337_E_Voreinstellungswerte k”nnen nur f�r value, const und constref Parameter spezifiziert werden
+% A default parameter value allows you to not specify a value for this parameter
+% when calling the routine, and the compiler will instead pass the specified
+% default (constant) value. As a result, default values can only be specified
+% for parameters that can accept constant values.
+parser_w_ptr_type_ignored=03338_W_Zeigertyp "$1" ignoriert
+% 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
+% declared on a non-x86 platform.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -1516,7 +1545,7 @@ parser_e_no_assembler_in_generic=03334_E_Assemblerbl
 #
 #
 # Type Checking
 # Type Checking
 #
 #
-# 04120 is the last used one
+# 04122 is the last used one
 #
 #
 % \section{Type checking errors}
 % \section{Type checking errors}
 % This section lists all errors that can occur when type checking is
 % This section lists all errors that can occur when type checking is
@@ -1627,14 +1656,14 @@ type_e_wrong_type_in_array_constructor=04024_E_Falscher Typ "$1" im Array-Konstr
 type_e_wrong_parameter_type=04025_E_Inkompatible Typen f�r Argument Nr. #$1: habe $2 erhalten, aber $3 erwartet
 type_e_wrong_parameter_type=04025_E_Inkompatible Typen f�r Argument Nr. #$1: habe $2 erhalten, aber $3 erwartet
 % You are trying to pass an invalid type for the specified parameter.
 % You are trying to pass an invalid type for the specified parameter.
 type_e_no_method_and_procedure_not_compatible=04026_E_Methode (Variable) und Prozedur (Variable) sind nicht kompatibel
 type_e_no_method_and_procedure_not_compatible=04026_E_Methode (Variable) und Prozedur (Variable) sind nicht kompatibel
-% You can't assign a method to a procedure variable or a procedure to a
+% You cannot assign a method to a procedure variable or a procedure to a
 % method pointer.
 % method pointer.
 type_e_wrong_math_argument=04027_E_Unzul„ssige Konstante an interne Algebrafunktion �bergeben
 type_e_wrong_math_argument=04027_E_Unzul„ssige Konstante an interne Algebrafunktion �bergeben
 % The constant argument passed to a \var{ln} or \var{sqrt} function is out of
 % The constant argument passed to a \var{ln} or \var{sqrt} function is out of
 % the definition range of these functions.
 % the definition range of these functions.
 type_e_no_addr_of_constant=04028_E_Von Konstanten kann keine Adresse bestimmt werden
 type_e_no_addr_of_constant=04028_E_Von Konstanten kann keine Adresse bestimmt werden
-% It's not possible to get the address of a constant, because they
-% aren't stored in memory, you can try making it a typed constant. This error
+% It is not possible to get the address of a constant, because they
+% are not stored in memory, you can try making it a typed constant. This error
 % can also be displayed if you try to pass a property to a var parameter.
 % can also be displayed if you try to pass a property to a var parameter.
 type_e_argument_cant_be_assigned=04029_E_An das Argument kann nichts zugewiesen werden
 type_e_argument_cant_be_assigned=04029_E_An das Argument kann nichts zugewiesen werden
 % Only expressions which can be on the left side of an
 % Only expressions which can be on the left side of an
@@ -1730,7 +1759,7 @@ type_h_smaller_possible_range_check=04049_H_Unpassende Typgr
 % There is an assignment to a smaller type than the source type. This means that
 % There is an assignment to a smaller type than the source type. This means that
 % this may cause a range-check error, or may lead to possible loss of data.
 % this may cause a range-check error, or may lead to possible loss of data.
 type_e_cant_take_address_of_abstract_method=04050_E_Die Adresse einer abstrakten Methode kann nicht verwendet werden
 type_e_cant_take_address_of_abstract_method=04050_E_Die Adresse einer abstrakten Methode kann nicht verwendet werden
-% An abstract method has no body, so the address of an abstract method can't be taken.
+% An abstract method has no body, so the address of an abstract method cannot be taken.
 type_e_assignment_not_allowed=04051_E_Zuweisungen auf formale Parameter und offene Arrays sind nicht m”glich
 type_e_assignment_not_allowed=04051_E_Zuweisungen auf formale Parameter und offene Arrays sind nicht m”glich
 % You are trying to assign a value to a formal (untyped var, const or out)
 % You are trying to assign a value to a formal (untyped var, const or out)
 % parameter, or to an open array.
 % parameter, or to an open array.
@@ -1774,13 +1803,13 @@ type_e_no_packed_inittable=04064_E_Elemente von packed Arrays k
 % (such as ansistrings, or records which contain ansistrings) is not yet implemented.
 % (such as ansistrings, or records which contain ansistrings) is not yet implemented.
 type_e_no_const_packed_record=04065_E_Konstante packed Records und Objekte werden noch nicht unterst�tzt
 type_e_no_const_packed_record=04065_E_Konstante packed Records und Objekte werden noch nicht unterst�tzt
 % You cannot declare a (bit)packed array as a typed constant at this time.
 % You cannot declare a (bit)packed array as a typed constant at this time.
-type_w_untyped_arithmetic_unportable=04066_W_Arithmetik "$1" mit typenlosem Pointer ist nicht portierbar nach {$T+}, schlage typecast vor
+type_w_untyped_arithmetic_unportable=04066_W_Arithmetik "$1" mit typenlosem Zeiger ist nicht portierbar nach {$T+}, schlage typecast vor
 % Addition/subtraction from an untyped pointer may work differently in \var{\{\$T+\}}.
 % Addition/subtraction from an untyped pointer may work differently in \var{\{\$T+\}}.
 % Use a typecast to a typed pointer.
 % Use a typecast to a typed pointer.
 type_e_cant_take_address_of_local_subroutine=04076_E_Die Address einer Subroutine, die als local markiert ist, kann nicht verwendet werden
 type_e_cant_take_address_of_local_subroutine=04076_E_Die Address einer Subroutine, die als local markiert ist, kann nicht verwendet werden
-% The address of a subroutine marked as local can't be taken.
+% The address of a subroutine marked as local cannot be taken.
 type_e_cant_export_local=04077_E_Eine Subroutine, die aus einer Unit als local markiert ist, kann nicht exportiert werden
 type_e_cant_export_local=04077_E_Eine Subroutine, die aus einer Unit als local markiert ist, kann nicht exportiert werden
-% A subroutine marked as local can't be exported from a unit.
+% A subroutine marked as local cannot be exported from a unit.
 type_e_not_automatable=04078_E_Typ "$1" ist nicht "automatable"
 type_e_not_automatable=04078_E_Typ "$1" ist nicht "automatable"
 % Only byte, integer, longint, smallint, currency, single, double, ansistring,
 % Only byte, integer, longint, smallint, currency, single, double, ansistring,
 % widestring, tdatetime, variant, olevariant, wordbool and all interfaces are automatable.
 % widestring, tdatetime, variant, olevariant, wordbool and all interfaces are automatable.
@@ -1793,7 +1822,7 @@ type_h_convert_sub_operands_to_prevent_overflow=04080_H_Konvertierung des Operan
 type_h_convert_mul_operands_to_prevent_overflow=04081_H_Konvertierung des Operanden "$1" vor der Multiplikation k”nnte šberlauf Fehler verhindern
 type_h_convert_mul_operands_to_prevent_overflow=04081_H_Konvertierung des Operanden "$1" vor der Multiplikation k”nnte šberlauf Fehler verhindern
 % Multiplying two types can cause overflow errors. Since you are converting the result to a larger type, you
 % Multiplying two types can cause overflow errors. Since you are converting the result to a larger type, you
 % could prevent such errors by converting the operands to this type before doing the multiplication.
 % could prevent such errors by converting the operands to this type before doing the multiplication.
-type_w_pointer_to_signed=04082_W_Die Konvertierung von Pointern in einen Integertyp mit Vorzeichen kann zu falschen Ergebnissen bei Vergleichen und zu Bereichs�berschreitungen f�hren; verwenden sie statt dessen besser einen Typ ohne Vorzeichen
+type_w_pointer_to_signed=04082_W_Die Konvertierung von Zeigern in einen Integertyp mit Vorzeichen kann zu falschen Ergebnissen bei Vergleichen und zu Bereichs�berschreitungen f�hren; verwenden sie statt dessen besser einen Typ ohne Vorzeichen
 % The virtual address space on 32-bit machines runs from \$00000000 to \$ffffffff.
 % The virtual address space on 32-bit machines runs from \$00000000 to \$ffffffff.
 % Many operating systems allow you to allocate memory above \$80000000.
 % Many operating systems allow you to allocate memory above \$80000000.
 % For example both \windows and \linux allow pointers in the range \$0000000 to \$bfffffff.
 % For example both \windows and \linux allow pointers in the range \$0000000 to \$bfffffff.
@@ -1940,6 +1969,12 @@ type_e_invalid_default_value=04119_E_Der Defaultwert f
 % arrays and TP-style objects, cannot have a default value.
 % arrays and TP-style objects, cannot have a default value.
 type_e_type_not_allowed_for_type_helper=04120_E_Typ "$1" kann durch einen Typhelfer nicht erweitert werden
 type_e_type_not_allowed_for_type_helper=04120_E_Typ "$1" kann durch einen Typhelfer nicht erweitert werden
 % Types like procedural variables cannot be extended by type helpers
 % Types like procedural variables cannot be extended by type helpers
+type_e_procedure_must_be_far=04121_E_Prozedur oder Funktion muss weit ("far") sein, damit seine Adresse verwendet werden kann: "$1"
+% In certain i8086 memory models (medium, large and huge), procedures and functions
+% have to be declared 'far' in order to allow their address to be taken.
+type_w_instance_abstract_class=04122_-W_Erzeugung einer Instanz der abstrakten Klasse "$1"
+% The specified class is declared as \var{abstract} and thus no instance of this class
+% should be created. This is merely a warning for Delphi compatibility.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -1947,7 +1982,7 @@ type_e_type_not_allowed_for_type_helper=04120_E_Typ "$1" kann durch einen Typhel
 #
 #
 # Symtable
 # Symtable
 #
 #
-# 05087 is the last used one
+# 05088 is the last used one
 #
 #
 % \section{Symbol handling}
 % \section{Symbol handling}
 % This section lists all the messages that concern the handling of symbols.
 % This section lists all the messages that concern the handling of symbols.
@@ -1984,7 +2019,7 @@ sym_e_forward_type_not_resolved=05009_E_Forward-Typ "$1" nicht gefunden
 % The compiler encountered an unknown type.
 % The compiler encountered an unknown type.
 sym_e_only_static_in_static=05010_E_Nur statische Variablen k”nnen in statischen oder „usseren Methoden verwendet werden
 sym_e_only_static_in_static=05010_E_Nur statische Variablen k”nnen in statischen oder „usseren Methoden verwendet werden
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record-, Objekt- oder Klassen-Typ erwartet
 % The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 % The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instanzen von Klassen oder Objekten mit abstrakten Methoden sind unzul„ssig
 sym_e_no_instance_of_abstract_object=05013_E_Instanzen von Klassen oder Objekten mit abstrakten Methoden sind unzul„ssig
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
@@ -1998,7 +2033,7 @@ sym_e_ill_label_decl=05016_E_Ung
 % procedure or function.
 % procedure or function.
 sym_e_goto_and_label_not_supported=05017_E_GOTO und LABEL werden nicht unterst�tzt (verwenden Sie den Schalter -Sg)
 sym_e_goto_and_label_not_supported=05017_E_GOTO und LABEL werden nicht unterst�tzt (verwenden Sie den Schalter -Sg)
 % You must use the -Sg switch to compile a program which has \var{label}s
 % You must use the -Sg switch to compile a program which has \var{label}s
-% and \var{goto} statements. By default, \var{label} and \var{goto} aren't
+% and \var{goto} statements. By default, \var{label} and \var{goto} are not
 % supported.
 % supported.
 sym_e_label_not_found=05018_E_Label nicht gefunden
 sym_e_label_not_found=05018_E_Label nicht gefunden
 % A \var{goto label} was encountered, but the label wasn't declared.
 % A \var{goto label} was encountered, but the label wasn't declared.
@@ -2053,7 +2088,7 @@ sym_w_uninitialized_variable=05037_W_Variable "$1" scheint nicht initialisiert w
 % These messages are displayed if the compiler thinks that a variable will
 % These messages are displayed if the compiler thinks that a variable will
 % be used (i.e. it appears in the right-hand side of an expression) when it
 % be used (i.e. it appears in the right-hand side of an expression) when it
 % wasn't initialized first (i.e. appeared in the left-hand side of an
 % wasn't initialized first (i.e. appeared in the left-hand side of an
-% assignassignmentment).
+% assignment).
 sym_e_id_no_member=05038_E_Bezeichener verweist nicht auf ein Element: $1
 sym_e_id_no_member=05038_E_Bezeichener verweist nicht auf ein Element: $1
 % This error is generated when an identifier of a record,
 % This error is generated when an identifier of a record,
 % field or method is accessed while it is not defined.
 % field or method is accessed while it is not defined.
@@ -2213,6 +2248,8 @@ sym_e_no_matching_inherited_parameterless_constructor=05086_E_Kann den voreinges
 % In this case you must add a valid constructor yourself.
 % In this case you must add a valid constructor yourself.
 sym_d_adding_helper_for=05087_D_Helfer f�r $1 hinzugef�gt
 sym_d_adding_helper_for=05087_D_Helfer f�r $1 hinzugef�gt
 % A helper for the mentioned type is added to the current scope
 % A helper for the mentioned type is added to the current scope
+sym_e_param_list=05088_E_Deklaration gefunden: $1
+% This message shows all overloaded declarations in case of an error.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2220,7 +2257,7 @@ sym_d_adding_helper_for=05087_D_Helfer f
 #
 #
 # Codegenerator
 # Codegenerator
 #
 #
-# 06052 is the last used one
+# 06056 is the last used one
 #
 #
 % \section{Code generator messages}
 % \section{Code generator messages}
 % This section lists all messages that can be displayed if the code
 % This section lists all messages that can be displayed if the code
@@ -2364,6 +2401,10 @@ cg_e_mod_only_defined_for_pos_quotient=06054_E_Im ISO-Modus ist der Operator mod
 % In ISO pascal, only positive values are allowed for the quotient: \var{n mod m} is only valid if \var{m>0}.
 % In ISO pascal, only positive values are allowed for the quotient: \var{n mod m} is only valid if \var{m>0}.
 cg_d_autoinlining=06055_DL_Automatisches inlining: $1
 cg_d_autoinlining=06055_DL_Automatisches inlining: $1
 % Due to auto inlining turned on, the compiler auto inlines this subroutine.
 % Due to auto inlining turned on, the compiler auto inlines this subroutine.
+cg_e_function_not_support_by_selected_instruction_set=06056_E_Die verwendete Funktion wird vom ausgew„hlten Instruction-Set nicht unterst�tzt: $1
+% Some functions cannot be implemented efficiently for certain instruction sets, one example is fused multiply/add.
+% To avoid very inefficient code, the compiler complains in this case, so either select another instruction set
+% or replace the function call by alternative code
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2378,35 +2419,35 @@ asmr_d_start_reading=07000_DL_Starte $1 Stil Assembler Parsen
 asmr_d_finish_reading=07001_DL_Beende $1 Stil Assembler Parsen
 asmr_d_finish_reading=07001_DL_Beende $1 Stil Assembler Parsen
 % This informs you that an assembler block has finished.
 % This informs you that an assembler block has finished.
 asmr_e_none_label_contain_at=07002_E_Nicht-Label Bezeichner enth„lt @
 asmr_e_none_label_contain_at=07002_E_Nicht-Label Bezeichner enth„lt @
-% A identifier which isn't a label can't contain a @.
+% A identifier which isn't a label cannot contain a @.
 asmr_e_building_record_offset=07004_E_Fehler beim Ermitteln des Recordoffsets
 asmr_e_building_record_offset=07004_E_Fehler beim Ermitteln des Recordoffsets
 % There has an error occured while building the offset of a record/object
 % There has an error occured 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 ohne Bezeicner verwendet
 asmr_e_offset_without_identifier=07005_E_OFFSET ohne Bezeicner verwendet
-% You can only use OFFSET with an identifier. Other syntaxes aren't
+% You can only use OFFSET with an identifier. Other syntaxes are not
 % supported
 % supported
 asmr_e_type_without_identifier=07006_E_TYPE verwendet ohne Bezeichner
 asmr_e_type_without_identifier=07006_E_TYPE verwendet ohne Bezeichner
-% You can only use TYPE with an identifier. Other syntaxes aren't
+% You can only use TYPE with an identifier. Other syntaxes are not
 % supported
 % supported
 asmr_e_no_local_or_para_allowed=07007_E_Lokale Variable oder Parameter k”nnen hier nicht verwendet werden
 asmr_e_no_local_or_para_allowed=07007_E_Lokale Variable oder Parameter k”nnen hier nicht verwendet werden
-% You can't use a local variable or parameter here, mostly because the
+% You cannot use a local variable or parameter here, mostly because the
 % addressing of locals and parameters is done using the %ebp register so the
 % addressing of locals and parameters is done using the %ebp register so the
-% address can't be get directly.
+% address cannot be get directly.
 asmr_e_need_offset=07008_E_Hier muss OFFSET verwendet werden
 asmr_e_need_offset=07008_E_Hier muss OFFSET verwendet werden
 % You need to use OFFSET <id> here to get the address of the identifier.
 % You need to use OFFSET <id> here to get the address of the identifier.
 asmr_e_need_dollar=07009_E_Hier muss "$" verwendet werden
 asmr_e_need_dollar=07009_E_Hier muss "$" verwendet werden
 % You need to use $<id> here to get the address of the identifier.
 % You need to use $<id> here to get the address of the identifier.
 asmr_e_cant_have_multiple_relocatable_symbols=07010_E_Verwendung von mehreren verschiebbaren Symbolen nicht m”glich
 asmr_e_cant_have_multiple_relocatable_symbols=07010_E_Verwendung von mehreren verschiebbaren Symbolen nicht m”glich
-% You can't have more than one relocatable symbol (variable/typed constant)
+% You cannot have more than one relocatable symbol (variable/typed constant)
 % in one argument.
 % in one argument.
 asmr_e_only_add_relocatable_symbol=07011_E_Verschiebbares Symbol kann nur addiert werden
 asmr_e_only_add_relocatable_symbol=07011_E_Verschiebbares Symbol kann nur addiert werden
-% Relocatable symbols (variable/typed constant) can't be used with other
+% Relocatable symbols (variable/typed constant) cannot be used with other
 % operators. Only addition is allowed.
 % operators. Only addition is allowed.
 asmr_e_invalid_constant_expression=07012_E_Ung�ltiger Konstantenausdruck
 asmr_e_invalid_constant_expression=07012_E_Ung�ltiger Konstantenausdruck
 % There is an error in the constant expression.
 % There is an error in the constant expression.
 asmr_e_relocatable_symbol_not_allowed=07013_E_Verschiebbares Symbol ist nicht zul„ssig
 asmr_e_relocatable_symbol_not_allowed=07013_E_Verschiebbares Symbol ist nicht zul„ssig
-% You can't use a relocatable symbol (variable/typed constant) here.
+% You cannot use a relocatable symbol (variable/typed constant) here.
 asmr_e_invalid_reference_syntax=07014_E_Ung�ltige Verweis-Syntax
 asmr_e_invalid_reference_syntax=07014_E_Ung�ltige Verweis-Syntax
 % There is an error in the reference.
 % There is an error in the reference.
 asmr_e_local_para_unreachable=07015_E_Sie k”nnen "$1" von diesem Code aus nicht erreichen
 asmr_e_local_para_unreachable=07015_E_Sie k”nnen "$1" von diesem Code aus nicht erreichen
@@ -2414,7 +2455,7 @@ asmr_e_local_para_unreachable=07015_E_Sie k
 % of a higher level procedure in assembler code (except for
 % of a higher level procedure in assembler code (except for
 % local assembler code without parameter nor locals).
 % local assembler code without parameter nor locals).
 asmr_e_local_label_not_allowed_as_ref=07016_E_Lokale Symbole/Labels sind nicht als Referenz zul„ssig
 asmr_e_local_label_not_allowed_as_ref=07016_E_Lokale Symbole/Labels sind nicht als Referenz zul„ssig
-% You can't use local symbols/labels as references
+% You cannot use local symbols/labels as references
 asmr_e_wrong_base_index=07017_E_Ung�ltige Verwendung von Basis- und Index-Registern
 asmr_e_wrong_base_index=07017_E_Ung�ltige Verwendung von Basis- und Index-Registern
 % There is an error with the base and index register, they are
 % There is an error with the base and index register, they are
 % probably incorrect
 % probably incorrect
@@ -2483,7 +2524,7 @@ asmr_e_invalid_opcode_and_operand=07048_E_Ung
 asmr_e_syn_operand=07049_E_Assembler Syntaxfehler im Operanden
 asmr_e_syn_operand=07049_E_Assembler Syntaxfehler im Operanden
 asmr_e_syn_constant=07050_E_Assembler Syntaxfehler in Konstanten
 asmr_e_syn_constant=07050_E_Assembler Syntaxfehler in Konstanten
 asmr_e_invalid_string_expression=07051_E_Ung�ltiger Stringausdruck
 asmr_e_invalid_string_expression=07051_E_Ung�ltiger Stringausdruck
-asmr_w_const32bit_for_address=07052_W_Konstante mit Symbol $1 f�r Adresse erzeugt, die kein Pointer ist
+asmr_w_const32bit_for_address=07052_W_Konstante mit Symbol $1 f�r Adresse erzeugt, die kein Zeiger ist
 % A constant expression represents an address which does not fit
 % A constant expression represents an address which does not fit
 % into a pointer. The address is probably incorrect
 % into a pointer. The address is probably incorrect
 asmr_e_unknown_opcode=07053_E_Unbekannter Opcode $1
 asmr_e_unknown_opcode=07053_E_Unbekannter Opcode $1
@@ -2676,7 +2717,7 @@ asmr_e_invalid_ref_register=07125_E_Ung
 #
 #
 # Assembler/binary writers
 # Assembler/binary writers
 #
 #
-# 08022 is the last used one
+# 08026 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
@@ -2717,11 +2758,14 @@ asmw_e_prologue_too_large=08024_E_Der Funktionsprolog 
 asmw_e_handlerdata_no_handler=08025_E_".seh_handlerdata"-Direktive ohne vorangehendes ".seh_handler"
 asmw_e_handlerdata_no_handler=08025_E_".seh_handlerdata"-Direktive ohne vorangehendes ".seh_handler"
 % x86_64-win64: If .seh_handlerdata directive is used, then a .seh_handler directive must be
 % x86_64-win64: If .seh_handlerdata directive is used, then a .seh_handler directive must be
 % present earlier in the same function.
 % present earlier in the same function.
+asmw_f_too_many_relocations=08026_F_Relocationz„hler f�r Sektion $1 �bersteigt 65535
+% Legacy COFF targets limit number of relocations per section to 65535 because they use a 2-byte field
+% to store the relocation count. Targets using newer PECOFF format do not have this limitation.
 
 
 #
 #
 # Executing linker/assembler
 # Executing linker/assembler
 #
 #
-# 09034 is the last used one
+# 09035 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 %
 %
@@ -2734,13 +2778,13 @@ exec_w_source_os_redefined=09000_W_Quellbetriebssystem wurde neu definiert
 exec_i_assembling_pipe=09001_I_Assembliere (pipe) $1
 exec_i_assembling_pipe=09001_I_Assembliere (pipe) $1
 % Assembling using a pipe to an external assembler.
 % Assembling using a pipe to an external assembler.
 exec_d_cant_create_asmfile=09002_E_Kann Assemblerdatei nicht erzeugen: $1
 exec_d_cant_create_asmfile=09002_E_Kann Assemblerdatei nicht erzeugen: $1
-% The mentioned file can't be created. Check if you have
+% The mentioned file cannot be created. Check if you have
 % access permissions to create this file.
 % access permissions to create this file.
 exec_e_cant_create_objectfile=09003_E_Kann Objektdatei nicht erzeugen: $1 (Fehlercode: $2)
 exec_e_cant_create_objectfile=09003_E_Kann Objektdatei nicht erzeugen: $1 (Fehlercode: $2)
-% The mentioned file can't be created. Check if you have
+% The mentioned file cannot be created. Check if you have
 % got access permissions to create this file.
 % got access permissions to create this file.
 exec_e_cant_create_archivefile=09004_E_Kann Archivdatei nicht erzeugen: $1
 exec_e_cant_create_archivefile=09004_E_Kann Archivdatei nicht erzeugen: $1
-% The mentioned file can't be created. Check if you have
+% The mentioned file cannot be created. Check if you have
 % access permissions to create this file.
 % access permissions to create this file.
 exec_e_assembler_not_found=09005_E_Assembler $1 nicht gefunden, schalte um zu externem Assemblieren
 exec_e_assembler_not_found=09005_E_Assembler $1 nicht gefunden, schalte um zu externem Assemblieren
 % The assembler program was not found. The compiler will produce a script that
 % The assembler program was not found. The compiler will produce a script that
@@ -2799,7 +2843,7 @@ exec_e_unit_not_smart_or_static_linkable=09026_E_Unit $1 kann weder smart noch s
 % Smart or static linking was requested, but a unit which cannot be used for either  was used.
 % Smart or static linking was requested, but a unit which cannot be used for either  was used.
 exec_e_unit_not_shared_or_static_linkable=09027_E_Unit $1 kann weder shared noch statisch gelinkt werden
 exec_e_unit_not_shared_or_static_linkable=09027_E_Unit $1 kann weder shared noch statisch gelinkt werden
 % Shared or static linking was requested, but a unit which cannot be used for either  was used.
 % Shared or static linking was requested, but a unit which cannot be used for either  was used.
-exec_d_resbin_params=09028_D_Resource Compiler "$1" wird mit "$2" als Kommandozeile aufgerufen
+exec_d_resbin_params=09028_D_Resource-Compiler "$1" wird mit "$2" als Kommandozeile aufgerufen
 % An informational message showing which command line is used for the resource compiler.
 % An informational message showing which command line is used for the resource compiler.
 exec_e_error_while_compiling_resources=09029_E_Fehler beim šbersetzen von Resourcen
 exec_e_error_while_compiling_resources=09029_E_Fehler beim šbersetzen von Resourcen
 % The resource compiler or converter returned an error.
 % The resource compiler or converter returned an error.
@@ -2816,6 +2860,9 @@ exec_n_backquote_cat_file_not_found=09033_N_Die Datei "$1" wurde mit dem Kommand
 exec_w_init_file_not_found=09034_W_"$1" nicht gefunden; dies wird wahrscheinlich zu einem Fehler beim Linken f�hren
 exec_w_init_file_not_found=09034_W_"$1" nicht gefunden; dies wird wahrscheinlich zu einem Fehler beim Linken f�hren
 % The compiler adds certain startup code files to the linker only when they are found.
 % The compiler adds certain startup code files to the linker only when they are found.
 % If they are not found, they are not added and this might cause a linking failure.
 % If they are not found, they are not added and this might cause a linking failure.
+exec_e_static_lib_not_supported=09035_E_Statische Bibliotheken nicht unterst�tzt
+% Creating static libraries is not supported for this platform, because it was
+% not yet implemented in the compiler.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2859,7 +2906,7 @@ execinfo_x_stackcommit=09134_X_Stack Bereich "committed": $1 Bytes
 % \begin{description}
 % \begin{description}
 link_f_executable_too_big=09200_F_Das Programm - Image ist f�r das Target $1 zu groá
 link_f_executable_too_big=09200_F_Das Programm - Image ist f�r das Target $1 zu groá
 % Fatal error when resulting executable is too big.
 % Fatal error when resulting executable is too big.
-link_w_32bit_absolute_reloc=09201_W_Object Daei "$1" enth„lt eine 32-bit absolute Relocation auf Symbol "$2".
+link_w_32bit_absolute_reloc=09201_W_Objektdatei "$1" enth„lt eine 32-bit absolute Relocation auf Symbol "$2".
 % Warning when 64-bit object file contains 32-bit absolute relocations.
 % Warning when 64-bit object file contains 32-bit absolute relocations.
 % In such case an executable image can be loaded into lower 4Gb of
 % In such case an executable image can be loaded into lower 4Gb of
 % address space only.
 % address space only.
@@ -3072,6 +3119,9 @@ unit_u_indirect_crc_changed=10062_U_Die CRC des indirekten Interface (Objekte/Kl
 % indirect CRC calculated for the unit (this is the CRC of all classes/objects/interfaces/$\ldots$
 % indirect CRC calculated for the unit (this is the CRC of all classes/objects/interfaces/$\ldots$
 % in the interfaces of units directly or indirectly used by this unit in the interface) has been changed after the
 % in the interfaces of units directly or indirectly used by this unit in the interface) has been changed after the
 % implementation has been parsed.
 % implementation has been parsed.
+unit_u_ppu_invalid_memory_model=10063_U_PPU ist f�r ein anderes i8086 Speichermodell kompiliert
+% This unit file was compiled for a different i8086 memory model and
+% cannot be read.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -3079,7 +3129,7 @@ unit_u_indirect_crc_changed=10062_U_Die CRC des indirekten Interface (Objekte/Kl
 #
 #
 # Options
 # Options
 #
 #
-# 11053 is the last used one
+# 11057 is the last used one
 #
 #
 option_usage=11000_O_$1 [Optionen] <Eingabedatei> [Optionen]
 option_usage=11000_O_$1 [Optionen] <Eingabedatei> [Optionen]
 # BeginOfTeX
 # BeginOfTeX
@@ -3144,7 +3194,7 @@ option_obsolete_switch_use_new=11019_W_Sie benutzen den nun 
 % future, when the meaning of the switch may change.
 % future, when the meaning of the switch may change.
 option_switch_bin_to_src_assembler=11020_N_Schalte Assembler auf den Standard-Assembler-Quellcodeschreiber
 option_switch_bin_to_src_assembler=11020_N_Schalte Assembler auf den Standard-Assembler-Quellcodeschreiber
 % This notifies you that the assembler has been changed because you used the
 % This notifies you that the assembler has been changed because you used the
-% -a switch, which can't be used with a binary assembler writer.
+% -a switch, which cannot be used with a binary assembler writer.
 option_incompatible_asm=11021_W_Das gew„hlte Assembler-Ausgabeformat "$1" ist nicht mit "$2" kompatibel
 option_incompatible_asm=11021_W_Das gew„hlte Assembler-Ausgabeformat "$1" ist nicht mit "$2" kompatibel
 option_asm_forced=11022_W_Verwendung des Assemblers "$1" erzwungen
 option_asm_forced=11022_W_Verwendung des Assemblers "$1" erzwungen
 % The assembler output selected cannot generate
 % The assembler output selected cannot generate
@@ -3219,6 +3269,12 @@ option_illegal_fpu_eabihf=11052_E_Sie m
 % The EABIHF (VFP hardfloat) ABI target can only be used with VFP FPUs.
 % The EABIHF (VFP hardfloat) ABI target can only be used with VFP FPUs.
 option_w_unsupported_debug_format=11053_W_Das ausgew„hlte Debugformat wird auf dem aktuellen Ziel nicht unterst�tzt. Die aktuelle Einstellung wird beibehalten
 option_w_unsupported_debug_format=11053_W_Das ausgew„hlte Debugformat wird auf dem aktuellen Ziel nicht unterst�tzt. Die aktuelle Einstellung wird beibehalten
 % Not all targets support all debug formats (in particular, Stabs is not supported on 64 bit targets).
 % Not all targets support all debug formats (in particular, Stabs is not supported on 64 bit targets).
+option_missing_arg=11054_E_Argument f�r "$1" fehlt
+% Displayed when parameter must be followed by an argument.
+option_malformed_para=11055_E_Ung�ltiges Argument f�r Parameter: $1
+% Given argument is not valid for parameter.
+option_smart_link_requires_external_linker=11056_W_Smart-linking erfordert externen Linker
+option_com_files_require_tiny_model=11057_E_Das Erstellen von .COM Dateien wird f�r das aktuelle Speichermodell nicht unterst�tzt. Nur das winzige (tiny) Speichermodell unterst�tzt .COM Dateien
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -3326,6 +3382,9 @@ Unterst
 Unterst�tzte FPU Instruktionen:
 Unterst�tzte FPU Instruktionen:
   $FPUINSTRUCTIONSETS
   $FPUINSTRUCTIONSETS
 
 
+Unterst�tzte Inline-Assembler Modi:
+  $ASMMODES
+
 Unterst�tzte ABI Ziele:
 Unterst�tzte ABI Ziele:
   $ABITARGETS
   $ABITARGETS
 
 
@@ -3380,6 +3439,7 @@ option_help_pages=11025_[
 **1a_L”sche die erzeugte Assembler-Datei nicht
 **1a_L”sche die erzeugte Assembler-Datei nicht
 **2al_Liste Quellcode-Zeilen in der Assembler-Datei
 **2al_Liste Quellcode-Zeilen in der Assembler-Datei
 **2an_Liste "node info" in der Assembler-Datei (-dEXTDEBUG Compiler)
 **2an_Liste "node info" in der Assembler-Datei (-dEXTDEBUG Compiler)
+**2ao_F�ge eine zus„tzliche Option zum Aufruf des externen Assemblers hinzu (ignoriert f�r den internen Assembler)
 *L2ap_Benutze Pipes anstelle tempor„rer Assembler-Dateien
 *L2ap_Benutze Pipes anstelle tempor„rer Assembler-Dateien
 **2ar_Liste Registerbelegungsinformation in Assembler-Datei
 **2ar_Liste Registerbelegungsinformation in Assembler-Datei
 **2at_Liste Temp. Variablenbelegungsinfo in Assembler-Datei
 **2at_Liste Temp. Variablenbelegungsinfo in Assembler-Datei
@@ -3387,23 +3447,33 @@ option_help_pages=11025_[
 **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*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*2Anasmobj_Assembliere mit Hilfe von Nasm
+3*2Anasm_Assembliere mit Hilfe von Nasm
 3*2Anasmcoff_COFF (Go32v2) Datei mit Hilfe von Nasm
 3*2Anasmcoff_COFF (Go32v2) Datei mit Hilfe von Nasm
 3*2Anasmelf_ELF32 (Linux) Datei mit Hilfe von Nasm
 3*2Anasmelf_ELF32 (Linux) Datei mit Hilfe von Nasm
-3*2Anasmwin32_Win32 Object Datei mit Hilfe von Nasm
-3*2Anasmwdosx_Win32/WDOSX Object Datei mit Hilfe von Nasm
-3*2Awasm_obj Datei mit Hilfe von Wasm (Watcom)
+3*2Anasmwin32_Win32 Objektdatei mit Hilfe von Nasm
+3*2Anasmwdosx_Win32/WDOSX Objektdatei mit Hilfe von Nasm
+3*2Anasmdarwin Macho32 Objektdatei mit Hilfe von Nasm (experimentell)
+3*2Awasm_Obj Datei mit Hilfe von Wasm (Watcom)
 3*2Anasmobj_Obj Datei mit Hilfe von Nasm
 3*2Anasmobj_Obj Datei mit Hilfe von Nasm
 3*2Amasm_Obj Datei mit Hilfe von Masm (Microsoft)
 3*2Amasm_Obj Datei mit Hilfe von Masm (Microsoft)
 3*2Atasm_Obj Datei mit Hilfe von Tasm (Borland)
 3*2Atasm_Obj Datei mit Hilfe von Tasm (Borland)
 3*2Aelf_ELF32 (Linux) mit Hilfe des internen Schreibers
 3*2Aelf_ELF32 (Linux) mit Hilfe des internen Schreibers
 3*2Acoff_COFF (Go32v2) mit Hilfe des internen Schreibers
 3*2Acoff_COFF (Go32v2) mit Hilfe des internen Schreibers
 3*2Apecoff_PE_COFF (Win32) mit Hilfe des internen Schreibers
 3*2Apecoff_PE_COFF (Win32) mit Hilfe des internen Schreibers
+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*2Amasm_Win64 Object Datei mit Hilfe von ml64 (Microsoft)
-4*2Apecoff_PE-COFF (Win64) mit Hilfe des internen Writer
-4*2Aelf_ELF (Linux-64bit) mit Hilfe des internen Writer
+4*2Amasm_Win64 Objektdatei mit Hilfe von ml64 (Microsoft)
+4*2Apecoff_PE-COFF (Win64) mit Hilfe des internen Schreibers
+4*2Aelf_ELF (Linux-64bit) mit Hilfe des internen Schreibers
+4*2Ayasm_Assembliere mit Hilfe von Yasm (experimentell)
+4*2Anasm_Assembliere mit Hilfe von Nasm (experimentell)
+4*2Anasmwin64_Assembliere Win64 Objektdatei mit Hilfe von Nasm (experimentell)
+4*2Anasmelf_Assembliere Linux-64bit Objektdatei mit Hilfe von Nasm (experimentell)
+4*2Anasmdarwin_Assembliere darwin Macho64 Objektdatei mit Hilfe von Nasm (experimentell)
 6*2Aas_Unix o-Datei mit Hilfe von GNU AS
 6*2Aas_Unix o-Datei mit Hilfe von GNU AS
 6*2Agas_GNU Motorola Assembler
 6*2Agas_GNU Motorola Assembler
 6*2Amit_MIT Syntax (old GAS)
 6*2Amit_MIT Syntax (old GAS)
@@ -3421,32 +3491,41 @@ S*2Aas_Assembliere mit Hilfe von GNU AS
 **2Cc<x>_Setze "default calling convention" zu <x>
 **2Cc<x>_Setze "default calling convention" zu <x>
 **2CD_Erzeuge auch eine dynamische Bibliothek (nicht unterst�tzt)
 **2CD_Erzeuge auch eine dynamische Bibliothek (nicht unterst�tzt)
 **2Ce_šbersetze mit emulierten Fliesskomma opcodes
 **2Ce_šbersetze mit emulierten Fliesskomma opcodes
-**2Cf<x>_W„hle den Fliesskomma instruction set aus; fpc -i gibt die m”glichen Werte aus
+**2Cf<x>_W„hle den Fliesskomma-Instruction-Set aus; fpc -i gibt die m”glichen Werte aus
 **2CF<x>_Minimale Pr„zission von Fliesskommakonstanten (default, 32, 64)
 **2CF<x>_Minimale Pr„zission von Fliesskommakonstanten (default, 32, 64)
 **2Cg_Erzeuge PIC code
 **2Cg_Erzeuge PIC code
 **2Ch<n>_<n> Bytes Heap (zwischen 1023 und 67107840)
 **2Ch<n>_<n> Bytes Heap (zwischen 1023 und 67107840)
 **2Ci_I/O-Pr�fung
 **2Ci_I/O-Pr�fung
+A*2CI<x>_W„hle den Instruction-Set f�r ARM aus: ARM oder THUMB
 **2Cn_Lasse die Linkstufe aus
 **2Cn_Lasse die Linkstufe aus
 P*2CN_Erzeuge šberpr�fungen auf Nil-Zeiger (nur AIX)
 P*2CN_Erzeuge šberpr�fungen auf Nil-Zeiger (nur AIX)
 **2Co_Pr�fe auf šberlauf von Integer-Operationen
 **2Co_Pr�fe auf šberlauf von Integer-Operationen
 **2CO_Pr�fe auf m”glichen šberlauf von Integer-Operationen
 **2CO_Pr�fe auf m”glichen šberlauf von Integer-Operationen
-**2Cp<x>_W„hle instruction set aus; fpc -i gibt die m”glichen Werte aus
+**2Cp<x>_W„hle Instruction-Set aus; fpc -i gibt die m”glichen Werte aus
 **2CP<x>=<y>_ Einstellungen f�r packing
 **2CP<x>=<y>_ Einstellungen f�r packing
 **3CPPACKSET=<y>_ <y> Belegung von Sets: 0, 1 oder DEFAULT oder NORMAL, 2, 4 und 8
 **3CPPACKSET=<y>_ <y> Belegung von Sets: 0, 1 oder DEFAULT oder NORMAL, 2, 4 und 8
 **2Cr_F�hre Bereichspr�fung durch
 **2Cr_F�hre Bereichspr�fung durch
 **2CR_Verifiziere die G�ltigkiet des Aufrufs der Objektmethoden
 **2CR_Verifiziere die G�ltigkiet des Aufrufs der Objektmethoden
 **2Cs<n>_Setze die Pr�fgr”sse des Stacks auf <n>
 **2Cs<n>_Setze die Pr�fgr”sse des Stacks auf <n>
 **2Ct_F�hre Stackpr�fung durch (nur zum Testen, siehe Handbuch)
 **2Ct_F�hre Stackpr�fung durch (nur zum Testen, siehe Handbuch)
+8*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
+3*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
+4*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
 p*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
 p*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
 P*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
 P*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
 J*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
 J*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
 A*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
 A*2CT<x>_Optionen f�r die ziel-spezifische Code-Erzeugung
 p*3CTsmalltoc_ Erzeuge kleinere TOCs auf Kosten der Ausf�hrungsgeschwindigkeit (AIX)
 p*3CTsmalltoc_ Erzeuge kleinere TOCs auf Kosten der Ausf�hrungsgeschwindigkeit (AIX)
 P*3CTsmalltoc_ Erzeuge kleinere TOCs auf Kosten der Ausf�hrungsgeschwindigkeit (AIX)
 P*3CTsmalltoc_ Erzeuge kleinere TOCs auf Kosten der Ausf�hrungsgeschwindigkeit (AIX)
+J*3CTautogetterprefix=X_  Erzeuge automatisch Getter f�r Eigenschaften mit dem Prefix X (Leerstring schaltet aus)
+J*3CTautosetterprefix=X_  Erzeuge automatisch Setter f�r Eigenschaften mit dem Prefix X (Leerstring schaltet aus)
+8*3CTcld_                 Emittiere eine CLD-Instruktion vor der x86-String-Instruktion
+3*3CTcld_                 Emittiere eine CLD-Instruktion vor der x86-String-Instruktion
+4*3CTcld_                 Emittiere eine CLD-Instruktion vor der x86-String-Instruktion
 J*3CTcompactintarrayinit_ Erzeuge kleineren (aber m”glicherweise langsameren) Code f�r die Initialisierung von Integer-Array-Konstanten
 J*3CTcompactintarrayinit_ Erzeuge kleineren (aber m”glicherweise langsameren) Code f�r die Initialisierung von Integer-Array-Konstanten
-J*3CTenumfieldinit_ Initialisiere Aufz„hlungsfelder in Konstruktoren mit enumtype(0), nach dem Aufruf geerbter Konstruktoren
-J*3CTautogetterprefix=X_ Erzeuge automatisch Getter f�r Eigenschaften mit dem Prefix X (Leerstring schaltet aus)
-J*3CTautosetterprefix=X_ Erzeuge automatisch Setter f�r Eigenschaften mit dem Prefix X (Leerstring schaltet aus)
+J*3CTenumfieldinit_       Initialisiere Aufz„hlungsfelder in Konstruktoren mit enumtype(0), nach dem Aufruf geerbter Konstruktoren
+J*3CTinitlocals_          Initialisiere lokale Variablen, die einen JVM bytecode Verifikationfehler ausl”sen, wenn uninitialisiert verwendet (verz”gert den Code)
+J*3CTlowercaseprocstart_  Kleinschreibung des ersten Buchstabens bei Prozedur/Funktions/Methoden-Namen.
 A*3CTthumbinterworking_ Erzeuge "Thumb interworking-safe code", wenn m”glich
 A*3CTthumbinterworking_ Erzeuge "Thumb interworking-safe code", wenn m”glich
 J*2Cv_Var/out Parameter copy-out šberpr�fung
 J*2Cv_Var/out Parameter copy-out šberpr�fung
 **2CX_Benutze Smartlinking
 **2CX_Benutze Smartlinking
@@ -3461,8 +3540,8 @@ J*2Cv_Var/out Parameter copy-out 
 **1F<x>_Dateinamen und Pfade:
 **1F<x>_Dateinamen und Pfade:
 **2Fa<x>[,y]_Ein Program soll die Units <x> und [y] laden, bevor uses analysiert wird
 **2Fa<x>[,y]_Ein Program soll die Units <x> und [y] laden, bevor uses analysiert wird
 **2Fc<x>_Setze die Eingabe-Codepage zu <x>
 **2Fc<x>_Setze die Eingabe-Codepage zu <x>
-**2Fd_Schalte den internen Verzeichnis-Cache des Compilers aus
 **2FC<x>_Setze den Namen des RC Compiler-Bin„rprograms auf <x>
 **2FC<x>_Setze den Namen des RC Compiler-Bin„rprograms auf <x>
+**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)
 **2Ff<x>_Erg„nze <x> zum Framework-Pfad (nur Darwin)
@@ -3471,8 +3550,9 @@ J*2Cv_Var/out Parameter copy-out 
 **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
 **2Fm<x>_Lade die Unicode-Konversionstabelle aus <x>.txt im Compiler-Verzeichnis
 **2Fm<x>_Lade die Unicode-Konversionstabelle aus <x>.txt im Compiler-Verzeichnis
+**2FM<x>_Setze das Verzeichnis f�r Unicode-Bin„r-Dateien
 **2Fo<x>_Erg„nze <x> zum Objektdatei-Pfad
 **2Fo<x>_Erg„nze <x> zum Objektdatei-Pfad
-**2Fr<x>_Lade die Fehler-Meldungs Datei <x>
+**2Fr<x>_Lade die Fehlermeldungs-Datei <x>
 **2FR<x>_Setze den Resource (.res) Linker auf <x>
 **2FR<x>_Setze den Resource (.res) Linker auf <x>
 **2Fu<x>_Erg„nze <x> zum Unit-Pfad
 **2Fu<x>_Erg„nze <x> zum Unit-Pfad
 **2FU<x>_Units werden nach <x> ausgegeben, hat Vorrang vor -FE
 **2FU<x>_Units werden nach <x> ausgegeben, hat Vorrang vor -FE
@@ -3556,7 +3636,7 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
 **2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
 **2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
 **2Ss_Konstruktor- und Destruktorname m�ssen "Init" und "Done" sein
 **2Ss_Konstruktor- und Destruktorname m�ssen "Init" und "Done" sein
 **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 Pointer 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
 **2sh_Erzeuge Script um auf dem Host zu linken
 **2st_Erzeuge Script um auf dem Zielsystem zu linken
 **2st_Erzeuge Script um auf dem Zielsystem zu linken
@@ -3581,8 +3661,8 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
 3*2Twin32_Windows 32 Bit
 3*2Twin32_Windows 32 Bit
 3*2Twince_Windows CE
 3*2Twince_Windows CE
 4*2Tdarwin_Darwin/Mac OS X
 4*2Tdarwin_Darwin/Mac OS X
-4*2Twin64_Win64 (64 bit Windows systems)
 4*2Tlinux_Linux
 4*2Tlinux_Linux
+4*2Twin64_Win64 (64 bit Windows systems)
 6*2Tamiga_Commodore Amiga
 6*2Tamiga_Commodore Amiga
 6*2Tatari_Atari ST/STe/TT
 6*2Tatari_Atari ST/STe/TT
 6*2Tlinux_Linux
 6*2Tlinux_Linux
@@ -3660,6 +3740,8 @@ A*2WI_Die Verwendung der "import"-Abschnitte ein/ausschalten (Windows)
 8*3WmTiny_Winziges (tiny) Speichermodell
 8*3WmTiny_Winziges (tiny) Speichermodell
 8*3WmSmall_Kleines (small) Speichermodell (Voreinstellung)
 8*3WmSmall_Kleines (small) Speichermodell (Voreinstellung)
 8*3WmMedium_Mittleres (medium) Speichermodell
 8*3WmMedium_Mittleres (medium) Speichermodell
+8*3WmCompact_Kompaktes (compact) Speichermodell
+8*3WmLarge_Groáes (large) Speichermodell
 3*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 3*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 4*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 4*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 p*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 p*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
@@ -3674,6 +3756,9 @@ A*2WP<x>_Minimale iOS Deployment Version: 3.0, 5.0.1, ... (Darwin)
 3*2WR_Erzeuge "relocation code" (Windows)
 3*2WR_Erzeuge "relocation code" (Windows)
 4*2WR_Erzeuge "relocation code" (Windows)
 4*2WR_Erzeuge "relocation code" (Windows)
 A*2WR_Erzeuge "relocation code" (Windows)
 A*2WR_Erzeuge "relocation code" (Windows)
+8*2Wt<x>_Setze das Format der Ziel-Executable
+8*3Wtexe_Erzeuge eine DOS .EXE Datei (Voreinstellung)
+8*3Wtcom_Erzeuge eine DOS .COM Datei (erfordert das winzige (tiny) Speichermodell)
 P*2WF_Spezifiziere "MPW tool type application" (Classic Mac OS)
 P*2WF_Spezifiziere "MPW tool type application" (Classic Mac OS)
 **2WX_Erm”gliche den executable stack (Linux)
 **2WX_Erm”gliche den executable stack (Linux)
 **1X_Programm-Optionen:
 **1X_Programm-Optionen:

+ 166 - 81
compiler/msg/errordu.msg

@@ -3,10 +3,10 @@
 #   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 24910 + 1
+#   Based on errore.msg of SVN revision 28127
 #
 #
 #   This file is part of the Free Pascal Compiler
 #   This file is part of the Free Pascal Compiler
-#   Copyright (c) 1998-2013 by the Free Pascal Development team
+#   Copyright (c) 1998-2014 by the Free Pascal Development team
 #
 #
 #   See the file COPYING.v2, included in this distribution,
 #   See the file COPYING.v2, included in this distribution,
 #   for details about the copyright.
 #   for details about the copyright.
@@ -106,7 +106,7 @@ general_i_writingresourcefile=01010_I_Resourcestringtabellendatei $1 wird geschr
 % This message is shown when the compiler writes the Resource String Table
 % This message is shown when the compiler writes the Resource String Table
 % file containing all the resource strings for a program.
 % file containing all the resource strings for a program.
 general_e_errorwritingresourcefile=01011_E_Fehler beim Schreiben der Resourcestringtabellendatei: $1
 general_e_errorwritingresourcefile=01011_E_Fehler beim Schreiben der Resourcestringtabellendatei: $1
-% This message is shown when the compiler encountered an error when writing
+% This message is shown when the compiler encounters an error when writing
 % the Resource String Table file.
 % the Resource String Table file.
 general_i_fatal=01012_I_Fataler Fehler:
 general_i_fatal=01012_I_Fataler Fehler:
 % Prefix for Fatal Errors.
 % Prefix for Fatal Errors.
@@ -143,7 +143,7 @@ general_f_oserror=01025_F_Betriebsystemfehler: $1
 #
 #
 # Scanner
 # Scanner
 #
 #
-# 02094 is the last used one
+# 02098 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
@@ -155,7 +155,7 @@ scan_f_end_of_file=02000_F_Unerwartetes Dateiende
 % this typically happens in one of the following cases:
 % this typically happens in one of the following cases:
 % \begin{itemize}
 % \begin{itemize}
 % \item The source file ends before the final \var{end.} statement. This
 % \item The source file ends before the final \var{end.} statement. This
-% happens mostly when the \var{begin} and \var{end} statements aren't
+% happens mostly when the \var{begin} and \var{end} statements are not
 % balanced;
 % balanced;
 % \item An include file ends in the middle of a statement.
 % \item An include file ends in the middle of a statement.
 % \item A comment was not closed.
 % \item A comment was not closed.
@@ -212,7 +212,7 @@ scan_e_error_in_preproc_expr=02019_E_Syntaxfehler im Kontext einer $if Direktive
 scan_w_macro_cut_after_255_chars=02020_W_Inhalt des Makros wurde nach der Auswertung bei 255 Zeichen abgeschnitten
 scan_w_macro_cut_after_255_chars=02020_W_Inhalt des Makros wurde nach der Auswertung bei 255 Zeichen abgeschnitten
 % The contents of macros cannot be longer than 255 characters.
 % The contents of macros cannot be longer than 255 characters.
 scan_e_endif_without_if=02021_E_ENDIF ohne IF(N)DEF
 scan_e_endif_without_if=02021_E_ENDIF ohne IF(N)DEF
-% Your \var{\{\$IFDEF ..\}} and {\{\$ENDIF\}} statements aren't balanced.
+% Your \var{\{\$IFDEF ..\}} and {\{\$ENDIF\}} statements are not balanced.
 scan_f_user_defined=02022_F_Benutzerdefiniert: $1
 scan_f_user_defined=02022_F_Benutzerdefiniert: $1
 % A user defined fatal error occurred. See also the \progref
 % A user defined fatal error occurred. See also the \progref
 scan_e_user_defined=02023_E_Benutzerdefiniert: $1
 scan_e_user_defined=02023_E_Benutzerdefiniert: $1
@@ -300,7 +300,7 @@ scan_e_wrong_switch_toggle=02052_E_Parameter für Schalter falsch, verwenden Sie
 scan_e_resourcefiles_not_supported=02053_E_Resourcedateien werden vom aktuellen Zielbetriebssystem nicht unterstützt
 scan_e_resourcefiles_not_supported=02053_E_Resourcedateien werden vom aktuellen Zielbetriebssystem nicht unterstützt
 % The target you are compiling for doesn't support resource files.
 % The target you are compiling for doesn't support resource files.
 scan_w_include_env_not_found=02054_W_$1 ist keine Umgebungsvariable
 scan_w_include_env_not_found=02054_W_$1 ist keine Umgebungsvariable
-% The included environment variable can't be found in the environment; it will
+% The included environment variable cannot be found in the environment; it will
 % be replaced by an empty string instead.
 % be replaced by an empty string instead.
 scan_e_invalid_maxfpureg_value=02055_E_Nicht erlaubter Wert für MAXFPUREGISTER-Direktive
 scan_e_invalid_maxfpureg_value=02055_E_Nicht erlaubter Wert für MAXFPUREGISTER-Direktive
 % Valid values for this directive are 0..8 and NORMAL/DEFAULT.
 % Valid values for this directive are 0..8 and NORMAL/DEFAULT.
@@ -401,6 +401,18 @@ scan_e_illegal_peflag=02093_E_Ungültiges Argument für SETPEFLAGS
 scan_e_illegal_peoptflag=02094_E_Ungültiges Argument für SETPEOPTFLAGS
 scan_e_illegal_peoptflag=02094_E_Ungültiges Argument für SETPEOPTFLAGS
 % The given argument for SETPEOPTFLAGS is neither a correct named value nor an
 % The given argument for SETPEOPTFLAGS is neither a correct named value nor an
 % ordinal value
 % ordinal value
+scan_e_unsupported_switch=02095_E_Direktive $1 wird auf diesem Zielbetriebssystem nicht unterstützt
+% Not all compiler directives are supported on all targets.
+scan_w_invalid_stacksize=02096_W_Die spezifizierte Größe des Stack ist außerhalb des gültigen Bereichs der Platform. Setzen der Größe des Stack ignoriert.
+% The valid range for the stack size is 1024 - 67107839 on 32-bit and 64-bit
+% platforms and 1024 - 65520 on 16-bit platforms. Additionally, for Turbo Pascal 7
+% compatibility reasons, specifying a stack size of 65521 on 16-bit platforms
+% actually sets the stack size to 65520.
+scan_w_heapmax_lessthan_heapmin=02097_W_Die spezifizierte Größe des HeapMax ist kleiner als der des HeapMin. Setzen der Größe des HeapMax ignoriert.
+% The HeapMax value (if specified) must be greater than or equal to the HeapMin
+% value. Otherwise, the HeapMax value is ignored.
+scan_w_hugepointernormalization_not_support=02098_W_HUGEPOINTERNORMALIZATION wird auf der Zielplatform nicht unterstützt
+% The \var{\{\$HUGEPOINTERNORMALIZATION\}} directive is not supported by the target platform.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -408,7 +420,7 @@ scan_e_illegal_peoptflag=02094_E_Ungültiges Argument für SETPEOPTFLAGS
 #
 #
 # Parser
 # Parser
 #
 #
-# 03334 is the last used one
+# 03338 is the last used one
 #
 #
 % \section{Parser messages}
 % \section{Parser messages}
 % This section lists all parser messages. The parser takes care of the
 % This section lists all parser messages. The parser takes care of the
@@ -510,7 +522,7 @@ parser_e_double_caselabel=03037_E_doppelter CASE-Wert
 parser_e_case_lower_less_than_upper_bound=03038_E_Obere Grenze der CASE-Bereichsangabe ist kleiner als untere Grenze
 parser_e_case_lower_less_than_upper_bound=03038_E_Obere Grenze der CASE-Bereichsangabe ist kleiner als untere Grenze
 % The upper bound of a \var{case} label is less than the lower bound and this
 % The upper bound of a \var{case} label is less than the lower bound and this
 % is useless.
 % is useless.
-parser_e_type_const_not_possible=03039_E_Klassen oder Interfaces 03229_Esind als typisierte Konstanten unzulässig
+parser_e_type_const_not_possible=03039_E_Klassen oder Interfaces sind als typisierte Konstanten unzulässig
 % You cannot declare a constant of type class or object.
 % You cannot declare a constant of type class or object.
 parser_e_no_overloaded_procvars=03040_E_Funktionsvariablen von Overload-Funktionen sind unzulässig
 parser_e_no_overloaded_procvars=03040_E_Funktionsvariablen von Overload-Funktionen sind unzulässig
 % You are trying to assign an overloaded function to a procedural variable.
 % You are trying to assign an overloaded function to a procedural variable.
@@ -524,8 +536,8 @@ parser_w_use_extended_syntax_for_objects=03042_W_Benutzen Sie die erweiterte Syn
 % called), although space will be allocated. You should issue the
 % called), although space will be allocated. You should issue the
 % \var{new(a,init)} statement. This will allocate space, and call the
 % \var{new(a,init)} statement. This will allocate space, and call the
 % constructor of the object.
 % constructor of the object.
-parser_w_no_new_dispose_on_void_pointers=03043_W_Verwendung von NEW oder DISPOSE mit untypisierten Pointern ist ohne Aussage
-parser_e_no_new_dispose_on_void_pointers=03044_E_Verwendung von NEW oder DISPOSE mit untypisierten Pointern ist nicht möglich
+parser_w_no_new_dispose_on_void_pointers=03043_W_Verwendung von NEW oder DISPOSE mit untypisierten Zeigern ist ohne Aussage
+parser_e_no_new_dispose_on_void_pointers=03044_E_Verwendung von NEW oder DISPOSE mit untypisierten Zeigern ist nicht möglich
 % You cannot use \var{new(p)} or \var{dispose(p)} if \var{p} is an untyped pointer
 % You cannot use \var{new(p)} or \var{dispose(p)} if \var{p} is an untyped pointer
 % because no size is associated to an untyped pointer.
 % because no size is associated to an untyped pointer.
 % It is accepted for compatibility in \var{TP} and \var{DELPHI} modes, but the
 % It is accepted for compatibility in \var{TP} and \var{DELPHI} modes, but the
@@ -625,7 +637,7 @@ parser_e_dont_nest_export=03067_E_Mit EXPORT deklarierte Funktionen dürfen nich
 parser_e_methods_dont_be_export=03068_E_Methoden dürfen nicht EXPORTiert werden
 parser_e_methods_dont_be_export=03068_E_Methoden dürfen nicht EXPORTiert werden
 % You cannot declare a procedure that is a method for an object as
 % You cannot declare a procedure that is a method for an object as
 % \var{export}ed. That is, your methods cannot be called from a C program.
 % \var{export}ed. That is, your methods cannot be called from a C program.
-parser_e_call_by_ref_without_typeconv=03069_E_Aufrufe mit VAR-Parametern für Argument-Nr. $1  müssen exakt stimmen: "$2" gefunden, "$3" erwartet
+parser_e_call_by_ref_without_typeconv=03069_E_Aufrufe mit VAR-Parametern für Argument-Nr. $1 müssen exakt stimmen: "$2" gefunden, "$3" erwartet
 % When calling a function declared with \var{var} parameters, the variables in
 % When calling a function declared with \var{var} parameters, the variables in
 % the function call must be of exactly the same type. There is no automatic
 % the function call must be of exactly the same type. There is no automatic
 % type conversion.
 % type conversion.
@@ -869,7 +881,7 @@ parser_e_threadvars_only_sg=03147_E_Threadvariablen können nur statisch oder gl
 % because every thread has its own stack and local variables
 % because every thread has its own stack and local variables
 % are stored on the stack.
 % are stored on the stack.
 parser_f_direct_assembler_not_allowed=03148_F_Direkter Assembler wird f+r binäres Ausgabeformat nicht unterstützt
 parser_f_direct_assembler_not_allowed=03148_F_Direkter Assembler wird f+r binäres Ausgabeformat nicht unterstützt
-% You can't use direct assembler when using a binary writer. Choose an
+% You cannot use direct assembler when using a binary writer. Choose an
 % other output format or use another assembler reader.
 % other output format or use another assembler reader.
 parser_w_no_objpas_use_mode=03149_W_Laden Sie die OBJPAS Unit nicht manuell, benutzen Sie statdessen {$mode objfpc} oder {$mode delphi}
 parser_w_no_objpas_use_mode=03149_W_Laden Sie die OBJPAS Unit nicht manuell, benutzen Sie statdessen {$mode objfpc} oder {$mode delphi}
 % You are trying to load the \file{ObjPas} unit manually from a \var{uses} clause.
 % You are trying to load the \file{ObjPas} unit manually from a \var{uses} clause.
@@ -886,13 +898,13 @@ parser_e_resourcestring_only_sg=03152_E_Resourcestrings dürfen nur statisch ode
 % Resourcestring cannot be declared local, only global or using the static
 % Resourcestring cannot be declared local, only global or using the static
 % directive.
 % directive.
 parser_e_exit_with_argument_not__possible=03153_E_EXIT mit Argument darf hier nicht verwendet werden
 parser_e_exit_with_argument_not__possible=03153_E_EXIT mit Argument darf hier nicht verwendet werden
-% An exit statement with an argument for the return value can't be used here. This
+% An exit statement with an argument for the return value cannot be used here. This
 % can happen for example in \var{try..except} or \var{try..finally} blocks.
 % can happen for example in \var{try..except} or \var{try..finally} blocks.
 parser_e_stored_property_must_be_boolean=03154_E_Der Typ des STORED-Symbols muss boolesch sein
 parser_e_stored_property_must_be_boolean=03154_E_Der Typ des STORED-Symbols muss boolesch sein
 % If you specify a storage symbol in a property declaration, it must be a
 % If you specify a storage symbol in a property declaration, it must be a
 % boolean type.
 % boolean type.
 parser_e_ill_property_storage_sym=03155_E_Dieses Symbol ist als Speichersymbol unzulässig
 parser_e_ill_property_storage_sym=03155_E_Dieses Symbol ist als Speichersymbol unzulässig
-% You can't use this type of symbol as storage specifier in property
+% You cannot use this type of symbol as storage specifier in property
 % declaration. You can use only methods with the result type boolean,
 % declaration. You can use only methods with the result type boolean,
 % boolean class fields or boolean constants.
 % boolean class fields or boolean constants.
 parser_e_only_publishable_classes_can_be_published=03156_E_Nur Klassen, die im "$M+"-Modus übersetzt wurden, dürfen published sein
 parser_e_only_publishable_classes_can_be_published=03156_E_Nur Klassen, die im "$M+"-Modus übersetzt wurden, dürfen published sein
@@ -950,14 +962,14 @@ parser_e_interface_id_expected=03169_E_Interface-Bezeichner erwartet
 % \end{verbatim}
 % \end{verbatim}
 % and the \var{interface} before the dot is not listed in the inheritance list.
 % and the \var{interface} before the dot is not listed in the inheritance list.
 parser_e_type_cant_be_used_in_array_index=03170_E_Der Typ "$1" kann nicht als Array-Index verwendet werden
 parser_e_type_cant_be_used_in_array_index=03170_E_Der Typ "$1" kann nicht als Array-Index verwendet werden
-% Types like \var{qword} or \var{int64} aren't allowed as array index type.
+% Types like \var{qword} or \var{int64} are not allowed as array index type.
 parser_e_no_con_des_in_interfaces=03171_E_Kon- und Destruktoren sind in Interfaces nicht erlaubt
 parser_e_no_con_des_in_interfaces=03171_E_Kon- und Destruktoren sind in Interfaces nicht erlaubt
-% Constructor and destructor declarations aren't allowed in interfaces.
+% Constructor and destructor declarations are not allowed in interfaces.
 % In the most cases method \var{QueryInterface} of \var{IUnknown} can
 % In the most cases method \var{QueryInterface} of \var{IUnknown} can
 % be used to create a new interface.
 % be used to create a new interface.
 parser_e_no_access_specifier_in_interfaces=03172_E_Zugriffsbezeichner können in INTERFACEs und OBJCPROTOCOLs nicht benutzt werden
 parser_e_no_access_specifier_in_interfaces=03172_E_Zugriffsbezeichner können in INTERFACEs und OBJCPROTOCOLs nicht benutzt werden
 % The access specifiers \var{public}, \var{private}, \var{protected} and
 % The access specifiers \var{public}, \var{private}, \var{protected} and
-% \var{published} can't be used in interfaces, Objective-C protocols and categories because all methods
+% \var{published} cannot be used in interfaces, Objective-C protocols and categories because all methods
 % of an interface/protocol/category must be public.
 % of an interface/protocol/category must be public.
 parser_e_no_vars_in_interfaces=03173_E_Ein Interface, ein Helfer, ein Objective-C Protokoll oder eine Kategorie darf keine Felder enthalten
 parser_e_no_vars_in_interfaces=03173_E_Ein Interface, ein Helfer, ein Objective-C Protokoll oder eine Kategorie darf keine Felder enthalten
 % Declarations of fields are not allowed in interfaces, helpers and Objective-C protocols and categories.
 % Declarations of fields are not allowed in interfaces, helpers and Objective-C protocols and categories.
@@ -981,7 +993,7 @@ parser_e_varargs_need_cdecl_and_external=03178_E_Verwendung von VarArgs (oder '.
 % \var{cdecl}, \var{cppdecl} and \var{mwpascal}. This functionality
 % \var{cdecl}, \var{cppdecl} and \var{mwpascal}. This functionality
 % is only supported to provide a compatible interface to C functions like printf.
 % is only supported to provide a compatible interface to C functions like printf.
 parser_e_self_call_by_value=03179_E_Self muss ein Call-By-Value-Parameter sein
 parser_e_self_call_by_value=03179_E_Self muss ein Call-By-Value-Parameter sein
-% You can't declare \var{Self} as a const or var parameter, it must always be
+% You cannot declare \var{Self} as a const or var parameter, it must always be
 % a call-by-value parameter.
 % a call-by-value parameter.
 parser_e_interface_has_no_guid=03180_E_Interface "$1" hat keine Interface-Identifikation
 parser_e_interface_has_no_guid=03180_E_Interface "$1" hat keine Interface-Identifikation
 % When you want to assign an interface to a constant, then the interface
 % When you want to assign an interface to a constant, then the interface
@@ -1044,7 +1056,7 @@ parser_e_paraloc_only_one_para=03197_E_Jedes Argument muss seine eigene "locatio
 % \begin{verbatim}
 % \begin{verbatim}
 % procedure p(i,j : longint 'r1');
 % procedure p(i,j : longint 'r1');
 % \end{verbatim}
 % \end{verbatim}
-% aren't allowed.
+% are not allowed.
 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.
@@ -1111,7 +1123,7 @@ parser_w_implicit_uses_of_variants_unit=03211_W_Implizite Verwendung einer Varia
 % compiler has implicitly added the Variants unit to the uses list. To remove this warning
 % compiler has implicitly added the Variants unit to the uses list. To remove this warning
 % the Variants unit needs to be added to the uses statement.
 % the Variants unit needs to be added to the uses statement.
 parser_e_no_static_method_in_interfaces=03212_E_Class und statische Methoden können nicht in INTERFACES verwendet werden
 parser_e_no_static_method_in_interfaces=03212_E_Class und statische Methoden können nicht in INTERFACES verwendet werden
-% The specifier \var{class} and directive \var{static} can't be used in interfaces
+% The specifier \var{class} and directive \var{static} cannot be used in interfaces
 % because all methods of an interface must be public.
 % because all methods of an interface must be public.
 parser_e_arithmetic_operation_overflow=03213_E_Überlauf in arithmetischer Operation
 parser_e_arithmetic_operation_overflow=03213_E_Überlauf in arithmetischer Operation
 % An operation on two integer values produced an overflow.
 % An operation on two integer values produced an overflow.
@@ -1120,7 +1132,7 @@ parser_e_protected_or_private_expected=03214_E_Protected oder private erwartet
 parser_e_illegal_slice=03215_E_SLICE kann nicht ausserhalb der Parameterliste benutzt werden
 parser_e_illegal_slice=03215_E_SLICE kann nicht ausserhalb der Parameterliste benutzt werden
 % \var{slice} can be used only for arguments accepting an open array parameter.
 % \var{slice} can be used only for arguments accepting an open array parameter.
 parser_e_dispinterface_cant_have_parent=03216_E_Ein DISPINTERFACE kann keine Elternklasse haben.
 parser_e_dispinterface_cant_have_parent=03216_E_Ein DISPINTERFACE kann keine Elternklasse haben.
-% A DISPINTERFACE is a special type of interface which can't have a parent class. Dispinterface always derive from IDispatch type.
+% A DISPINTERFACE is a special type of interface which cannot have a parent class. Dispinterface always derive from IDispatch type.
 parser_e_dispinterface_needs_a_guid=03217_E_Ein DISPINTERFACE benötigt einen GUID
 parser_e_dispinterface_needs_a_guid=03217_E_Ein DISPINTERFACE benötigt einen GUID
 % A DISPINTERFACE always needs an interface identification (a GUID).
 % A DISPINTERFACE always needs an interface identification (a GUID).
 parser_w_overridden_methods_not_same_ret=03218_W_Überschriebene Methoden müssen einen entsprechenden Rückgabetyp haben. Dieser Code kann abstürzen, weil er von einem Delphi Parser Bug abhängt (Methode "$2" wird durch "$1" überschrieben, die einen anderen Rückgabetyp hat).
 parser_w_overridden_methods_not_same_ret=03218_W_Überschriebene Methoden müssen einen entsprechenden Rückgabetyp haben. Dieser Code kann abstürzen, weil er von einem Delphi Parser Bug abhängt (Methode "$2" wird durch "$1" überschrieben, die einen anderen Rückgabetyp hat).
@@ -1158,11 +1170,11 @@ parser_w_no_lineinfo_use_switch=03226_W_Die LINEINFO Unit nicht manuell laden. V
 % automatically adds the correct unit for reading the selected type of debugging
 % automatically adds the correct unit for reading the selected type of debugging
 % information. The unit that needs to be used depends on the type of
 % information. The unit that needs to be used depends on the type of
 % debug information used when compiling the binary.
 % debug information used when compiling the binary.
-parser_e_no_funcret_specified=03227_E_Kein FunKtionsergebnistyp für Funktion "$1" angegeben
+parser_e_no_funcret_specified=03227_E_Kein Funktionsergebnistyp für Funktion "$1" angegeben
 % The first time you declare a function you have to declare it completely,
 % The first time you declare a function you have to declare it completely,
 % including all parameters and the result type.
 % including all parameters and the result type.
 parser_e_special_onlygenerics=03228_E_Spezialisierung wird nur für generische Typen unterstützt
 parser_e_special_onlygenerics=03228_E_Spezialisierung wird nur für generische Typen unterstützt
-% Types which are not generics can't be specialized.
+% Types which are not generics cannot be specialized.
 parser_e_no_generics_as_params=03229_E_Generische Typen können bei der Spezialisierung generischer Typen nicht als Parameter benutzt werden
 parser_e_no_generics_as_params=03229_E_Generische Typen können bei der Spezialisierung generischer Typen nicht als Parameter benutzt werden
 % When specializing a generic, only non-generic types can be used as parameters.
 % When specializing a generic, only non-generic types can be used as parameters.
 parser_e_type_object_constants=03230_E_Konstanten eines Objekts, das ein VMT enthält, sind unzulässig
 parser_e_type_object_constants=03230_E_Konstanten eines Objekts, das ein VMT enthält, sind unzulässig
@@ -1245,13 +1257,13 @@ parser_e_only_virtual_methods_final=03256_E_Nur virtuelle Methoden können final
 parser_e_final_can_no_be_overridden=03257_E_Die finale Methode kann nicht überschrieben werden: "$1"
 parser_e_final_can_no_be_overridden=03257_E_Die finale Methode kann nicht überschrieben werden: "$1"
 % You are trying to \var{override} a virtual method of a parent class that does
 % You are trying to \var{override} a virtual method of a parent class that does
 % not exist.
 % not exist.
-parser_e_multiple_messages=03258_E_Pro Methode kann nur eine Nachricht verwendet werden.
+parser_e_multiple_messages=03258_E_Pro Methode kann nur eine Nachricht verwendet werden
 % It is not possible to associate multiple messages with a single method.
 % It is not possible to associate multiple messages with a single method.
 parser_e_invalid_enumerator_identifier=03259_E_Ungültiger Aufzählungsbezeichner: "$1"
 parser_e_invalid_enumerator_identifier=03259_E_Ungültiger Aufzählungsbezeichner: "$1"
 % Only "MoveNext" and "Current" enumerator identifiers are supported.
 % Only "MoveNext" and "Current" enumerator identifiers are supported.
 parser_e_enumerator_identifier_required=03260_E_Aufzählungsbezeichner notwendig
 parser_e_enumerator_identifier_required=03260_E_Aufzählungsbezeichner notwendig
 % "MoveNext" or "Current" identifier must follow the \var{enumerator} modifier.
 % "MoveNext" or "Current" identifier must follow the \var{enumerator} modifier.
-parser_e_enumerator_movenext_is_not_valid=03261_E_Die Aufzählungs-pattern-methode MoveNext ist ungültig. Die Methode muss eine Funktion mit Rückgabetyp Boolean und ohne notwendige Argumente sein.
+parser_e_enumerator_movenext_is_not_valid=03261_E_Die Aufzählungs-pattern-Methode "MoveNext" ist ungültig. Die Methode muss eine Funktion mit Rückgabetyp Boolean und ohne notwendige Argumente sein
 % "MoveNext" enumerator pattern method must be a function with Boolean return type and no required arguments
 % "MoveNext" enumerator pattern method must be a function with Boolean return type and no required arguments
 parser_e_enumerator_current_is_not_valid=03262_E_Die Aufzählungs-pattern-Eigenschaft "Current" ist ungültig. Die Eigenschaft benötigt einen "Getter"
 parser_e_enumerator_current_is_not_valid=03262_E_Die Aufzählungs-pattern-Eigenschaft "Current" ist ungültig. Die Eigenschaft benötigt einen "Getter"
 % "Current" enumerator pattern property must have a getter
 % "Current" enumerator pattern property must have a getter
@@ -1398,16 +1410,16 @@ parser_e_forward_intf_declaration_must_be_resolved=03298_E_Die Vorwärts-Deklara
 parser_e_no_record_published=03299_E_Record -Typen können keine öffentlichen Abschnitte (published sections) haben
 parser_e_no_record_published=03299_E_Record -Typen können keine öffentlichen Abschnitte (published sections) haben
 % Published sections can be used only inside classes.
 % Published sections can be used only inside classes.
 parser_e_no_destructor_in_records=03300_E_Destruktoren sind in Records und Helfern nicht erlaubt
 parser_e_no_destructor_in_records=03300_E_Destruktoren sind in Records und Helfern nicht erlaubt
-% Destructor declarations aren't allowed in records or helpers.
+% Destructor declarations are not allowed in records or helpers.
 parser_e_class_methods_only_static_in_records=03301_E_Klassenmethoden müssen in Records statisch sein
 parser_e_class_methods_only_static_in_records=03301_E_Klassenmethoden müssen in Records statisch sein
-% Class methods declarations aren't allowed in records without static modifier.
+% Class methods declarations are not allowed in records without static modifier.
 % Records have no inheritance and therefore non static class methods have no sence for them.
 % Records have no inheritance and therefore non static class methods have no sence for them.
 parser_e_no_parameterless_constructor_in_records=03302_E_Konstruktoren ohne Parameter sind in Records und Record/Typhelfern nicht erlaubt
 parser_e_no_parameterless_constructor_in_records=03302_E_Konstruktoren ohne Parameter sind in Records und Record/Typhelfern nicht erlaubt
 % Constructor declarations with no arguments aren't allowed in records or record/type helpers.
 % Constructor declarations with no arguments aren't allowed in records or record/type helpers.
 parser_e_at_least_one_argument_must_be_of_type=03303_E_Entweder das Ergebnis oder mindestens ein Parameter müssen vom Typ "$1" sein
 parser_e_at_least_one_argument_must_be_of_type=03303_E_Entweder das Ergebnis oder mindestens ein Parameter müssen vom Typ "$1" sein
 % It is required that either the result of the routine or at least one of its parameters be of the specified type.
 % It is required that either the result of the routine or at least one of its parameters be of the specified type.
 % For example class operators either take an instance of the structured type in which they are defined, or they return one.
 % For example class operators either take an instance of the structured type in which they are defined, or they return one.
-parser_e_cant_use_type_parameters_here=03304_E_Typ-Parameter können initialization/finalization erfordern - Sie können deshalb nicht in varianten Rekords verwendet werden
+parser_e_cant_use_type_parameters_here=03304_E_Typ-Parameter können initialization/finalization erfordern - Sie können deshalb nicht in varianten Records verwendet werden
 % Type parameters may be specialized with types which (e.g. \var{ansistring}) need initialization/finalization
 % Type parameters may be specialized with types which (e.g. \var{ansistring}) need initialization/finalization
 % code which is implicitly generated by the compiler. 
 % code which is implicitly generated by the compiler. 
 parser_e_externals_no_section=03305_E_"external" deklarierte Variablen dürfen nicht in einer "custom section" sein
 parser_e_externals_no_section=03305_E_"external" deklarierte Variablen dürfen nicht in einer "custom section" sein
@@ -1415,12 +1427,12 @@ parser_e_externals_no_section=03305_E_"external" deklarierte Variablen dürfen n
 parser_e_section_no_locals=03306_E_Nicht-statische und nicht-globale Variablen dürfen keine Direktive "section" haben
 parser_e_section_no_locals=03306_E_Nicht-statische und nicht-globale Variablen dürfen keine Direktive "section" haben
 % A variable placed in a custom section is always statically allocated so it must be either a static or global variable.
 % A variable placed in a custom section is always statically allocated so it must be either a static or global variable.
 parser_e_not_allowed_in_helper=03307_E_"$1" ist in Helfertypen nicht erlaubt
 parser_e_not_allowed_in_helper=03307_E_"$1" ist in Helfertypen nicht erlaubt
-% Some directives and specifiers like "virtual", "dynamic", "override" aren't
+% Some directives and specifiers like "virtual", "dynamic", "override" are not
 % allowed inside helper types in mode ObjFPC (they are ignored in mode Delphi),
 % allowed inside helper types in mode ObjFPC (they are ignored in mode Delphi),
 % because they have no meaning within helpers. Also "abstract" isn't allowed in
 % because they have no meaning within helpers. Also "abstract" isn't allowed in
 % either mode.
 % either mode.
 parser_e_no_class_constructor_in_helpers=03308_E_Klassenkonstruktoren sind in Helfern nicht erlaubt
 parser_e_no_class_constructor_in_helpers=03308_E_Klassenkonstruktoren sind in Helfern nicht erlaubt
-% Class constructor declarations aren't allowed in helpers.
+% Class constructor declarations are not allowed in helpers.
 parser_e_inherited_not_in_record=03309_E_"inherited" ist in einem Record nicht erlaubt
 parser_e_inherited_not_in_record=03309_E_"inherited" ist in einem Record nicht erlaubt
 % As records don't suppport inheritance the use of "inherited" is prohibited for
 % As records don't suppport inheritance the use of "inherited" is prohibited for
 % these as well as for record helpers (in mode "Delphi" only).
 % these as well as for record helpers (in mode "Delphi" only).
@@ -1438,7 +1450,7 @@ parser_e_implements_no_mapping=03313_E_Das Interface "$1" kann keine Methoden-Au
 parser_e_invalid_codepage=03314_E_Ungültige Codepage
 parser_e_invalid_codepage=03314_E_Ungültige Codepage
 % When declaring a string with a given codepage, the range of valid codepages values is limited
 % When declaring a string with a given codepage, the range of valid codepages values is limited
 % to 0 to 65535.
 % to 0 to 65535.
-parser_e_final_only_const_var=03315_E_Nur Felder (var-Sektionen) und Konstanten können in Object-Typen final sein
+parser_e_final_only_const_var=03315_E_Nur Felder (var-Sektionen) und Konstanten können in Objekt-Typen final sein
 % A final (class) field must be assigned a single value in the (class) constructor, and cannot
 % A final (class) field must be assigned a single value in the (class) constructor, and cannot
 % be overwritten afterwards. A final (typed) constant is read-only.
 % be overwritten afterwards. A final (typed) constant is read-only.
 parser_e_final_only_external=03316_E_Finale Felder werden derzeit nur in externen Klassen unterstützt
 parser_e_final_only_external=03316_E_Finale Felder werden derzeit nur in externen Klassen unterstützt
@@ -1465,7 +1477,7 @@ parser_e_jvm_invalid_virtual_constructor_call=03321_E_Einen virtuellen Konstrukt
 % for the current instance inside another constructor.
 % for the current instance inside another constructor.
 parser_e_method_lower_visibility=03322_E_Die überschreibende Method "$1" kann keine niedrigere Sichtbarkeit ($2) haben als in der Elternklasse $3 ($4)
 parser_e_method_lower_visibility=03322_E_Die überschreibende Method "$1" kann keine niedrigere Sichtbarkeit ($2) haben als in der Elternklasse $3 ($4)
 % The JVM does not allow lowering the visibility of an overriding method.
 % The JVM does not allow lowering the visibility of an overriding method.
-parser_e_nostackframe_without_assembler=03323_E_Prozedur/Funktion  mit der Aufrufoption NOSTACKFRAME aber ohne ASSEMBLER deklariert
+parser_e_nostackframe_without_assembler=03323_E_Prozedur/Funktion  mit der Aufrufoption NOSTACKFRAME aber ohne ASSEMBLER deklariert 
 % nostackframe call modifier is supposed to be used in conjunction with assembler.
 % nostackframe call modifier is supposed to be used in conjunction with assembler.
 parser_e_nostackframe_with_locals=03324_E_Prozedur/Funktion  mit der Aufrufoption NOSTACKFRAME deklariert, aber die Größe des lokalen Stack ist $1
 parser_e_nostackframe_with_locals=03324_E_Prozedur/Funktion  mit der Aufrufoption NOSTACKFRAME deklariert, aber die Größe des lokalen Stack ist $1
 % nostackframe call modifier used without assembler modifier
 % nostackframe call modifier used without assembler modifier
@@ -1509,6 +1521,23 @@ parser_e_dir_not_allowed=03333_E_Direktive "$1" ist hier nicht erlaubt
 % is not allowed for instance methods or class operators.
 % is not allowed for instance methods or class operators.
 parser_e_no_assembler_in_generic=03334_E_Assemblerblöcke sind innerhalb von "generics" nicht erlaubt
 parser_e_no_assembler_in_generic=03334_E_Assemblerblöcke sind innerhalb von "generics" nicht erlaubt
 % The use of assembler blocks/routines is not allowed inside generics.
 % The use of assembler blocks/routines is not allowed inside generics.
+parser_e_property_only_sgr=03335_E_Eigenschaften sind nur statisch, global oder in strukturierten Typen erlaubt
+% Properties cannot be declared local, only global, using the static
+% directive or inside structured types.
+parser_e_overloaded_have_same_mangled_name=03336_E_Überladene Routinen haben den gleichen "mangled" Namen
+% Some platforms, such as the JVM platform, encode the parameters in the routine name in
+% a prescribed way, and this encoding may map different Pascal types to the same encoded
+% (a.k.a.\ ``mangled'') name. This error can only be solved by removing or changing the
+% conflicting definitions' parameter declarations or routine names.
+parser_e_default_value_val_const=03337_E_Voreinstellungswerte können nur für value, const und constref Parameter spezifiziert werden
+% A default parameter value allows you to not specify a value for this parameter
+% when calling the routine, and the compiler will instead pass the specified
+% default (constant) value. As a result, default values can only be specified
+% for parameters that can accept constant values.
+parser_w_ptr_type_ignored=03338_W_Zeigertyp "$1" ignoriert
+% 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
+% declared on a non-x86 platform.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -1516,7 +1545,7 @@ parser_e_no_assembler_in_generic=03334_E_Assemblerblöcke sind innerhalb von "ge
 #
 #
 # Type Checking
 # Type Checking
 #
 #
-# 04120 is the last used one
+# 04122 is the last used one
 #
 #
 % \section{Type checking errors}
 % \section{Type checking errors}
 % This section lists all errors that can occur when type checking is
 % This section lists all errors that can occur when type checking is
@@ -1627,14 +1656,14 @@ type_e_wrong_type_in_array_constructor=04024_E_Falscher Typ "$1" im Array-Konstr
 type_e_wrong_parameter_type=04025_E_Inkompatible Typen für Argument Nr. #$1: habe $2 erhalten, aber $3 erwartet
 type_e_wrong_parameter_type=04025_E_Inkompatible Typen für Argument Nr. #$1: habe $2 erhalten, aber $3 erwartet
 % You are trying to pass an invalid type for the specified parameter.
 % You are trying to pass an invalid type for the specified parameter.
 type_e_no_method_and_procedure_not_compatible=04026_E_Methode (Variable) und Prozedur (Variable) sind nicht kompatibel
 type_e_no_method_and_procedure_not_compatible=04026_E_Methode (Variable) und Prozedur (Variable) sind nicht kompatibel
-% You can't assign a method to a procedure variable or a procedure to a
+% You cannot assign a method to a procedure variable or a procedure to a
 % method pointer.
 % method pointer.
 type_e_wrong_math_argument=04027_E_Unzulässige Konstante an interne Algebrafunktion übergeben
 type_e_wrong_math_argument=04027_E_Unzulässige Konstante an interne Algebrafunktion übergeben
 % The constant argument passed to a \var{ln} or \var{sqrt} function is out of
 % The constant argument passed to a \var{ln} or \var{sqrt} function is out of
 % the definition range of these functions.
 % the definition range of these functions.
 type_e_no_addr_of_constant=04028_E_Von Konstanten kann keine Adresse bestimmt werden
 type_e_no_addr_of_constant=04028_E_Von Konstanten kann keine Adresse bestimmt werden
-% It's not possible to get the address of a constant, because they
-% aren't stored in memory, you can try making it a typed constant. This error
+% It is not possible to get the address of a constant, because they
+% are not stored in memory, you can try making it a typed constant. This error
 % can also be displayed if you try to pass a property to a var parameter.
 % can also be displayed if you try to pass a property to a var parameter.
 type_e_argument_cant_be_assigned=04029_E_An das Argument kann nichts zugewiesen werden
 type_e_argument_cant_be_assigned=04029_E_An das Argument kann nichts zugewiesen werden
 % Only expressions which can be on the left side of an
 % Only expressions which can be on the left side of an
@@ -1723,14 +1752,14 @@ type_h_in_range_check=04047_H_Der linke Operand des IN Operators sollte byte Gr
 % currently only supports a left operand which fits within a byte. In the case of
 % currently only supports a left operand which fits within a byte. In the case of
 % enumerations, the size of an element of an enumeration can be controlled with
 % enumerations, the size of an element of an enumeration can be controlled with
 % the \var{\{\$PACKENUM\}} or \var{\{\$Zn\}} switches.
 % the \var{\{\$PACKENUM\}} or \var{\{\$Zn\}} switches.
-type_w_smaller_possible_range_check=04048_W_Unpassende Typgrössen, Gefahr des Datenverlusts oder Bereichsprüfungsfehlers
+type_w_smaller_possible_range_check=04048_W_Unpassende Typgrössen, Gefahr des Datenverlusts oder der Bereichsüberschreitung
 % There is an assignment to a smaller type than the source type. This means that
 % There is an assignment to a smaller type than the source type. This means that
 % this may cause a range-check error, or may lead to possible loss of data.
 % this may cause a range-check error, or may lead to possible loss of data.
-type_h_smaller_possible_range_check=04049_H_Unpassende Typgrössen, Gefahr des Datenverlusts oder Bereichsprüfungsfehlers
+type_h_smaller_possible_range_check=04049_H_Unpassende Typgrössen, Gefahr des Datenverlusts oder der Bereichsüberschreitung
 % There is an assignment to a smaller type than the source type. This means that
 % There is an assignment to a smaller type than the source type. This means that
 % this may cause a range-check error, or may lead to possible loss of data.
 % this may cause a range-check error, or may lead to possible loss of data.
 type_e_cant_take_address_of_abstract_method=04050_E_Die Adresse einer abstrakten Methode kann nicht verwendet werden
 type_e_cant_take_address_of_abstract_method=04050_E_Die Adresse einer abstrakten Methode kann nicht verwendet werden
-% An abstract method has no body, so the address of an abstract method can't be taken.
+% An abstract method has no body, so the address of an abstract method cannot be taken.
 type_e_assignment_not_allowed=04051_E_Zuweisungen auf formale Parameter und offene Arrays sind nicht möglich
 type_e_assignment_not_allowed=04051_E_Zuweisungen auf formale Parameter und offene Arrays sind nicht möglich
 % You are trying to assign a value to a formal (untyped var, const or out)
 % You are trying to assign a value to a formal (untyped var, const or out)
 % parameter, or to an open array.
 % parameter, or to an open array.
@@ -1774,13 +1803,13 @@ type_e_no_packed_inittable=04064_E_Elemente von packed Arrays können nicht von
 % (such as ansistrings, or records which contain ansistrings) is not yet implemented.
 % (such as ansistrings, or records which contain ansistrings) is not yet implemented.
 type_e_no_const_packed_record=04065_E_Konstante packed Records und Objekte werden noch nicht unterstützt
 type_e_no_const_packed_record=04065_E_Konstante packed Records und Objekte werden noch nicht unterstützt
 % You cannot declare a (bit)packed array as a typed constant at this time.
 % You cannot declare a (bit)packed array as a typed constant at this time.
-type_w_untyped_arithmetic_unportable=04066_W_Arithmetik "$1" mit typenlosem Pointer ist nicht portierbar nach {$T+}, schlage typecast vor
+type_w_untyped_arithmetic_unportable=04066_W_Arithmetik "$1" mit typenlosem Zeiger ist nicht portierbar nach {$T+}, schlage typecast vor
 % Addition/subtraction from an untyped pointer may work differently in \var{\{\$T+\}}.
 % Addition/subtraction from an untyped pointer may work differently in \var{\{\$T+\}}.
 % Use a typecast to a typed pointer.
 % Use a typecast to a typed pointer.
 type_e_cant_take_address_of_local_subroutine=04076_E_Die Address einer Subroutine, die als local markiert ist, kann nicht verwendet werden
 type_e_cant_take_address_of_local_subroutine=04076_E_Die Address einer Subroutine, die als local markiert ist, kann nicht verwendet werden
-% The address of a subroutine marked as local can't be taken.
+% The address of a subroutine marked as local cannot be taken.
 type_e_cant_export_local=04077_E_Eine Subroutine, die aus einer Unit als local markiert ist, kann nicht exportiert werden
 type_e_cant_export_local=04077_E_Eine Subroutine, die aus einer Unit als local markiert ist, kann nicht exportiert werden
-% A subroutine marked as local can't be exported from a unit.
+% A subroutine marked as local cannot be exported from a unit.
 type_e_not_automatable=04078_E_Typ "$1" ist nicht "automatable"
 type_e_not_automatable=04078_E_Typ "$1" ist nicht "automatable"
 % Only byte, integer, longint, smallint, currency, single, double, ansistring,
 % Only byte, integer, longint, smallint, currency, single, double, ansistring,
 % widestring, tdatetime, variant, olevariant, wordbool and all interfaces are automatable.
 % widestring, tdatetime, variant, olevariant, wordbool and all interfaces are automatable.
@@ -1793,7 +1822,7 @@ type_h_convert_sub_operands_to_prevent_overflow=04080_H_Konvertierung des Operan
 type_h_convert_mul_operands_to_prevent_overflow=04081_H_Konvertierung des Operanden "$1" vor der Multiplikation könnte Überlauf Fehler verhindern
 type_h_convert_mul_operands_to_prevent_overflow=04081_H_Konvertierung des Operanden "$1" vor der Multiplikation könnte Überlauf Fehler verhindern
 % Multiplying two types can cause overflow errors. Since you are converting the result to a larger type, you
 % Multiplying two types can cause overflow errors. Since you are converting the result to a larger type, you
 % could prevent such errors by converting the operands to this type before doing the multiplication.
 % could prevent such errors by converting the operands to this type before doing the multiplication.
-type_w_pointer_to_signed=04082_W_Die Konvertierung von Pointern in einen Integertyp mit Vorzeichen kann zu falschen Ergebnissen bei Vergleichen und zu Bereichsüberschreitungen führen; verwenden sie statt dessen besser einen Typ ohne Vorzeichen
+type_w_pointer_to_signed=04082_W_Die Konvertierung von Zeigern in einen Integertyp mit Vorzeichen kann zu falschen Ergebnissen bei Vergleichen und zu Bereichsüberschreitungen führen; verwenden sie statt dessen besser einen Typ ohne Vorzeichen
 % The virtual address space on 32-bit machines runs from \$00000000 to \$ffffffff.
 % The virtual address space on 32-bit machines runs from \$00000000 to \$ffffffff.
 % Many operating systems allow you to allocate memory above \$80000000.
 % Many operating systems allow you to allocate memory above \$80000000.
 % For example both \windows and \linux allow pointers in the range \$0000000 to \$bfffffff.
 % For example both \windows and \linux allow pointers in the range \$0000000 to \$bfffffff.
@@ -1940,6 +1969,12 @@ type_e_invalid_default_value=04119_E_Der Defaultwert für einen Parameter des Ty
 % arrays and TP-style objects, cannot have a default value.
 % arrays and TP-style objects, cannot have a default value.
 type_e_type_not_allowed_for_type_helper=04120_E_Typ "$1" kann durch einen Typhelfer nicht erweitert werden
 type_e_type_not_allowed_for_type_helper=04120_E_Typ "$1" kann durch einen Typhelfer nicht erweitert werden
 % Types like procedural variables cannot be extended by type helpers
 % Types like procedural variables cannot be extended by type helpers
+type_e_procedure_must_be_far=04121_E_Prozedur oder Funktion muss weit ("far") sein, damit seine Adresse verwendet werden kann: "$1"
+% In certain i8086 memory models (medium, large and huge), procedures and functions
+% have to be declared 'far' in order to allow their address to be taken.
+type_w_instance_abstract_class=04122_-W_Erzeugung einer Instanz der abstrakten Klasse "$1"
+% The specified class is declared as \var{abstract} and thus no instance of this class
+% should be created. This is merely a warning for Delphi compatibility.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -1947,7 +1982,7 @@ type_e_type_not_allowed_for_type_helper=04120_E_Typ "$1" kann durch einen Typhel
 #
 #
 # Symtable
 # Symtable
 #
 #
-# 05087 is the last used one
+# 05088 is the last used one
 #
 #
 % \section{Symbol handling}
 % \section{Symbol handling}
 % This section lists all the messages that concern the handling of symbols.
 % This section lists all the messages that concern the handling of symbols.
@@ -1984,7 +2019,7 @@ sym_e_forward_type_not_resolved=05009_E_Forward-Typ "$1" nicht gefunden
 % The compiler encountered an unknown type.
 % The compiler encountered an unknown type.
 sym_e_only_static_in_static=05010_E_Nur statische Variablen können in statischen oder äusseren Methoden verwendet werden
 sym_e_only_static_in_static=05010_E_Nur statische Variablen können in statischen oder äusseren Methoden verwendet werden
 % A static method of an object can only access static variables.
 % A static method of an object can only access static variables.
-sym_e_type_must_be_rec_or_object_or_class=05012_E_Record or object or class type expected
+sym_e_type_must_be_rec_or_object_or_class=05012_E_Record-, Objekt- oder Klassen-Typ erwartet
 % The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 % The variable or expression isn't of the type \var{record} or \var{object} or \var{class}.
 sym_e_no_instance_of_abstract_object=05013_E_Instanzen von Klassen oder Objekten mit abstrakten Methoden sind unzulässig
 sym_e_no_instance_of_abstract_object=05013_E_Instanzen von Klassen oder Objekten mit abstrakten Methoden sind unzulässig
 % You are trying to generate an instance of a class which has an abstract
 % You are trying to generate an instance of a class which has an abstract
@@ -1998,7 +2033,7 @@ sym_e_ill_label_decl=05016_E_Ungültige Label-Deklaration
 % procedure or function.
 % procedure or function.
 sym_e_goto_and_label_not_supported=05017_E_GOTO und LABEL werden nicht unterstützt (verwenden Sie den Schalter -Sg)
 sym_e_goto_and_label_not_supported=05017_E_GOTO und LABEL werden nicht unterstützt (verwenden Sie den Schalter -Sg)
 % You must use the -Sg switch to compile a program which has \var{label}s
 % You must use the -Sg switch to compile a program which has \var{label}s
-% and \var{goto} statements. By default, \var{label} and \var{goto} aren't
+% and \var{goto} statements. By default, \var{label} and \var{goto} are not
 % supported.
 % supported.
 sym_e_label_not_found=05018_E_Label nicht gefunden
 sym_e_label_not_found=05018_E_Label nicht gefunden
 % A \var{goto label} was encountered, but the label wasn't declared.
 % A \var{goto label} was encountered, but the label wasn't declared.
@@ -2213,6 +2248,8 @@ sym_e_no_matching_inherited_parameterless_constructor=05086_E_Kann den voreinges
 % In this case you must add a valid constructor yourself.
 % In this case you must add a valid constructor yourself.
 sym_d_adding_helper_for=05087_D_Helfer für $1 hinzugefügt
 sym_d_adding_helper_for=05087_D_Helfer für $1 hinzugefügt
 % A helper for the mentioned type is added to the current scope
 % A helper for the mentioned type is added to the current scope
+sym_e_param_list=05088_E_Deklaration gefunden: $1
+% This message shows all overloaded declarations in case of an error.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2220,7 +2257,7 @@ sym_d_adding_helper_for=05087_D_Helfer für $1 hinzugefügt
 #
 #
 # Codegenerator
 # Codegenerator
 #
 #
-# 06052 is the last used one
+# 06056 is the last used one
 #
 #
 % \section{Code generator messages}
 % \section{Code generator messages}
 % This section lists all messages that can be displayed if the code
 % This section lists all messages that can be displayed if the code
@@ -2331,12 +2368,12 @@ cg_e_break_not_allowed=06044_E_BREAK nicht zulässig
 % You're trying to use \var{break} outside a loop construction.
 % You're trying to use \var{break} outside a loop construction.
 cg_e_continue_not_allowed=06045_E_CONTINUE nicht zulässig
 cg_e_continue_not_allowed=06045_E_CONTINUE nicht zulässig
 % You're trying to use \var{continue} outside a loop construction.
 % You're trying to use \var{continue} outside a loop construction.
-cg_f_unknown_compilerproc=06046_F_Unbekannte Compiler-Prozedur "$1". Überprüfe, ob die korrekte Laufzeit-Bibliothek verwendet wird.
+cg_f_unknown_compilerproc=06046_F_Unbekannte Compiler-Prozedur "$1". Überprüfe, ob die korrekte Laufzeit-Bibliothek verwendet wird
 % The compiler expects that the runtime library contains certain subroutines. If you see this error
 % The compiler expects that the runtime library contains certain subroutines. If you see this error
 % and you didn't change the runtime library code, it's very likely that the runtime library
 % and you didn't change the runtime library code, it's very likely that the runtime library
 % you're using doesn't match the compiler in use. If you changed the runtime library this error means
 % you're using doesn't match the compiler in use. If you changed the runtime library this error means
 % that you removed a subroutine which the compiler needs for internal use.
 % that you removed a subroutine which the compiler needs for internal use.
-cg_f_unknown_system_type=06047_F_Systemtyp "$1" konnte nicht gefunden werden. Überprüfe ob die korrekte Laufzeit-Bibliothek verwendet wird.
+cg_f_unknown_system_type=06047_F_Systemtyp "$1" konnte nicht gefunden werden. Überprüfe, ob die korrekte Laufzeit-Bibliothek verwendet wird
 % The compiler expects that the runtime library contains certain type definitions. If you see this error
 % The compiler expects that the runtime library contains certain type definitions. If you see this error
 % and you didn't change the runtime library code, it's very likely that the runtime library
 % and you didn't change the runtime library code, it's very likely that the runtime library
 % you're using doesn't match the compiler in use. If you changed the runtime library this error means
 % you're using doesn't match the compiler in use. If you changed the runtime library this error means
@@ -2364,6 +2401,10 @@ cg_e_mod_only_defined_for_pos_quotient=06054_E_Im ISO-Modus ist der Operator mod
 % In ISO pascal, only positive values are allowed for the quotient: \var{n mod m} is only valid if \var{m>0}.
 % In ISO pascal, only positive values are allowed for the quotient: \var{n mod m} is only valid if \var{m>0}.
 cg_d_autoinlining=06055_DL_Automatisches inlining: $1
 cg_d_autoinlining=06055_DL_Automatisches inlining: $1
 % Due to auto inlining turned on, the compiler auto inlines this subroutine.
 % Due to auto inlining turned on, the compiler auto inlines this subroutine.
+cg_e_function_not_support_by_selected_instruction_set=06056_E_Die verwendete Funktion wird vom ausgewählten Instruction-Set nicht unterstützt: $1
+% Some functions cannot be implemented efficiently for certain instruction sets, one example is fused multiply/add.
+% To avoid very inefficient code, the compiler complains in this case, so either select another instruction set
+% or replace the function call by alternative code
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2378,35 +2419,35 @@ asmr_d_start_reading=07000_DL_Starte $1 Stil Assembler Parsen
 asmr_d_finish_reading=07001_DL_Beende $1 Stil Assembler Parsen
 asmr_d_finish_reading=07001_DL_Beende $1 Stil Assembler Parsen
 % This informs you that an assembler block has finished.
 % This informs you that an assembler block has finished.
 asmr_e_none_label_contain_at=07002_E_Nicht-Label Bezeichner enthält @
 asmr_e_none_label_contain_at=07002_E_Nicht-Label Bezeichner enthält @
-% A identifier which isn't a label can't contain a @.
+% A identifier which isn't a label cannot contain a @.
 asmr_e_building_record_offset=07004_E_Fehler beim Ermitteln des Recordoffsets
 asmr_e_building_record_offset=07004_E_Fehler beim Ermitteln des Recordoffsets
 % There has an error occured while building the offset of a record/object
 % There has an error occured 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 ohne Bezeicner verwendet
 asmr_e_offset_without_identifier=07005_E_OFFSET ohne Bezeicner verwendet
-% You can only use OFFSET with an identifier. Other syntaxes aren't
+% You can only use OFFSET with an identifier. Other syntaxes are not
 % supported
 % supported
 asmr_e_type_without_identifier=07006_E_TYPE verwendet ohne Bezeichner
 asmr_e_type_without_identifier=07006_E_TYPE verwendet ohne Bezeichner
-% You can only use TYPE with an identifier. Other syntaxes aren't
+% You can only use TYPE with an identifier. Other syntaxes are not
 % supported
 % supported
 asmr_e_no_local_or_para_allowed=07007_E_Lokale Variable oder Parameter können hier nicht verwendet werden
 asmr_e_no_local_or_para_allowed=07007_E_Lokale Variable oder Parameter können hier nicht verwendet werden
-% You can't use a local variable or parameter here, mostly because the
+% You cannot use a local variable or parameter here, mostly because the
 % addressing of locals and parameters is done using the %ebp register so the
 % addressing of locals and parameters is done using the %ebp register so the
-% address can't be get directly.
+% address cannot be get directly.
 asmr_e_need_offset=07008_E_Hier muss OFFSET verwendet werden
 asmr_e_need_offset=07008_E_Hier muss OFFSET verwendet werden
 % You need to use OFFSET <id> here to get the address of the identifier.
 % You need to use OFFSET <id> here to get the address of the identifier.
 asmr_e_need_dollar=07009_E_Hier muss "$" verwendet werden
 asmr_e_need_dollar=07009_E_Hier muss "$" verwendet werden
 % You need to use $<id> here to get the address of the identifier.
 % You need to use $<id> here to get the address of the identifier.
 asmr_e_cant_have_multiple_relocatable_symbols=07010_E_Verwendung von mehreren verschiebbaren Symbolen nicht möglich
 asmr_e_cant_have_multiple_relocatable_symbols=07010_E_Verwendung von mehreren verschiebbaren Symbolen nicht möglich
-% You can't have more than one relocatable symbol (variable/typed constant)
+% You cannot have more than one relocatable symbol (variable/typed constant)
 % in one argument.
 % in one argument.
 asmr_e_only_add_relocatable_symbol=07011_E_Verschiebbares Symbol kann nur addiert werden
 asmr_e_only_add_relocatable_symbol=07011_E_Verschiebbares Symbol kann nur addiert werden
-% Relocatable symbols (variable/typed constant) can't be used with other
+% Relocatable symbols (variable/typed constant) cannot be used with other
 % operators. Only addition is allowed.
 % operators. Only addition is allowed.
 asmr_e_invalid_constant_expression=07012_E_Ungültiger Konstantenausdruck
 asmr_e_invalid_constant_expression=07012_E_Ungültiger Konstantenausdruck
 % There is an error in the constant expression.
 % There is an error in the constant expression.
 asmr_e_relocatable_symbol_not_allowed=07013_E_Verschiebbares Symbol ist nicht zulässig
 asmr_e_relocatable_symbol_not_allowed=07013_E_Verschiebbares Symbol ist nicht zulässig
-% You can't use a relocatable symbol (variable/typed constant) here.
+% You cannot use a relocatable symbol (variable/typed constant) here.
 asmr_e_invalid_reference_syntax=07014_E_Ungültige Verweis-Syntax
 asmr_e_invalid_reference_syntax=07014_E_Ungültige Verweis-Syntax
 % There is an error in the reference.
 % There is an error in the reference.
 asmr_e_local_para_unreachable=07015_E_Sie können "$1" von diesem Code aus nicht erreichen
 asmr_e_local_para_unreachable=07015_E_Sie können "$1" von diesem Code aus nicht erreichen
@@ -2414,7 +2455,7 @@ asmr_e_local_para_unreachable=07015_E_Sie können "$1" von diesem Code aus nicht
 % of a higher level procedure in assembler code (except for
 % of a higher level procedure in assembler code (except for
 % local assembler code without parameter nor locals).
 % local assembler code without parameter nor locals).
 asmr_e_local_label_not_allowed_as_ref=07016_E_Lokale Symbole/Labels sind nicht als Referenz zulässig
 asmr_e_local_label_not_allowed_as_ref=07016_E_Lokale Symbole/Labels sind nicht als Referenz zulässig
-% You can't use local symbols/labels as references
+% You cannot use local symbols/labels as references
 asmr_e_wrong_base_index=07017_E_Ungültige Verwendung von Basis- und Index-Registern
 asmr_e_wrong_base_index=07017_E_Ungültige Verwendung von Basis- und Index-Registern
 % There is an error with the base and index register, they are
 % There is an error with the base and index register, they are
 % probably incorrect
 % probably incorrect
@@ -2483,7 +2524,7 @@ asmr_e_invalid_opcode_and_operand=07048_E_Ungültige Kombination von Opcode und
 asmr_e_syn_operand=07049_E_Assembler Syntaxfehler im Operanden
 asmr_e_syn_operand=07049_E_Assembler Syntaxfehler im Operanden
 asmr_e_syn_constant=07050_E_Assembler Syntaxfehler in Konstanten
 asmr_e_syn_constant=07050_E_Assembler Syntaxfehler in Konstanten
 asmr_e_invalid_string_expression=07051_E_Ungültiger Stringausdruck
 asmr_e_invalid_string_expression=07051_E_Ungültiger Stringausdruck
-asmr_w_const32bit_for_address=07052_W_Konstante mit Symbol $1 für Adresse erzeugt, die kein Pointer ist
+asmr_w_const32bit_for_address=07052_W_Konstante mit Symbol $1 für Adresse erzeugt, die kein Zeiger ist
 % A constant expression represents an address which does not fit
 % A constant expression represents an address which does not fit
 % into a pointer. The address is probably incorrect
 % into a pointer. The address is probably incorrect
 asmr_e_unknown_opcode=07053_E_Unbekannter Opcode $1
 asmr_e_unknown_opcode=07053_E_Unbekannter Opcode $1
@@ -2676,7 +2717,7 @@ asmr_e_invalid_ref_register=07125_E_Ungültiges Register in Speicherreferenzausd
 #
 #
 # Assembler/binary writers
 # Assembler/binary writers
 #
 #
-# 08022 is the last used one
+# 08026 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
@@ -2717,11 +2758,14 @@ asmw_e_prologue_too_large=08024_E_Der Funktionsprolog überschreitet 255 Byte
 asmw_e_handlerdata_no_handler=08025_E_".seh_handlerdata"-Direktive ohne vorangehendes ".seh_handler"
 asmw_e_handlerdata_no_handler=08025_E_".seh_handlerdata"-Direktive ohne vorangehendes ".seh_handler"
 % x86_64-win64: If .seh_handlerdata directive is used, then a .seh_handler directive must be
 % x86_64-win64: If .seh_handlerdata directive is used, then a .seh_handler directive must be
 % present earlier in the same function.
 % present earlier in the same function.
+asmw_f_too_many_relocations=08026_F_Relocationzähler für Sektion $1 übersteigt 65535
+% Legacy COFF targets limit number of relocations per section to 65535 because they use a 2-byte field
+% to store the relocation count. Targets using newer PECOFF format do not have this limitation.
 
 
 #
 #
 # Executing linker/assembler
 # Executing linker/assembler
 #
 #
-# 09034 is the last used one
+# 09035 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 %
 %
@@ -2734,13 +2778,13 @@ exec_w_source_os_redefined=09000_W_Quellbetriebssystem wurde neu definiert
 exec_i_assembling_pipe=09001_I_Assembliere (pipe) $1
 exec_i_assembling_pipe=09001_I_Assembliere (pipe) $1
 % Assembling using a pipe to an external assembler.
 % Assembling using a pipe to an external assembler.
 exec_d_cant_create_asmfile=09002_E_Kann Assemblerdatei nicht erzeugen: $1
 exec_d_cant_create_asmfile=09002_E_Kann Assemblerdatei nicht erzeugen: $1
-% The mentioned file can't be created. Check if you have
+% The mentioned file cannot be created. Check if you have
 % access permissions to create this file.
 % access permissions to create this file.
 exec_e_cant_create_objectfile=09003_E_Kann Objektdatei nicht erzeugen: $1 (Fehlercode: $2)
 exec_e_cant_create_objectfile=09003_E_Kann Objektdatei nicht erzeugen: $1 (Fehlercode: $2)
-% The mentioned file can't be created. Check if you have
+% The mentioned file cannot be created. Check if you have
 % got access permissions to create this file.
 % got access permissions to create this file.
 exec_e_cant_create_archivefile=09004_E_Kann Archivdatei nicht erzeugen: $1
 exec_e_cant_create_archivefile=09004_E_Kann Archivdatei nicht erzeugen: $1
-% The mentioned file can't be created. Check if you have
+% The mentioned file cannot be created. Check if you have
 % access permissions to create this file.
 % access permissions to create this file.
 exec_e_assembler_not_found=09005_E_Assembler $1 nicht gefunden, schalte um zu externem Assemblieren
 exec_e_assembler_not_found=09005_E_Assembler $1 nicht gefunden, schalte um zu externem Assemblieren
 % The assembler program was not found. The compiler will produce a script that
 % The assembler program was not found. The compiler will produce a script that
@@ -2816,6 +2860,9 @@ exec_n_backquote_cat_file_not_found=09033_N_Die Datei "$1" wurde mit dem Kommand
 exec_w_init_file_not_found=09034_W_"$1" nicht gefunden; dies wird wahrscheinlich zu einem Fehler beim Linken führen
 exec_w_init_file_not_found=09034_W_"$1" nicht gefunden; dies wird wahrscheinlich zu einem Fehler beim Linken führen
 % The compiler adds certain startup code files to the linker only when they are found.
 % The compiler adds certain startup code files to the linker only when they are found.
 % If they are not found, they are not added and this might cause a linking failure.
 % If they are not found, they are not added and this might cause a linking failure.
+exec_e_static_lib_not_supported=09035_E_Statische Bibliotheken nicht unterstützt
+% Creating static libraries is not supported for this platform, because it was
+% not yet implemented in the compiler.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -2859,7 +2906,7 @@ execinfo_x_stackcommit=09134_X_Stack Bereich "committed": $1 Bytes
 % \begin{description}
 % \begin{description}
 link_f_executable_too_big=09200_F_Das Programm - Image ist für das Target $1 zu groß
 link_f_executable_too_big=09200_F_Das Programm - Image ist für das Target $1 zu groß
 % Fatal error when resulting executable is too big.
 % Fatal error when resulting executable is too big.
-link_w_32bit_absolute_reloc=09201_W_Object Daei "$1" enthält eine 32-bit absolute Relocation auf Symbol "$2".
+link_w_32bit_absolute_reloc=09201_W_Objektdatei "$1" enthält eine 32-bit absolute Relocation auf Symbol "$2".
 % Warning when 64-bit object file contains 32-bit absolute relocations.
 % Warning when 64-bit object file contains 32-bit absolute relocations.
 % In such case an executable image can be loaded into lower 4Gb of
 % In such case an executable image can be loaded into lower 4Gb of
 % address space only.
 % address space only.
@@ -3072,6 +3119,9 @@ unit_u_indirect_crc_changed=10062_U_Die CRC des indirekten Interface (Objekte/Kl
 % indirect CRC calculated for the unit (this is the CRC of all classes/objects/interfaces/$\ldots$
 % indirect CRC calculated for the unit (this is the CRC of all classes/objects/interfaces/$\ldots$
 % in the interfaces of units directly or indirectly used by this unit in the interface) has been changed after the
 % in the interfaces of units directly or indirectly used by this unit in the interface) has been changed after the
 % implementation has been parsed.
 % implementation has been parsed.
+unit_u_ppu_invalid_memory_model=10063_U_PPU ist für ein anderes i8086 Speichermodell kompiliert
+% This unit file was compiled for a different i8086 memory model and
+% cannot be read.
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -3079,7 +3129,7 @@ unit_u_indirect_crc_changed=10062_U_Die CRC des indirekten Interface (Objekte/Kl
 #
 #
 # Options
 # Options
 #
 #
-# 11053 is the last used one
+# 11057 is the last used one
 #
 #
 option_usage=11000_O_$1 [Optionen] <Eingabedatei> [Optionen]
 option_usage=11000_O_$1 [Optionen] <Eingabedatei> [Optionen]
 # BeginOfTeX
 # BeginOfTeX
@@ -3144,7 +3194,7 @@ option_obsolete_switch_use_new=11019_W_Sie benutzen den nun überholten Schalter
 % future, when the meaning of the switch may change.
 % future, when the meaning of the switch may change.
 option_switch_bin_to_src_assembler=11020_N_Schalte Assembler auf den Standard-Assembler-Quellcodeschreiber
 option_switch_bin_to_src_assembler=11020_N_Schalte Assembler auf den Standard-Assembler-Quellcodeschreiber
 % This notifies you that the assembler has been changed because you used the
 % This notifies you that the assembler has been changed because you used the
-% -a switch, which can't be used with a binary assembler writer.
+% -a switch, which cannot be used with a binary assembler writer.
 option_incompatible_asm=11021_W_Das gewählte Assembler-Ausgabeformat "$1" ist nicht mit "$2" kompatibel
 option_incompatible_asm=11021_W_Das gewählte Assembler-Ausgabeformat "$1" ist nicht mit "$2" kompatibel
 option_asm_forced=11022_W_Verwendung des Assemblers "$1" erzwungen
 option_asm_forced=11022_W_Verwendung des Assemblers "$1" erzwungen
 % The assembler output selected cannot generate
 % The assembler output selected cannot generate
@@ -3219,6 +3269,12 @@ option_illegal_fpu_eabihf=11052_E_Sie müssen beim Ziel EABIHF ABI einen der FPU
 % The EABIHF (VFP hardfloat) ABI target can only be used with VFP FPUs.
 % The EABIHF (VFP hardfloat) ABI target can only be used with VFP FPUs.
 option_w_unsupported_debug_format=11053_W_Das ausgewählte Debugformat wird auf dem aktuellen Ziel nicht unterstützt. Die aktuelle Einstellung wird beibehalten
 option_w_unsupported_debug_format=11053_W_Das ausgewählte Debugformat wird auf dem aktuellen Ziel nicht unterstützt. Die aktuelle Einstellung wird beibehalten
 % Not all targets support all debug formats (in particular, Stabs is not supported on 64 bit targets).
 % Not all targets support all debug formats (in particular, Stabs is not supported on 64 bit targets).
+option_missing_arg=11054_E_Argument für "$1" fehlt
+% Displayed when parameter must be followed by an argument.
+option_malformed_para=11055_E_Ungültiges Argument für Parameter: $1
+% Given argument is not valid for parameter.
+option_smart_link_requires_external_linker=11056_W_Smart-linking erfordert externen Linker
+option_com_files_require_tiny_model=11057_E_Das Erstellen von .COM Dateien wird für das aktuelle Speichermodell nicht unterstützt. Nur das winzige (tiny) Speichermodell unterstützt .COM Dateien
 %
 %
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
@@ -3326,6 +3382,9 @@ Unterstützte CPU Instruktionen:
 Unterstützte FPU Instruktionen:
 Unterstützte FPU Instruktionen:
   $FPUINSTRUCTIONSETS
   $FPUINSTRUCTIONSETS
 
 
+Unterstützte Inline-Assembler Modi:
+  $ASMMODES
+
 Unterstützte ABI Ziele:
 Unterstützte ABI Ziele:
   $ABITARGETS
   $ABITARGETS
 
 
@@ -3380,6 +3439,7 @@ option_help_pages=11025_[
 **1a_Lösche die erzeugte Assembler-Datei nicht
 **1a_Lösche die erzeugte Assembler-Datei nicht
 **2al_Liste Quellcode-Zeilen in der Assembler-Datei
 **2al_Liste Quellcode-Zeilen in der Assembler-Datei
 **2an_Liste "node info" in der Assembler-Datei (-dEXTDEBUG Compiler)
 **2an_Liste "node info" in der Assembler-Datei (-dEXTDEBUG Compiler)
+**2ao_Füge eine zusätzliche Option zum Aufruf des externen Assemblers hinzu (ignoriert für den internen Assembler)
 *L2ap_Benutze Pipes anstelle temporärer Assembler-Dateien
 *L2ap_Benutze Pipes anstelle temporärer Assembler-Dateien
 **2ar_Liste Registerbelegungsinformation in Assembler-Datei
 **2ar_Liste Registerbelegungsinformation in Assembler-Datei
 **2at_Liste Temp. Variablenbelegungsinfo in Assembler-Datei
 **2at_Liste Temp. Variablenbelegungsinfo in Assembler-Datei
@@ -3387,10 +3447,14 @@ option_help_pages=11025_[
 **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*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*2Anasmobj_Assembliere mit Hilfe von Nasm
+3*2Anasm_Assembliere mit Hilfe von Nasm
 3*2Anasmcoff_COFF (Go32v2) Datei mit Hilfe von Nasm
 3*2Anasmcoff_COFF (Go32v2) Datei mit Hilfe von Nasm
 3*2Anasmelf_ELF32 (Linux) Datei mit Hilfe von Nasm
 3*2Anasmelf_ELF32 (Linux) Datei mit Hilfe von Nasm
-3*2Anasmwin32_Win32 Object Datei mit Hilfe von Nasm
-3*2Anasmwdosx_Win32/WDOSX Object Datei mit Hilfe von Nasm
+3*2Anasmwin32_Win32 Objektdatei mit Hilfe von Nasm
+3*2Anasmwdosx_Win32/WDOSX Objektdatei mit Hilfe von Nasm
+3*2Anasmdarwin Macho32 Objektdatei mit Hilfe von Nasm (experimentell)
 3*2Awasm_Obj Datei mit Hilfe von Wasm (Watcom)
 3*2Awasm_Obj Datei mit Hilfe von Wasm (Watcom)
 3*2Anasmobj_Obj Datei mit Hilfe von Nasm
 3*2Anasmobj_Obj Datei mit Hilfe von Nasm
 3*2Amasm_Obj Datei mit Hilfe von Masm (Microsoft)
 3*2Amasm_Obj Datei mit Hilfe von Masm (Microsoft)
@@ -3398,13 +3462,19 @@ option_help_pages=11025_[
 3*2Aelf_ELF32 (Linux) mit Hilfe des internen Schreibers
 3*2Aelf_ELF32 (Linux) mit Hilfe des internen Schreibers
 3*2Acoff_COFF (Go32v2) mit Hilfe des internen Schreibers
 3*2Acoff_COFF (Go32v2) mit Hilfe des internen Schreibers
 3*2Apecoff_PE_COFF (Win32) mit Hilfe des internen Schreibers
 3*2Apecoff_PE_COFF (Win32) mit Hilfe des internen Schreibers
+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*2Amasm_Win64 Object Datei mit Hilfe von ml64 (Microsoft)
-4*2Apecoff_PE-COFF (Win64) mit Hilfe des internen Writer
-4*2Aelf_ELF (Linux-64bit) mit Hilfe des internen Writer
-6*2Aas_Unix o-file mit Hilfe von GNU AS
+4*2Amasm_Win64 Objektdatei mit Hilfe von ml64 (Microsoft)
+4*2Apecoff_PE-COFF (Win64) mit Hilfe des internen Schreibers
+4*2Aelf_ELF (Linux-64bit) mit Hilfe des internen Schreibers
+4*2Ayasm_Assembliere mit Hilfe von Yasm (experimentell)
+4*2Anasm_Assembliere mit Hilfe von Nasm (experimentell)
+4*2Anasmwin64_Assembliere Win64 Objektdatei mit Hilfe von Nasm (experimentell)
+4*2Anasmelf_Assembliere Linux-64bit Objektdatei mit Hilfe von Nasm (experimentell)
+4*2Anasmdarwin_Assembliere darwin Macho64 Objektdatei mit Hilfe von Nasm (experimentell)
+6*2Aas_Unix o-Datei mit Hilfe von 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
@@ -3421,32 +3491,41 @@ S*2Aas_Assembliere mit Hilfe von GNU AS
 **2Cc<x>_Setze "default calling convention" zu <x>
 **2Cc<x>_Setze "default calling convention" zu <x>
 **2CD_Erzeuge auch eine dynamische Bibliothek (nicht unterstützt)
 **2CD_Erzeuge auch eine dynamische Bibliothek (nicht unterstützt)
 **2Ce_Übersetze mit emulierten Fliesskomma opcodes
 **2Ce_Übersetze mit emulierten Fliesskomma opcodes
-**2Cf<x>_Wähle den Fliesskomma instruction set aus; fpc -i gibt die möglichen Werte aus
+**2Cf<x>_Wähle den Fliesskomma-Instruction-Set aus; fpc -i gibt die möglichen Werte aus
 **2CF<x>_Minimale Präzission von Fliesskommakonstanten (default, 32, 64)
 **2CF<x>_Minimale Präzission von Fliesskommakonstanten (default, 32, 64)
 **2Cg_Erzeuge PIC code
 **2Cg_Erzeuge PIC code
 **2Ch<n>_<n> Bytes Heap (zwischen 1023 und 67107840)
 **2Ch<n>_<n> Bytes Heap (zwischen 1023 und 67107840)
 **2Ci_I/O-Prüfung
 **2Ci_I/O-Prüfung
+A*2CI<x>_Wähle den Instruction-Set für ARM aus: ARM oder THUMB
 **2Cn_Lasse die Linkstufe aus
 **2Cn_Lasse die Linkstufe aus
 P*2CN_Erzeuge Überprüfungen auf Nil-Zeiger (nur AIX)
 P*2CN_Erzeuge Überprüfungen auf Nil-Zeiger (nur AIX)
 **2Co_Prüfe auf Überlauf von Integer-Operationen
 **2Co_Prüfe auf Überlauf von Integer-Operationen
 **2CO_Prüfe auf möglichen Überlauf von Integer-Operationen
 **2CO_Prüfe auf möglichen Überlauf von Integer-Operationen
-**2Cp<x>_Wähle instruction set aus; fpc -i gibt die möglichen Werte aus
+**2Cp<x>_Wähle Instruction-Set aus; fpc -i gibt die möglichen Werte aus
 **2CP<x>=<y>_ Einstellungen für packing
 **2CP<x>=<y>_ Einstellungen für packing
 **3CPPACKSET=<y>_ <y> Belegung von Sets: 0, 1 oder DEFAULT oder NORMAL, 2, 4 und 8
 **3CPPACKSET=<y>_ <y> Belegung von Sets: 0, 1 oder DEFAULT oder NORMAL, 2, 4 und 8
 **2Cr_Führe Bereichsprüfung durch
 **2Cr_Führe Bereichsprüfung durch
 **2CR_Verifiziere die Gültigkiet des Aufrufs der Objektmethoden
 **2CR_Verifiziere die Gültigkiet des Aufrufs der Objektmethoden
 **2Cs<n>_Setze die Prüfgrösse des Stacks auf <n>
 **2Cs<n>_Setze die Prüfgrösse des Stacks auf <n>
 **2Ct_Führe Stackprüfung durch (nur zum Testen, siehe Handbuch)
 **2Ct_Führe Stackprüfung durch (nur zum Testen, siehe Handbuch)
+8*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
+3*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
+4*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
 p*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
 p*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
 P*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
 P*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
 J*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
 J*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
 A*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
 A*2CT<x>_Optionen für die ziel-spezifische Code-Erzeugung
 p*3CTsmalltoc_ Erzeuge kleinere TOCs auf Kosten der Ausführungsgeschwindigkeit (AIX)
 p*3CTsmalltoc_ Erzeuge kleinere TOCs auf Kosten der Ausführungsgeschwindigkeit (AIX)
 P*3CTsmalltoc_ Erzeuge kleinere TOCs auf Kosten der Ausführungsgeschwindigkeit (AIX)
 P*3CTsmalltoc_ Erzeuge kleinere TOCs auf Kosten der Ausführungsgeschwindigkeit (AIX)
+J*3CTautogetterprefix=X_  Erzeuge automatisch Getter für Eigenschaften mit dem Prefix X (Leerstring schaltet aus)
+J*3CTautosetterprefix=X_  Erzeuge automatisch Setter für Eigenschaften mit dem Prefix X (Leerstring schaltet aus)
+8*3CTcld_                 Emittiere eine CLD-Instruktion vor der x86-String-Instruktion
+3*3CTcld_                 Emittiere eine CLD-Instruktion vor der x86-String-Instruktion
+4*3CTcld_                 Emittiere eine CLD-Instruktion vor der x86-String-Instruktion
 J*3CTcompactintarrayinit_ Erzeuge kleineren (aber möglicherweise langsameren) Code für die Initialisierung von Integer-Array-Konstanten
 J*3CTcompactintarrayinit_ Erzeuge kleineren (aber möglicherweise langsameren) Code für die Initialisierung von Integer-Array-Konstanten
-J*3CTenumfieldinit_ Initialisiere Aufzählungsfelder in Konstruktoren mit enumtype(0), nach dem Aufruf geerbter Konstruktoren
-J*3CTautogetterprefix=X_ Erzeuge automatisch Getter für Eigenschaften mit dem Prefix X (Leerstring schaltet aus)
-J*3CTautosetterprefix=X_ Erzeuge automatisch Setter für Eigenschaften mit dem Prefix X (Leerstring schaltet aus)
+J*3CTenumfieldinit_       Initialisiere Aufzählungsfelder in Konstruktoren mit enumtype(0), nach dem Aufruf geerbter Konstruktoren
+J*3CTinitlocals_          Initialisiere lokale Variablen, die einen JVM bytecode Verifikationfehler auslösen, wenn uninitialisiert verwendet (verzögert den Code)
+J*3CTlowercaseprocstart_  Kleinschreibung des ersten Buchstabens bei Prozedur/Funktions/Methoden-Namen.
 A*3CTthumbinterworking_ Erzeuge "Thumb interworking-safe code", wenn möglich
 A*3CTthumbinterworking_ Erzeuge "Thumb interworking-safe code", wenn möglich
 J*2Cv_Var/out Parameter copy-out Überprüfung
 J*2Cv_Var/out Parameter copy-out Überprüfung
 **2CX_Benutze Smartlinking
 **2CX_Benutze Smartlinking
@@ -3471,6 +3550,7 @@ J*2Cv_Var/out Parameter copy-out Überprüfung
 **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
 **2Fm<x>_Lade die Unicode-Konversionstabelle aus <x>.txt im Compiler-Verzeichnis
 **2Fm<x>_Lade die Unicode-Konversionstabelle aus <x>.txt im Compiler-Verzeichnis
+**2FM<x>_Setze das Verzeichnis für Unicode-Binär-Dateien
 **2Fo<x>_Ergänze <x> zum Objektdatei-Pfad
 **2Fo<x>_Ergänze <x> zum Objektdatei-Pfad
 **2Fr<x>_Lade die Fehlermeldungs-Datei <x>
 **2Fr<x>_Lade die Fehlermeldungs-Datei <x>
 **2FR<x>_Setze den Resource (.res) Linker auf <x>
 **2FR<x>_Setze den Resource (.res) Linker auf <x>
@@ -3537,7 +3617,7 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
 6*2RMOT_Lese Assembler im Motorola-Format
 6*2RMOT_Lese Assembler im Motorola-Format
 **1S<x>_Syntax-Optionen:
 **1S<x>_Syntax-Optionen:
 **2S2_Schalte einige der Delphi 2 Erweiterungen ein (wie -Mobjfpc)
 **2S2_Schalte einige der Delphi 2 Erweiterungen ein (wie -Mobjfpc)
-**2Sc_Unterstütze spezielle C Operatoren (*=,+=,/= and -=)
+**2Sc_Unterstütze spezielle C-Operatoren (*=,+=,/= and -=)
 **2Sa_Erlaube assertion code.
 **2Sa_Erlaube assertion code.
 **2Sd_Sei Delphi-kompatibel (wie -Mdelphi)
 **2Sd_Sei Delphi-kompatibel (wie -Mdelphi)
 **2Se<x>_Fehler Optionen. <x> ist eine der folgenden Kombinationen:
 **2Se<x>_Fehler Optionen. <x> ist eine der folgenden Kombinationen:
@@ -3556,7 +3636,7 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
 **2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
 **2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
 **2Ss_Konstruktor- und Destruktorname müssen "Init" und "Done" sein
 **2Ss_Konstruktor- und Destruktorname müssen "Init" und "Done" sein
 **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 Pointer 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
 **2sh_Erzeuge Script um auf dem Host zu linken
 **2st_Erzeuge Script um auf dem Zielsystem zu linken
 **2st_Erzeuge Script um auf dem Zielsystem zu linken
@@ -3660,6 +3740,8 @@ A*2WI_Die Verwendung der "import"-Abschnitte ein/ausschalten (Windows)
 8*3WmTiny_Winziges (tiny) Speichermodell
 8*3WmTiny_Winziges (tiny) Speichermodell
 8*3WmSmall_Kleines (small) Speichermodell (Voreinstellung)
 8*3WmSmall_Kleines (small) Speichermodell (Voreinstellung)
 8*3WmMedium_Mittleres (medium) Speichermodell
 8*3WmMedium_Mittleres (medium) Speichermodell
+8*3WmCompact_Kompaktes (compact) Speichermodell
+8*3WmLarge_Großes (large) Speichermodell
 3*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 3*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 4*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 4*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 p*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
 p*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
@@ -3674,6 +3756,9 @@ A*2WP<x>_Minimale iOS Deployment Version: 3.0, 5.0.1, ... (Darwin)
 3*2WR_Erzeuge "relocation code" (Windows)
 3*2WR_Erzeuge "relocation code" (Windows)
 4*2WR_Erzeuge "relocation code" (Windows)
 4*2WR_Erzeuge "relocation code" (Windows)
 A*2WR_Erzeuge "relocation code" (Windows)
 A*2WR_Erzeuge "relocation code" (Windows)
+8*2Wt<x>_Setze das Format der Ziel-Executable
+8*3Wtexe_Erzeuge eine DOS .EXE Datei (Voreinstellung)
+8*3Wtcom_Erzeuge eine DOS .COM Datei (erfordert das winzige (tiny) Speichermodell)
 P*2WF_Spezifiziere "MPW tool type application" (Classic Mac OS)
 P*2WF_Spezifiziere "MPW tool type application" (Classic Mac OS)
 **2WX_Ermögliche den executable stack (Linux)
 **2WX_Ermögliche den executable stack (Linux)
 **1X_Programm-Optionen:
 **1X_Programm-Optionen:

+ 31 - 4
compiler/msg/errore.msg

@@ -136,7 +136,7 @@ general_f_oserror=01025_F_Operating system error: $1
 #
 #
 # Scanner
 # Scanner
 #
 #
-# 02095 is the last used one
+# 02098 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
@@ -396,11 +396,22 @@ scan_e_illegal_peoptflag=02094_E_Illegal argument for SETPEOPTFLAGS
 % ordinal value
 % ordinal value
 scan_e_unsupported_switch=02095_E_Directive $1 is not supported on this target
 scan_e_unsupported_switch=02095_E_Directive $1 is not supported on this target
 % Not all compiler directives are supported on all targets.
 % Not all compiler directives are supported on all targets.
+scan_w_invalid_stacksize=02096_W_The specified stack size is not within the valid range for the platform. Setting the stack size ignored.
+% The valid range for the stack size is 1024 - 67107839 on 32-bit and 64-bit
+% platforms and 1024 - 65520 on 16-bit platforms. Additionally, for Turbo Pascal 7
+% compatibility reasons, specifying a stack size of 65521 on 16-bit platforms
+% actually sets the stack size to 65520.
+scan_w_heapmax_lessthan_heapmin=02097_W_The specified HeapMax value is smaller than the HeapMin value. Setting HeapMax ignored.
+% The HeapMax value (if specified) must be greater than or equal to the HeapMin
+% value. Otherwise, the HeapMax value is ignored.
+scan_e_illegal_hugepointernormalization=02098_E_Illegal argument for HUGEPOINTERNORMALIZATION
+% The only allowed values for HUGEPOINTERNORMALIZATION are BORLANDC, MICROSOFTC
+% and WATCOMC.
 % \end{description}
 % \end{description}
 #
 #
 # Parser
 # Parser
 #
 #
-# 03336 is the last used one
+# 03338 is the last used one
 #
 #
 % \section{Parser messages}
 % \section{Parser messages}
 % This section lists all parser messages. The parser takes care of the
 % This section lists all parser messages. The parser takes care of the
@@ -1508,13 +1519,23 @@ parser_e_overloaded_have_same_mangled_name=03336_E_Overloaded routines have the
 % a prescribed way, and this encoding may map different Pascal types to the same encoded
 % a prescribed way, and this encoding may map different Pascal types to the same encoded
 % (a.k.a.\ ``mangled'') name. This error can only be solved by removing or changing the
 % (a.k.a.\ ``mangled'') name. This error can only be solved by removing or changing the
 % conflicting definitions' parameter declarations or routine names.
 % conflicting definitions' parameter declarations or routine names.
+parser_e_default_value_val_const=03337_E_Default values can only be specified for value, const and constref parameters
+% A default parameter value allows you to not specify a value for this parameter
+% when calling the routine, and the compiler will instead pass the specified
+% default (constant) value. As a result, default values can only be specified
+% for parameters that can accept constant values.
+parser_w_ptr_type_ignored=03338_W_Pointer type "$1" ignored
+% 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
+% declared on a non-x86 platform.
+%
 %
 %
 %
 %
 % \end{description}
 % \end{description}
 %
 %
 # Type Checking
 # Type Checking
 #
 #
-# 04121 is the last used one
+# 04122 is the last used one
 #
 #
 % \section{Type checking errors}
 % \section{Type checking errors}
 % This section lists all errors that can occur when type checking is
 % This section lists all errors that can occur when type checking is
@@ -1941,6 +1962,9 @@ type_e_type_not_allowed_for_type_helper=04120_E_Type "$1" cannot be extended by
 type_e_procedure_must_be_far=04121_E_Procedure or function must be far in order to allow taking its address: "$1"
 type_e_procedure_must_be_far=04121_E_Procedure or function must be far in order to allow taking its address: "$1"
 % In certain i8086 memory models (medium, large and huge), procedures and functions
 % In certain i8086 memory models (medium, large and huge), procedures and functions
 % have to be declared 'far' in order to allow their address to be taken.
 % have to be declared 'far' in order to allow their address to be taken.
+type_w_instance_abstract_class=04122_W_Creating an instance of abstract class "$1"
+% The specified class is declared as \var{abstract} and thus no instance of this class
+% should be created. This is merely a warning for Delphi compatibility.
 % \end{description}
 % \end{description}
 #
 #
 # Symtable
 # Symtable
@@ -3085,7 +3109,7 @@ unit_u_ppu_invalid_memory_model=10063_U_PPU is compiled for another i8086 memory
 #
 #
 #  Options
 #  Options
 #
 #
-# 11056 is the last used one
+# 11057 is the last used one
 #
 #
 option_usage=11000_O_$1 [options] <inputfile> [options]
 option_usage=11000_O_$1 [options] <inputfile> [options]
 # BeginOfTeX
 # BeginOfTeX
@@ -3230,6 +3254,7 @@ option_missing_arg=11054_E_argument to "$1" is missing
 option_malformed_para=11055_E_malformed parameter: $1
 option_malformed_para=11055_E_malformed parameter: $1
 % Given argument is not valid for parameter.
 % Given argument is not valid for parameter.
 option_smart_link_requires_external_linker=11056_W_Smart linking requires external linker
 option_smart_link_requires_external_linker=11056_W_Smart linking requires external linker
+option_com_files_require_tiny_model=11057_E_Creating .COM files is not supported in the current memory model. Only the tiny memory model supports making .COM files.
 
 
 
 
 %\end{description}
 %\end{description}
@@ -3698,6 +3723,8 @@ A*2WI_Turn on/off the usage of import sections (Windows)
 8*3WmTiny_Tiny memory model
 8*3WmTiny_Tiny memory model
 8*3WmSmall_Small memory model (default)
 8*3WmSmall_Small memory model (default)
 8*3WmMedium_Medium memory model
 8*3WmMedium_Medium memory model
+8*3WmCompact_Compact memory model
+8*3WmLarge_Large memory model
 3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwin)
 3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwin)
 4*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwin)
 4*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwin)
 p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwin)
 p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwin)

+ 1 - 1
compiler/msg/errorr.msg

@@ -2,7 +2,7 @@
 #   This file is part of the Free Pascal Compiler
 #   This file is part of the Free Pascal Compiler
 #   Copyright (c) 1999-2009 by the Free Pascal Development team
 #   Copyright (c) 1999-2009 by the Free Pascal Development team
 #
 #
-#   Russian (utf-8) Language File for Free Pascal
+#   Russian (cp866) Language File for Free Pascal
 #
 #
 #   This file corresponds to SVN revision 13665 of errore.msg
 #   This file corresponds to SVN revision 13665 of errore.msg
 #   Translated by Sergei Gorelkin <sergei_gorelkin at mail.ru>
 #   Translated by Sergei Gorelkin <sergei_gorelkin at mail.ru>

+ 10 - 3
compiler/msgidx.inc

@@ -117,6 +117,9 @@ const
   scan_e_illegal_peflag=02093;
   scan_e_illegal_peflag=02093;
   scan_e_illegal_peoptflag=02094;
   scan_e_illegal_peoptflag=02094;
   scan_e_unsupported_switch=02095;
   scan_e_unsupported_switch=02095;
+  scan_w_invalid_stacksize=02096;
+  scan_w_heapmax_lessthan_heapmin=02097;
+  scan_e_illegal_hugepointernormalization=02098;
   parser_e_syntax_error=03000;
   parser_e_syntax_error=03000;
   parser_e_dont_nest_interrupt=03004;
   parser_e_dont_nest_interrupt=03004;
   parser_w_proc_directive_ignored=03005;
   parser_w_proc_directive_ignored=03005;
@@ -435,6 +438,8 @@ const
   parser_e_no_assembler_in_generic=03334;
   parser_e_no_assembler_in_generic=03334;
   parser_e_property_only_sgr=03335;
   parser_e_property_only_sgr=03335;
   parser_e_overloaded_have_same_mangled_name=03336;
   parser_e_overloaded_have_same_mangled_name=03336;
+  parser_e_default_value_val_const=03337;
+  parser_w_ptr_type_ignored=03338;
   type_e_mismatch=04000;
   type_e_mismatch=04000;
   type_e_incompatible_types=04001;
   type_e_incompatible_types=04001;
   type_e_not_equal_types=04002;
   type_e_not_equal_types=04002;
@@ -547,6 +552,7 @@ const
   type_e_invalid_default_value=04119;
   type_e_invalid_default_value=04119;
   type_e_type_not_allowed_for_type_helper=04120;
   type_e_type_not_allowed_for_type_helper=04120;
   type_e_procedure_must_be_far=04121;
   type_e_procedure_must_be_far=04121;
+  type_w_instance_abstract_class=04122;
   sym_e_id_not_found=05000;
   sym_e_id_not_found=05000;
   sym_f_internal_error_in_symtablestack=05001;
   sym_f_internal_error_in_symtablestack=05001;
   sym_e_duplicate_id=05002;
   sym_e_duplicate_id=05002;
@@ -963,6 +969,7 @@ const
   option_missing_arg=11054;
   option_missing_arg=11054;
   option_malformed_para=11055;
   option_malformed_para=11055;
   option_smart_link_requires_external_linker=11056;
   option_smart_link_requires_external_linker=11056;
+  option_com_files_require_tiny_model=11057;
   wpo_cant_find_file=12000;
   wpo_cant_find_file=12000;
   wpo_begin_processing=12001;
   wpo_begin_processing=12001;
   wpo_end_processing=12002;
   wpo_end_processing=12002;
@@ -987,9 +994,9 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 71327;
+  MsgTxtSize = 71955;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
-    26,96,337,122,89,57,126,27,202,64,
-    57,20,1,1,1,1,1,1,1,1
+    26,99,339,123,89,57,126,27,202,64,
+    58,20,1,1,1,1,1,1,1,1
   );
   );

文件差異過大導致無法顯示
+ 410 - 398
compiler/msgtxt.inc


+ 32 - 12
compiler/nadd.pas

@@ -59,6 +59,8 @@ interface
           { only implements "muln" nodes, the rest always has to be done in }
           { only implements "muln" nodes, the rest always has to be done in }
           { the code generator for performance reasons (JM)                 }
           { the code generator for performance reasons (JM)                 }
           function first_add64bitint: tnode; virtual;
           function first_add64bitint: tnode; virtual;
+          function first_addpointer: tnode; virtual;
+          function first_cmppointer: tnode; virtual;
 
 
           { override and return false if you can handle 32x32->64 }
           { override and return false if you can handle 32x32->64 }
           { bit multiplies directly in your code generator. If    }
           { bit multiplies directly in your code generator. If    }
@@ -1640,11 +1642,15 @@ implementation
                     inserttypeconv_internal(left,java_jlobject);
                     inserttypeconv_internal(left,java_jlobject);
                     inserttypeconv_internal(right,java_jlobject);
                     inserttypeconv_internal(right,java_jlobject);
 {$elseif defined(i8086)}
 {$elseif defined(i8086)}
-                    if is_farpointer(left.resultdef) then
+                    if is_hugepointer(left.resultdef) then
+                      inserttypeconv_internal(left,charhugepointertype)
+                    else if is_farpointer(left.resultdef) then
                       inserttypeconv_internal(left,charfarpointertype)
                       inserttypeconv_internal(left,charfarpointertype)
                     else
                     else
                       inserttypeconv_internal(left,charnearpointertype);
                       inserttypeconv_internal(left,charnearpointertype);
-                    if is_farpointer(right.resultdef) then
+                    if is_hugepointer(right.resultdef) then
+                      inserttypeconv_internal(right,charhugepointertype)
+                    else if is_farpointer(right.resultdef) then
                       inserttypeconv_internal(right,charfarpointertype)
                       inserttypeconv_internal(right,charfarpointertype)
                     else
                     else
                       inserttypeconv_internal(right,charnearpointertype);
                       inserttypeconv_internal(right,charnearpointertype);
@@ -1960,7 +1966,7 @@ implementation
               end
               end
             else
             else
               resultdef:=right.resultdef;
               resultdef:=right.resultdef;
-            inserttypeconv(left,sinttype);
+            inserttypeconv(left,get_int_type_for_pointer_arithmetic(rd));
             if nodetype=addn then
             if nodetype=addn then
               begin
               begin
                 if not(cs_extsyntax in current_settings.moduleswitches) or
                 if not(cs_extsyntax in current_settings.moduleswitches) or
@@ -1972,7 +1978,7 @@ implementation
                    (tpointerdef(rd).pointeddef.size>1) then
                    (tpointerdef(rd).pointeddef.size>1) then
                    begin
                    begin
                      left:=caddnode.create(muln,left,
                      left:=caddnode.create(muln,left,
-                       cordconstnode.create(tpointerdef(rd).pointeddef.size,sinttype,true));
+                       cordconstnode.create(tpointerdef(rd).pointeddef.size,get_int_type_for_pointer_arithmetic(rd),true));
                      typecheckpass(left);
                      typecheckpass(left);
                    end;
                    end;
               end
               end
@@ -1991,7 +1997,7 @@ implementation
              else
              else
                resultdef:=left.resultdef;
                resultdef:=left.resultdef;
 
 
-             inserttypeconv(right,sinttype);
+             inserttypeconv(right,get_int_type_for_pointer_arithmetic(ld));
              if nodetype in [addn,subn] then
              if nodetype in [addn,subn] then
                begin
                begin
                  if (lt=niln) then
                  if (lt=niln) then
@@ -2008,7 +2014,7 @@ implementation
                    if (tpointerdef(ld).pointeddef.size>1) then
                    if (tpointerdef(ld).pointeddef.size>1) then
                    begin
                    begin
                      right:=caddnode.create(muln,right,
                      right:=caddnode.create(muln,right,
-                       cordconstnode.create(tpointerdef(ld).pointeddef.size,sinttype,true));
+                       cordconstnode.create(tpointerdef(ld).pointeddef.size,get_int_type_for_pointer_arithmetic(ld),true));
                      typecheckpass(right);
                      typecheckpass(right);
                    end
                    end
                  end else
                  end else
@@ -2016,7 +2022,7 @@ implementation
                       (tarraydef(ld).elementdef.size>1) then
                       (tarraydef(ld).elementdef.size>1) then
                      begin
                      begin
                        right:=caddnode.create(muln,right,
                        right:=caddnode.create(muln,right,
-                         cordconstnode.create(tarraydef(ld).elementdef.size,sinttype,true));
+                         cordconstnode.create(tarraydef(ld).elementdef.size,get_int_type_for_pointer_arithmetic(ld),true));
                        typecheckpass(right);
                        typecheckpass(right);
                      end;
                      end;
                end
                end
@@ -2671,6 +2677,20 @@ implementation
       end;
       end;
 
 
 
 
+    function taddnode.first_addpointer: tnode;
+      begin
+        result:=nil;
+        expectloc:=LOC_REGISTER;
+      end;
+
+
+    function taddnode.first_cmppointer: tnode;
+      begin
+        result:=nil;
+        expectloc:=LOC_FLAGS;
+      end;
+
+
     function taddnode.first_addfloat : tnode;
     function taddnode.first_addfloat : tnode;
       var
       var
         procname: string[31];
         procname: string[31];
@@ -2991,9 +3011,9 @@ implementation
          else if is_pchar(ld) then
          else if is_pchar(ld) then
            begin
            begin
              if nodetype in [addn,subn,muln,andn,orn,xorn] then
              if nodetype in [addn,subn,muln,andn,orn,xorn] then
-               expectloc:=LOC_REGISTER
+               result:=first_addpointer
              else
              else
-               expectloc:=LOC_FLAGS;
+               result:=first_cmppointer;
            end
            end
 
 
          { is one of the operands a string }
          { is one of the operands a string }
@@ -3072,9 +3092,9 @@ implementation
          else if (ld.typ=pointerdef) then
          else if (ld.typ=pointerdef) then
             begin
             begin
               if nodetype in [addn,subn,muln,andn,orn,xorn] then
               if nodetype in [addn,subn,muln,andn,orn,xorn] then
-                expectloc:=LOC_REGISTER
+                result:=first_addpointer
               else
               else
-                expectloc:=LOC_FLAGS;
+                result:=first_cmppointer;
            end
            end
 
 
          else if is_implicit_pointer_object_type(ld) then
          else if is_implicit_pointer_object_type(ld) then
@@ -3106,7 +3126,7 @@ implementation
 
 
          else if (rd.typ=pointerdef) or (ld.typ=pointerdef) then
          else if (rd.typ=pointerdef) or (ld.typ=pointerdef) then
             begin
             begin
-              expectloc:=LOC_REGISTER;
+              result:=first_addpointer;
             end
             end
 
 
          else  if (rd.typ=procvardef) and
          else  if (rd.typ=procvardef) and

+ 15 - 5
compiler/ncal.pas

@@ -65,7 +65,8 @@ interface
           function  is_simple_para_load(p:tnode; may_be_in_reg: boolean):boolean;
           function  is_simple_para_load(p:tnode; may_be_in_reg: boolean):boolean;
           procedure maybe_load_in_temp(var p:tnode);
           procedure maybe_load_in_temp(var p:tnode);
           function  gen_high_tree(var p:tnode;paradef:tdef):tnode;
           function  gen_high_tree(var p:tnode;paradef:tdef):tnode;
-          function  gen_procvar_context_tree:tnode;
+          function  gen_procvar_context_tree_self:tnode;
+          function  gen_procvar_context_tree_parentfp:tnode;
           function  gen_self_tree:tnode;
           function  gen_self_tree:tnode;
           function  gen_vmt_tree:tnode;
           function  gen_vmt_tree:tnode;
           procedure gen_hidden_parameters;
           procedure gen_hidden_parameters;
@@ -1742,15 +1743,24 @@ implementation
       end;
       end;
 
 
 
 
-    function tcallnode.gen_procvar_context_tree:tnode;
+    function tcallnode.gen_procvar_context_tree_self:tnode;
       begin
       begin
-        { Load tmehodpointer(right).self (either self or parentfp) }
+        { Load tmehodpointer(right).self }
         result:=genloadfield(ctypeconvnode.create_internal(
         result:=genloadfield(ctypeconvnode.create_internal(
           right.getcopy,methodpointertype),
           right.getcopy,methodpointertype),
           'self');
           'self');
       end;
       end;
 
 
 
 
+    function tcallnode.gen_procvar_context_tree_parentfp: tnode;
+      begin
+        { Load tnestedprocpointer(right).parentfp }
+        result:=genloadfield(ctypeconvnode.create_internal(
+          right.getcopy,nestedprocpointertype),
+          'parentfp');
+      end;
+
+
     function tcallnode.gen_self_tree:tnode;
     function tcallnode.gen_self_tree:tnode;
       var
       var
         selftree : tnode;
         selftree : tnode;
@@ -2508,7 +2518,7 @@ implementation
                  if vo_is_self in para.parasym.varoptions then
                  if vo_is_self in para.parasym.varoptions then
                    begin
                    begin
                      if assigned(right) then
                      if assigned(right) then
-                       para.left:=gen_procvar_context_tree
+                       para.left:=gen_procvar_context_tree_self
                      else
                      else
                        para.left:=gen_self_tree;
                        para.left:=gen_self_tree;
                      { make sure that e.g. the self pointer of an advanced
                      { make sure that e.g. the self pointer of an advanced
@@ -2540,7 +2550,7 @@ implementation
                            internalerror(200309287);
                            internalerror(200309287);
                        end
                        end
                      else
                      else
-                       para.left:=gen_procvar_context_tree;
+                       para.left:=gen_procvar_context_tree_parentfp;
                    end
                    end
                 else
                 else
                  if vo_is_range_check in para.parasym.varoptions then
                  if vo_is_range_check in para.parasym.varoptions then

+ 8 - 2
compiler/ncgcnv.pas

@@ -115,7 +115,8 @@ interface
                     location.reference.alignment:=newalignment(location.reference.alignment,leftsize-ressize);
                     location.reference.alignment:=newalignment(location.reference.alignment,leftsize-ressize);
                   end;
                   end;
               end
               end
-{$if not defined(cpu16bitalu) and not defined(cpu8bitalu)}
+{$if not defined(cpu16bitalu) and not defined(cpu8bitalu) and not defined(m68k)}
+            { FIXME: reg_cgsize incorrectly identifies m68k as "without subregisters" }
             { On targets without 8/16 bit register components, 8/16-bit operations
             { On targets without 8/16 bit register components, 8/16-bit operations
               always adjust high bits of result, see 'maybeadjustresult' method in
               always adjust high bits of result, see 'maybeadjustresult' method in
               respective cgcpu.pas. Therefore 8/16-bit locations are valid as larger
               respective cgcpu.pas. Therefore 8/16-bit locations are valid as larger
@@ -574,7 +575,12 @@ interface
                   since the global procedure won't use it, but it can help with
                   since the global procedure won't use it, but it can help with
                   debugging }
                   debugging }
                 inc(location.reference.offset,voidcodepointertype.size);
                 inc(location.reference.offset,voidcodepointertype.size);
-                hlcg.a_load_const_ref(current_asmdata.CurrAsmList,voidpointertype,0,location.reference);
+                if (resultdef.typ=procvardef) and is_nested_pd(tprocvardef(resultdef)) then
+                  hlcg.a_load_const_ref(current_asmdata.CurrAsmList,parentfpvoidpointertype,0,location.reference)
+                else if tabstractprocdef(resultdef).is_methodpointer then
+                  hlcg.a_load_const_ref(current_asmdata.CurrAsmList,voidpointertype,0,location.reference)
+                else
+                  internalerror(2014052301);
                 dec(location.reference.offset,voidcodepointertype.size);
                 dec(location.reference.offset,voidcodepointertype.size);
               end;
               end;
           end;
           end;

+ 2 - 1
compiler/ncgld.pas

@@ -493,7 +493,8 @@ implementation
                         LOC_CREFERENCE,
                         LOC_CREFERENCE,
                         LOC_REFERENCE:
                         LOC_REFERENCE:
                           begin
                           begin
-                             if not is_object(left.resultdef) then
+                             if is_implicit_pointer_object_type(left.resultdef) or 
+                                 (left.resultdef.typ=classrefdef) then
                                begin
                                begin
                                  location.registerhi:=hlcg.getaddressregister(current_asmdata.CurrAsmList,left.resultdef);
                                  location.registerhi:=hlcg.getaddressregister(current_asmdata.CurrAsmList,left.resultdef);
                                  hlcg.a_load_ref_reg(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,left.location.reference,location.registerhi)
                                  hlcg.a_load_ref_reg(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,left.location.reference,location.registerhi)

+ 4 - 0
compiler/ncgmem.pas

@@ -904,6 +904,10 @@ implementation
                     hlcg.reference_reset_base(location.reference,left.resultdef,hlcg.getaddressregister(current_asmdata.CurrAsmList,left.resultdef),0,location.reference.alignment);
                     hlcg.reference_reset_base(location.reference,left.resultdef,hlcg.getaddressregister(current_asmdata.CurrAsmList,left.resultdef),0,location.reference.alignment);
                     hlcg.a_load_ref_reg(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,left.location.reference,location.reference.base);
                     hlcg.a_load_ref_reg(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,left.location.reference,location.reference.base);
                   end;
                   end;
+                LOC_CONSTANT:
+                  begin
+                    hlcg.reference_reset_base(location.reference,left.resultdef,NR_NO,left.location.value,location.reference.alignment);
+                  end;
                 else
                 else
                   internalerror(2002032218);
                   internalerror(2002032218);
               end;
               end;

+ 17 - 0
compiler/ncgrtti.pas

@@ -37,6 +37,7 @@ interface
       TRTTIWriter=class
       TRTTIWriter=class
       private
       private
         procedure fields_write_rtti(st:tsymtable;rt:trttitype);
         procedure fields_write_rtti(st:tsymtable;rt:trttitype);
+        procedure params_write_rtti(def:tabstractprocdef;rt:trttitype);
         procedure fields_write_rtti_data(def:tabstractrecorddef;rt:trttitype);
         procedure fields_write_rtti_data(def:tabstractrecorddef;rt:trttitype);
         procedure write_rtti_extrasyms(def:Tdef;rt:Trttitype;mainrtti:Tasmsymbol);
         procedure write_rtti_extrasyms(def:Tdef;rt:Trttitype;mainrtti:Tasmsymbol);
         procedure published_write_rtti(st:tsymtable;rt:trttitype);
         procedure published_write_rtti(st:tsymtable;rt:trttitype);
@@ -204,6 +205,20 @@ implementation
       end;
       end;
 
 
 
 
+    procedure TRTTIWriter.params_write_rtti(def:tabstractprocdef;rt:trttitype);
+      var
+        i   : longint;
+        sym : tparavarsym;
+      begin
+        for i:=0 to def.paras.count-1 do
+          begin
+            sym:=tparavarsym(def.paras[i]);
+            if not (vo_is_hidden_para in sym.varoptions) then
+              write_rtti(sym.vardef,rt);
+          end;
+      end;
+
+
     procedure TRTTIWriter.published_write_rtti(st:tsymtable;rt:trttitype);
     procedure TRTTIWriter.published_write_rtti(st:tsymtable;rt:trttitype);
       var
       var
         i   : longint;
         i   : longint;
@@ -1295,6 +1310,8 @@ implementation
           pointerdef:
           pointerdef:
             if not is_objc_class_or_protocol(tabstractpointerdef(def).pointeddef) then
             if not is_objc_class_or_protocol(tabstractpointerdef(def).pointeddef) then
               write_rtti(tabstractpointerdef(def).pointeddef,rt);
               write_rtti(tabstractpointerdef(def).pointeddef,rt);
+          procvardef:
+            params_write_rtti(tabstractprocdef(def),rt);
         end;
         end;
       end;
       end;
 
 

+ 0 - 1
compiler/ncgutil.pas

@@ -1494,7 +1494,6 @@ implementation
         { add the procedure to the al_procedures }
         { add the procedure to the al_procedures }
         maybe_new_object_file(list);
         maybe_new_object_file(list);
         new_section(list,sec_code,lower(pd.mangledname),current_settings.alignment.procalign);
         new_section(list,sec_code,lower(pd.mangledname),current_settings.alignment.procalign);
-        list.concat(Tai_align.create(current_settings.alignment.procalign));
         if (po_global in pd.procoptions) then
         if (po_global in pd.procoptions) then
           list.concat(Tai_symbol.createname_global(pd.mangledname,AT_FUNCTION,0))
           list.concat(Tai_symbol.createname_global(pd.mangledname,AT_FUNCTION,0))
         else
         else

+ 6 - 17
compiler/ncnv.pas

@@ -2501,23 +2501,12 @@ implementation
           case n.nodetype of
           case n.nodetype of
             subn,orn,xorn:
             subn,orn,xorn:
               begin
               begin
-                { nf_internal is set by taddnode.typecheckpass in  }
-                { case the arguments of this subn were u32bit, but }
-                { upcasted to s64bit for calculation correctness   }
-                { (normally only needed when range checking, but   }
-                {  also done otherwise so there is no difference   }
-                {  in overload choosing etc between $r+ and $r-)   }
-                if (nf_internal in n.flags) then
-                  begin
-                    result:=true;
-                    { the result could become negative in this case }
-                    if n.nodetype=subn then
-                      gotsint:=true
-                  end
-                else
-                  result:=
-                    docheckremove64bittypeconvs(tbinarynode(n).left) and
-                    docheckremove64bittypeconvs(tbinarynode(n).right);
+                { the result could become negative in this case }
+                if n.nodetype=subn then
+                  gotsint:=true;
+                result:=
+                  docheckremove64bittypeconvs(tbinarynode(n).left) and
+                  docheckremove64bittypeconvs(tbinarynode(n).right);
               end;
               end;
             addn,muln,divn,modn,andn:
             addn,muln,divn,modn,andn:
               begin
               begin

+ 1 - 0
compiler/ngenutil.pas

@@ -411,6 +411,7 @@ implementation
          ((p.typ=paravarsym) and
          ((p.typ=paravarsym) and
           ((vo_is_funcret in tabstractnormalvarsym(p).varoptions) or
           ((vo_is_funcret in tabstractnormalvarsym(p).varoptions) or
            (tabstractnormalvarsym(p).varspez=vs_out)))) and
            (tabstractnormalvarsym(p).varspez=vs_out)))) and
+         not (vo_is_default_var in tabstractnormalvarsym(p).varoptions) and
          not is_managed_type(tabstractnormalvarsym(p).vardef) and
          not is_managed_type(tabstractnormalvarsym(p).vardef) and
          not assigned(tabstractnormalvarsym(p).defaultconstsym);
          not assigned(tabstractnormalvarsym(p).defaultconstsym);
     end;
     end;

+ 70 - 28
compiler/ninl.pas

@@ -1874,9 +1874,9 @@ implementation
             else
             else
               begin
               begin
                 if r=0.0 then
                 if r=0.0 then
-                  result:=crealconstnode.create(MathQNaN.Value,pbestrealtype^)
-                else
                   result:=crealconstnode.create(MathNegInf.Value,pbestrealtype^)
                   result:=crealconstnode.create(MathNegInf.Value,pbestrealtype^)
+                else
+                  result:=crealconstnode.create(MathQNaN.Value,pbestrealtype^)
               end
               end
           else
           else
             result:=crealconstnode.create(ln(r),pbestrealtype^)
             result:=crealconstnode.create(ln(r),pbestrealtype^)
@@ -2412,9 +2412,9 @@ implementation
                   if left.nodetype=ordconstn then
                   if left.nodetype=ordconstn then
                     begin
                     begin
                       if tordconstnode(left).value<0 then
                       if tordconstnode(left).value<0 then
-                        result:=cordconstnode.create((-tordconstnode(left).value),s32inttype,false)
+                        result:=cordconstnode.create((-tordconstnode(left).value),resultdef,false)
                       else
                       else
-                        result:=cordconstnode.create((tordconstnode(left).value),s32inttype,false);
+                        result:=cordconstnode.create((tordconstnode(left).value),resultdef,false);
                     end
                     end
                 end;
                 end;
               in_sqr_real :
               in_sqr_real :
@@ -2425,24 +2425,12 @@ implementation
               in_sqrt_real :
               in_sqrt_real :
                 begin
                 begin
                   if left.nodetype in [ordconstn,realconstn] then
                   if left.nodetype in [ordconstn,realconstn] then
-                    begin
-                      vr:=getconstrealvalue;
-                      if vr<0.0 then
-                        result:=handle_sqrt_const(vr)
-                      else
-                        setconstrealvalue(sqrt(vr));
-                    end
+                    result:=handle_sqrt_const(getconstrealvalue);
                 end;
                 end;
               in_ln_real :
               in_ln_real :
                 begin
                 begin
                   if left.nodetype in [ordconstn,realconstn] then
                   if left.nodetype in [ordconstn,realconstn] then
-                   begin
-                     vr:=getconstrealvalue;
-                     if vr<=0.0 then
-                       result:=handle_ln_const(vr)
-                     else
-                       setconstrealvalue(ln(vr));
-                   end
+                    result:=handle_ln_const(getconstrealvalue);
                 end;
                 end;
               in_assert_x_y :
               in_assert_x_y :
                 begin
                 begin
@@ -2469,8 +2457,27 @@ implementation
     function tinlinenode.pass_typecheck:tnode;
     function tinlinenode.pass_typecheck:tnode;
 
 
       procedure setfloatresultdef;
       procedure setfloatresultdef;
+        var
+          hnode: tnode;
         begin
         begin
-          if (left.resultdef.typ=floatdef) and
+          { System unit declares internal functions like this:
+              function foo(x: valreal): valreal; [internproc: number];
+            Calls to such functions are initially processed by callnode,
+            which typechecks the arguments, possibly inserting conversion to valreal.
+            To handle smaller types without excess precision, we need to remove
+            these extra typecasts. }
+          if (left.nodetype=typeconvn) and
+            (ttypeconvnode(left).left.resultdef.typ=floatdef) and
+            (left.flags*[nf_explicit,nf_internal]=[]) and
+            (tfloatdef(ttypeconvnode(left).left.resultdef).floattype in [s32real,s64real,s80real,sc80real,s128real]) then
+            begin
+              hnode:=ttypeconvnode(left).left;
+              ttypeconvnode(left).left:=nil;
+              left.free;
+              left:=hnode;
+              resultdef:=left.resultdef;
+            end
+          else if (left.resultdef.typ=floatdef) and
             (tfloatdef(left.resultdef).floattype in [s32real,s64real,s80real,sc80real,s128real]) then
             (tfloatdef(left.resultdef).floattype in [s32real,s64real,s80real,sc80real,s128real]) then
             resultdef:=left.resultdef
             resultdef:=left.resultdef
           else
           else
@@ -3093,7 +3100,6 @@ implementation
               in_cos_real,
               in_cos_real,
               in_sin_real,
               in_sin_real,
               in_arctan_real,
               in_arctan_real,
-              in_abs_real,
               in_ln_real :
               in_ln_real :
                 begin
                 begin
                   set_varstate(left,vs_read,[vsf_must_be_valid]);
                   set_varstate(left,vs_read,[vsf_must_be_valid]);
@@ -3133,10 +3139,10 @@ implementation
               in_abs_long:
               in_abs_long:
                 begin
                 begin
                   set_varstate(left,vs_read,[vsf_must_be_valid]);
                   set_varstate(left,vs_read,[vsf_must_be_valid]);
-                  inserttypeconv(left,s32inttype);
-                  resultdef:=s32inttype;
+                  resultdef:=left.resultdef;
                 end;
                 end;
 
 
+              in_abs_real,
               in_sqr_real,
               in_sqr_real,
               in_sqrt_real :
               in_sqrt_real :
                 begin
                 begin
@@ -3161,7 +3167,11 @@ implementation
                     begin
                     begin
                       set_varstate(tcallparanode(left).left,vs_read,[vsf_must_be_valid]);
                       set_varstate(tcallparanode(left).left,vs_read,[vsf_must_be_valid]);
                       { check type }
                       { check type }
-                      if is_boolean(left.resultdef) then
+                      if is_boolean(left.resultdef) or
+                          (
+                            (left.resultdef.typ=undefineddef) and
+                            (df_generic in current_procinfo.procdef.defoptions)
+                          ) then
                         begin
                         begin
                            set_varstate(tcallparanode(tcallparanode(left).right).left,vs_read,[vsf_must_be_valid]);
                            set_varstate(tcallparanode(tcallparanode(left).right).left,vs_read,[vsf_must_be_valid]);
                            { must always be a string }
                            { must always be a string }
@@ -3709,8 +3719,8 @@ implementation
       begin
       begin
         { create the call to the helper }
         { create the call to the helper }
         { on entry left node contains the parameter }
         { on entry left node contains the parameter }
-        first_abs_real := ccallnode.createintern('fpc_abs_real',
-                ccallparanode.create(left,nil));
+        first_abs_real := ctypeconvnode.create(ccallnode.createintern('fpc_abs_real',
+                ccallparanode.create(left,nil)),resultdef);
         left := nil;
         left := nil;
       end;
       end;
 
 
@@ -3729,11 +3739,43 @@ implementation
       end;
       end;
 
 
      function tinlinenode.first_sqrt_real : tnode;
      function tinlinenode.first_sqrt_real : tnode;
+      var
+        fdef: tdef;
+        procname: string[31];
       begin
       begin
-        { create the call to the helper }
-        { on entry left node contains the parameter }
-        first_sqrt_real := ctypeconvnode.create(ccallnode.createintern('fpc_sqrt_real',
+        if ((cs_fp_emulation in current_settings.moduleswitches)
+{$ifdef cpufpemu}
+            or (current_settings.fputype=fpu_soft)
+{$endif cpufpemu}
+            ) and not (target_info.system in systems_wince) then
+          begin
+            case tfloatdef(left.resultdef).floattype of
+              s32real:
+                begin
+                  fdef:=search_system_type('FLOAT32REC').typedef;
+                  procname:='float32_sqrt';
+                end;
+              s64real:
+                begin
+                  fdef:=search_system_type('FLOAT64').typedef;
+                  procname:='float64_sqrt';
+                end;
+              {!!! not yet implemented
+              s128real:
+              }
+            else
+              internalerror(2014052101);
+            end;
+            first_sqrt_real:=ctypeconvnode.create_internal(ccallnode.createintern(procname,ccallparanode.create(
+               ctypeconvnode.create_internal(left,fdef),nil)),resultdef);
+          end
+        else
+          begin
+            { create the call to the helper }
+            { on entry left node contains the parameter }
+            first_sqrt_real := ctypeconvnode.create(ccallnode.createintern('fpc_sqrt_real',
                 ccallparanode.create(left,nil)),resultdef);
                 ccallparanode.create(left,nil)),resultdef);
+          end;
         left := nil;
         left := nil;
       end;
       end;
 
 

+ 47 - 3
compiler/nmat.pas

@@ -474,14 +474,15 @@ implementation
         result := nil;
         result := nil;
         { divide/mod a number by a constant which is a power of 2? }
         { divide/mod a number by a constant which is a power of 2? }
         if (right.nodetype = ordconstn) and
         if (right.nodetype = ordconstn) and
+          ispowerof2(tordconstnode(right).value,power) and
 {$ifdef cpu64bitalu}
 {$ifdef cpu64bitalu}
           { for 64 bit, we leave the optimization to the cg }
           { for 64 bit, we leave the optimization to the cg }
-            (not is_signed(resultdef)) and
+            (not is_signed(resultdef)) then
 {$else cpu64bitalu}
 {$else cpu64bitalu}
            (((nodetype=divn) and is_64bit(resultdef)) or
            (((nodetype=divn) and is_64bit(resultdef)) or
-            not is_signed(resultdef)) and
+            (nodetype=modn) or
+            not is_signed(resultdef)) then
 {$endif cpu64bitalu}
 {$endif cpu64bitalu}
-           ispowerof2(tordconstnode(right).value,power) then
           begin
           begin
             if nodetype=divn then
             if nodetype=divn then
               begin
               begin
@@ -530,6 +531,49 @@ implementation
                     result:=cshlshrnode.create(shrn,left,right)
                     result:=cshlshrnode.create(shrn,left,right)
                   end;
                   end;
               end
               end
+            else if is_signed(resultdef) then    { signed modulus }
+              begin
+                if (cs_opt_size in current_settings.optimizerswitches) then
+                  exit;
+
+                shiftval:=left.resultdef.size*8-1;
+                dec(tordconstnode(right).value.uvalue);
+
+                result:=internalstatements(statements);
+                temp:=ctempcreatenode.create(left.resultdef,left.resultdef.size,tt_persistent,true);
+                resulttemp:=ctempcreatenode.create(resultdef,resultdef.size,tt_persistent,true);
+                addstatement(statements,resulttemp);
+                addstatement(statements,temp);
+                addstatement(statements,cassignmentnode.create(ctemprefnode.create(temp),left));
+                { sign:=sar(left,sizeof(left)*8-1); }
+                addstatement(statements,cassignmentnode.create(ctemprefnode.create(resulttemp),
+                  cinlinenode.create(in_sar_x_y,false,
+                    ccallparanode.create(cordconstnode.create(shiftval,u8inttype,false),
+                    ccallparanode.create(ctemprefnode.create(temp),nil)
+                  )
+                )));
+
+                { result:=((((left xor sign)-sign) and right) xor sign)-sign; }
+                addstatement(statements,cassignmentnode.create(ctemprefnode.create(resulttemp),
+                  caddnode.create(subn,
+                    caddnode.create(xorn,
+                      caddnode.create(andn,
+                        right,
+                        caddnode.create(subn,
+                          caddnode.create(xorn,
+                            ctemprefnode.create(resulttemp),
+                            ctemprefnode.create(temp)),
+                          ctemprefnode.create(resulttemp))
+                        ),
+                      ctemprefnode.create(resulttemp)
+                    ),
+                  ctemprefnode.create(resulttemp))
+                ));
+
+                addstatement(statements,ctempdeletenode.create(temp));
+                addstatement(statements,ctempdeletenode.create_normal_temp(resulttemp));
+                addstatement(statements,ctemprefnode.create(resulttemp));
+              end
             else
             else
               begin
               begin
                 dec(tordconstnode(right).value.uvalue);
                 dec(tordconstnode(right).value.uvalue);

+ 7 - 2
compiler/nmem.pas

@@ -481,6 +481,7 @@ implementation
          hp : tnode;
          hp : tnode;
          hsym : tfieldvarsym;
          hsym : tfieldvarsym;
          isprocvar : boolean;
          isprocvar : boolean;
+         procpointertype: tdef;
       begin
       begin
         result:=nil;
         result:=nil;
         typecheckpass(left);
         typecheckpass(left);
@@ -541,14 +542,18 @@ implementation
                     if isprocvar or
                     if isprocvar or
                        is_nested_pd(tabstractprocdef(left.resultdef)) then
                        is_nested_pd(tabstractprocdef(left.resultdef)) then
                       begin
                       begin
+                        if tabstractprocdef(left.resultdef).is_methodpointer then
+                          procpointertype:=methodpointertype
+                        else
+                          procpointertype:=nestedprocpointertype;
                         { find proc field in methodpointer record }
                         { find proc field in methodpointer record }
-                        hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.Find('proc'));
+                        hsym:=tfieldvarsym(trecorddef(procpointertype).symtable.Find('proc'));
                         if not assigned(hsym) then
                         if not assigned(hsym) then
                           internalerror(200412041);
                           internalerror(200412041);
                         { Load tmehodpointer(left).proc }
                         { Load tmehodpointer(left).proc }
                         result:=csubscriptnode.create(
                         result:=csubscriptnode.create(
                                      hsym,
                                      hsym,
-                                     ctypeconvnode.create_internal(left,methodpointertype));
+                                     ctypeconvnode.create_internal(left,procpointertype));
                         left:=nil;
                         left:=nil;
                       end
                       end
                     else
                     else

+ 3 - 1
compiler/ogbase.pas

@@ -1079,7 +1079,9 @@ implementation
           {sec_objc_nlclasslist} [oso_data,oso_load],
           {sec_objc_nlclasslist} [oso_data,oso_load],
           {sec_objc_catlist} [oso_data,oso_load],
           {sec_objc_catlist} [oso_data,oso_load],
           {sec_objc_nlcatlist} [oso_data,oso_load],
           {sec_objc_nlcatlist} [oso_data,oso_load],
-          {sec_objc_protolist'} [oso_data,oso_load]
+          {sec_objc_protolist'} [oso_data,oso_load],
+          {stack} [oso_load,oso_write],
+          {heap} [oso_load,oso_write]
         );
         );
       begin
       begin
         result:=secoptions[atype];
         result:=secoptions[atype];

+ 3 - 1
compiler/ogcoff.pas

@@ -539,7 +539,9 @@ implementation
           '.objc_nlclasslist',
           '.objc_nlclasslist',
           '.objc_catlist',
           '.objc_catlist',
           '.obcj_nlcatlist',
           '.obcj_nlcatlist',
-          '.objc_protolist'
+          '.objc_protolist',
+          '.stack',
+          '.heap'
         );
         );
 
 
 const go32v2stub : array[0..2047] of byte=(
 const go32v2stub : array[0..2047] of byte=(

+ 3 - 1
compiler/ogelf.pas

@@ -793,7 +793,9 @@ implementation
           '.objc_nlclasslist',
           '.objc_nlclasslist',
           '.objc_catlist',
           '.objc_catlist',
           '.obcj_nlcatlist',
           '.obcj_nlcatlist',
-          '.objc_protolist'
+          '.objc_protolist',
+          '.stack',
+          '.heap'
         );
         );
       var
       var
         sep : string[3];
         sep : string[3];

+ 31 - 3
compiler/options.pas

@@ -1009,7 +1009,13 @@ begin
                     's' :
                     's' :
                       begin
                       begin
                          val(copy(more,j+1,length(more)-j),stacksize,code);
                          val(copy(more,j+1,length(more)-j),stacksize,code);
-                         if (code<>0) or (stacksize>=67107840) or (stacksize<1024) then
+                         if (code<>0)
+{$ifdef cpu16bitaddr}
+                            or (stacksize>=65521)
+{$else cpu16bitaddr}
+                            or (stacksize>=67107840)
+{$endif cpu16bitaddr}
+                            or (stacksize<1024) then
                           IllegalPara(opt);
                           IllegalPara(opt);
                          break;
                          break;
                       end;
                       end;
@@ -2717,6 +2723,14 @@ end;
 
 
 procedure TOption.checkoptionscompatibility;
 procedure TOption.checkoptionscompatibility;
 begin
 begin
+{$ifdef i8086}
+  if (apptype=app_com) and (init_settings.x86memorymodel<>mm_tiny) then
+    begin
+      Message(option_com_files_require_tiny_model);
+      StopOptions(1);
+    end;
+{$endif i8086}
+
   if (paratargetdbg in [dbg_dwarf2,dbg_dwarf3]) and
   if (paratargetdbg in [dbg_dwarf2,dbg_dwarf3]) and
      not(target_info.system in (systems_darwin+[system_i8086_msdos])) then
      not(target_info.system in (systems_darwin+[system_i8086_msdos])) then
     begin
     begin
@@ -2934,9 +2948,13 @@ begin
   def_system_macro('FPC_STATICRIPFIXED');
   def_system_macro('FPC_STATICRIPFIXED');
   def_system_macro('FPC_VARIANTCOPY_FIXED');
   def_system_macro('FPC_VARIANTCOPY_FIXED');
   def_system_macro('FPC_DYNARRAYCOPY_FIXED');
   def_system_macro('FPC_DYNARRAYCOPY_FIXED');
-{$if defined(x86) or defined(powerpc) or defined(powerpc64) or defined(cpuarm)}
+
+{ abs(long) is handled internally on all CPUs }
   def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
   def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
-{$endif}
+{$if defined(x86_64) or defined(powerpc64)}
+  def_system_macro('FPC_HAS_INTERNAL_ABS_INT64');
+{$endif x86_64 or powerpc64}
+
   def_system_macro('FPC_HAS_UNICODESTRING');
   def_system_macro('FPC_HAS_UNICODESTRING');
   def_system_macro('FPC_RTTI_PACKSET1');
   def_system_macro('FPC_RTTI_PACKSET1');
   def_system_macro('FPC_HAS_CPSTRING');
   def_system_macro('FPC_HAS_CPSTRING');
@@ -3560,6 +3578,16 @@ if (target_info.abi = abi_eabihf) then
   def_system_macro('FPC_HAS_INTERNAL_BSF');
   def_system_macro('FPC_HAS_INTERNAL_BSF');
   def_system_macro('FPC_HAS_INTERNAL_BSR');
   def_system_macro('FPC_HAS_INTERNAL_BSR');
 {$endif}
 {$endif}
+
+{ hardware FMA support }
+{$if defined(i386) or defined(x86_64)}
+  if (cpu_capabilities[current_settings.cputype]*[CPUX86_HAS_FMA,CPUX86_HAS_FMA4])<>[] then
+    begin
+      def_system_macro('FPC_HAS_FAST_FMA_SINGLE');
+      def_system_macro('FPC_HAS_FAST_FMA_DOUBLE');
+    end;
+{$endif defined(i386) or defined(x86_64)}
+
 {$if defined(arm)}
 {$if defined(arm)}
   { it is determined during system unit compilation if clz is used for bsf or not,
   { it is determined during system unit compilation if clz is used for bsf or not,
     this is not perfect but the current implementation bsf/bsr does not allow another
     this is not perfect but the current implementation bsf/bsr does not allow another

+ 19 - 0
compiler/parser.pas

@@ -122,6 +122,25 @@ implementation
              include(supported_calling_conventions,pocall_syscall);
              include(supported_calling_conventions,pocall_syscall);
            system_m68k_amiga:
            system_m68k_amiga:
              include(supported_calling_conventions,pocall_syscall);
              include(supported_calling_conventions,pocall_syscall);
+{$ifdef i8086}
+           system_i8086_msdos:
+             begin
+               if stacksize=0 then
+                 begin
+                   if init_settings.x86memorymodel in x86_far_data_models then
+                     stacksize:=16384
+                   else
+                     stacksize:=4096;
+                 end;
+               if maxheapsize=0 then
+                 begin
+                   if init_settings.x86memorymodel in x86_far_data_models then
+                     maxheapsize:=655360
+                   else
+                     maxheapsize:=65520;
+                 end;
+             end;
+{$endif i8086}
          end;
          end;
       end;
       end;
 
 

+ 13 - 0
compiler/pbase.pas

@@ -65,6 +65,7 @@ interface
        parse_generic : boolean;
        parse_generic : boolean;
 
 
     procedure identifier_not_found(const s:string);
     procedure identifier_not_found(const s:string);
+    procedure identifier_not_found(const s:string;const filepos:tfileposinfo);
 
 
 {    function tokenstring(i : ttoken):string;}
 {    function tokenstring(i : ttoken):string;}
 
 
@@ -118,6 +119,18 @@ implementation
        end;
        end;
 
 
 
 
+     procedure identifier_not_found(const s:string;const filepos:tfileposinfo);
+       begin
+         MessagePos1(filepos,sym_e_id_not_found,s);
+         { show a fatal that you need -S2 or -Sd, but only
+           if we just parsed the a token that has m_class }
+         if not(m_class in current_settings.modeswitches) and
+            (Upper(s)=pattern) and
+            (m_class in tokeninfo^[idtoken].keyword) then
+           MessagePos(filepos,parser_f_need_objfpc_or_delphi_mode);
+       end;
+
+
     { consumes token i, write error if token is different }
     { consumes token i, write error if token is different }
     procedure consume(i : ttoken);
     procedure consume(i : ttoken);
       begin
       begin

+ 13 - 6
compiler/pdecl.pas

@@ -438,7 +438,7 @@ implementation
          isgeneric,
          isgeneric,
          isunique,
          isunique,
          istyperenaming : boolean;
          istyperenaming : boolean;
-         generictypelist : TFPObjectList;
+         generictypelist : tfphashobjectlist;
          generictokenbuf : tdynamicarray;
          generictokenbuf : tdynamicarray;
          vmtbuilder : TVMTBuilder;
          vmtbuilder : TVMTBuilder;
          p:tnode;
          p:tnode;
@@ -719,6 +719,14 @@ implementation
                     try_consume_hintdirective(newtype.symoptions,newtype.deprecatedmsg);
                     try_consume_hintdirective(newtype.symoptions,newtype.deprecatedmsg);
                     consume(_SEMICOLON);
                     consume(_SEMICOLON);
 {$ifdef x86}
 {$ifdef x86}
+  {$ifdef i8086}
+                    if try_to_consume(_HUGE) then
+                     begin
+                       tcpupointerdef(hdef).x86pointertyp:=x86pt_huge;
+                       consume(_SEMICOLON);
+                     end
+                    else
+  {$endif i8086}
                     if try_to_consume(_FAR) then
                     if try_to_consume(_FAR) then
                      begin
                      begin
   {$if defined(i8086)}
   {$if defined(i8086)}
@@ -728,7 +736,7 @@ implementation
   {$elseif defined(x86_64)}
   {$elseif defined(x86_64)}
                        { for compatibility with previous versions of fpc,
                        { for compatibility with previous versions of fpc,
                          far pointer = regular pointer on x86_64 }
                          far pointer = regular pointer on x86_64 }
-                       { TODO: decide if we still want to keep this }
+                       Message1(parser_w_ptr_type_ignored,'FAR');
   {$endif}
   {$endif}
                        consume(_SEMICOLON);
                        consume(_SEMICOLON);
                      end
                      end
@@ -755,10 +763,10 @@ implementation
                        end;
                        end;
 {$else x86}
 {$else x86}
                     { Previous versions of FPC support declaring a pointer as
                     { Previous versions of FPC support declaring a pointer as
-                      far even on non-x86 platforms.
-                      TODO: decide if we still want to keep this }
+                      far even on non-x86 platforms. }
                     if try_to_consume(_FAR) then
                     if try_to_consume(_FAR) then
                      begin
                      begin
+                       Message1(parser_w_ptr_type_ignored,'FAR');
                        consume(_SEMICOLON);
                        consume(_SEMICOLON);
                      end;
                      end;
 {$endif x86}
 {$endif x86}
@@ -798,8 +806,7 @@ implementation
 
 
                     { Build VMT indexes, skip for type renaming and forward classes }
                     { Build VMT indexes, skip for type renaming and forward classes }
                     if (hdef.typesym=newtype) and
                     if (hdef.typesym=newtype) and
-                       not(oo_is_forward in tobjectdef(hdef).objectoptions) and
-                       not(df_generic in hdef.defoptions) then
+                       not(oo_is_forward in tobjectdef(hdef).objectoptions) then
                       begin
                       begin
                         vmtbuilder:=TVMTBuilder.Create(tobjectdef(hdef));
                         vmtbuilder:=TVMTBuilder.Create(tobjectdef(hdef));
                         vmtbuilder.generate_vmt;
                         vmtbuilder.generate_vmt;

+ 10 - 22
compiler/pdecobj.pas

@@ -30,7 +30,7 @@ interface
       globtype,symconst,symtype,symdef;
       globtype,symconst,symtype,symdef;
 
 
     { parses a object declaration }
     { parses a object declaration }
-    function object_dec(objecttype:tobjecttyp;const n:tidstring;objsym:tsym;genericdef:tstoreddef;genericlist:TFPObjectList;fd : tobjectdef;helpertype:thelpertype) : tobjectdef;
+    function object_dec(objecttype:tobjecttyp;const n:tidstring;objsym:tsym;genericdef:tstoreddef;genericlist:tfphashobjectlist;fd : tobjectdef;helpertype:thelpertype) : tobjectdef;
 
 
     { parses a (class) method declaration }
     { parses a (class) method declaration }
     function method_dec(astruct: tabstractrecorddef; is_classdef: boolean): tprocdef;
     function method_dec(astruct: tabstractrecorddef; is_classdef: boolean): tprocdef;
@@ -1293,7 +1293,7 @@ implementation
       end;
       end;
 
 
 
 
-    function object_dec(objecttype:tobjecttyp;const n:tidstring;objsym:tsym;genericdef:tstoreddef;genericlist:TFPObjectList;fd : tobjectdef;helpertype:thelpertype) : tobjectdef;
+    function object_dec(objecttype:tobjecttyp;const n:tidstring;objsym:tsym;genericdef:tstoreddef;genericlist:tfphashobjectlist;fd : tobjectdef;helpertype:thelpertype) : tobjectdef;
       var
       var
         old_current_structdef: tabstractrecorddef;
         old_current_structdef: tabstractrecorddef;
         old_current_genericdef,
         old_current_genericdef,
@@ -1363,21 +1363,7 @@ implementation
                       if (current_structdef.objname^='TOBJECT') then
                       if (current_structdef.objname^='TOBJECT') then
                         class_tobject:=current_objectdef
                         class_tobject:=current_objectdef
                       else if (current_objectdef.objname^='JLOBJECT') then
                       else if (current_objectdef.objname^='JLOBJECT') then
-                        begin
-                          java_jlobject:=current_objectdef;
-                          { the methodpointer type is normally created in
-                            psystem, but java_jlobject is not yet available
-                            there... }
-                          hrecst:=trecordsymtable.create('',1);
-                          fsym:=cfieldvarsym.create('$proc',vs_value,java_jlobject,[]);
-                          hrecst.insert(fsym);
-                          hrecst.addfield(fsym,vis_hidden);
-                          fsym:=cfieldvarsym.create('$data',vs_value,java_jlobject,[]);
-                          hrecst.insert(fsym);
-                          hrecst.addfield(fsym,vis_hidden);
-                          methodpointertype:=crecorddef.create('',hrecst);
-                          systemunit.insert(ctypesym.create('$methodpointer',methodpointertype));
-                        end
+                        java_jlobject:=current_objectdef
                       else if (current_objectdef.objname^='JLTHROWABLE') then
                       else if (current_objectdef.objname^='JLTHROWABLE') then
                         java_jlthrowable:=current_objectdef
                         java_jlthrowable:=current_objectdef
                       else if (current_objectdef.objname^='FPCBASERECORDTYPE') then
                       else if (current_objectdef.objname^='FPCBASERECORDTYPE') then
@@ -1411,9 +1397,9 @@ implementation
 
 
         { usage of specialized type inside its generic template }
         { usage of specialized type inside its generic template }
         if assigned(genericdef) then
         if assigned(genericdef) then
-          current_specializedef:=current_structdef
+          current_specializedef:=current_structdef;
         { reject declaration of generic class inside generic class }
         { reject declaration of generic class inside generic class }
-        else if assigned(genericlist) then
+        if assigned(genericlist) then
           current_genericdef:=current_structdef;
           current_genericdef:=current_structdef;
 
 
         { nested types of specializations are specializations as well }
         { nested types of specializations are specializations as well }
@@ -1496,10 +1482,12 @@ implementation
             parse_guid;
             parse_guid;
 
 
             { classes can handle links to themself not only inside type blocks
             { classes can handle links to themself not only inside type blocks
-              but in const blocks too. to make this possible we need to set
-              their symbols to real defs instead of errordef }
+              but in const blocks too. Additionally this is needed to parse parameters that are
+              specializations of the currently parsed type in basically everything except C++ and
+              ObjC classes. To make this possible we need to set their symbols to real defs instead
+              of errordef }
 
 
-            if assigned(objsym) and (objecttype in [odt_class,odt_javaclass,odt_interfacejava]) then
+            if assigned(objsym) and not (objecttype in [odt_cppclass,odt_objccategory,odt_objcclass,odt_objcprotocol]) then
               begin
               begin
                 olddef:=ttypesym(objsym).typedef;
                 olddef:=ttypesym(objsym).typedef;
                 ttypesym(objsym).typedef:=current_structdef;
                 ttypesym(objsym).typedef:=current_structdef;

+ 35 - 6
compiler/pdecsub.pas

@@ -255,6 +255,8 @@ implementation
                vs:=tparavarsym(sc[0]);
                vs:=tparavarsym(sc[0]);
                if sc.count>1 then
                if sc.count>1 then
                  Message(parser_e_default_value_only_one_para);
                  Message(parser_e_default_value_only_one_para);
+               if not(vs.varspez in [vs_value,vs_const]) then
+                 Message(parser_e_default_value_val_const);
                bt:=block_type;
                bt:=block_type;
                block_type:=bt_const;
                block_type:=bt_const;
                { prefix 'def' to the parameter name }
                { prefix 'def' to the parameter name }
@@ -399,7 +401,7 @@ implementation
                 consume(_ARRAY);
                 consume(_ARRAY);
                 consume(_OF);
                 consume(_OF);
                 { define range and type of range }
                 { define range and type of range }
-                hdef:=carraydef.create(0,-1,s32inttype);
+                hdef:=carraydef.create(0,-1,ptrsinttype);
                 { array of const ? }
                 { array of const ? }
                 if (token=_CONST) and (m_objpas in current_settings.modeswitches) then
                 if (token=_CONST) and (m_objpas in current_settings.modeswitches) then
                  begin
                  begin
@@ -547,6 +549,9 @@ implementation
         srsym : tsym;
         srsym : tsym;
         checkstack : psymtablestackitem;
         checkstack : psymtablestackitem;
         procstartfilepos : tfileposinfo;
         procstartfilepos : tfileposinfo;
+        i,
+        index : longint;
+        found,
         searchagain : boolean;
         searchagain : boolean;
         st,
         st,
         genericst: TSymtable;
         genericst: TSymtable;
@@ -729,8 +734,7 @@ implementation
               begin
               begin
                 str(genparalist.count,gencount);
                 str(genparalist.count,gencount);
                 genname:=sp+'$'+gencount;
                 genname:=sp+'$'+gencount;
-                if not parse_generic then
-                  genname:=generate_generic_name(genname,specializename);
+                genname:=generate_generic_name(genname,specializename);
                 ugenname:=upper(genname);
                 ugenname:=upper(genname);
 
 
                 srsym:=search_object_name(ugenname,false);
                 srsym:=search_object_name(ugenname,false);
@@ -990,9 +994,34 @@ implementation
                 genericst:=pd.struct.genericdef.GetSymtable(gs_record);
                 genericst:=pd.struct.genericdef.GetSymtable(gs_record);
                 if not assigned(genericst) then
                 if not assigned(genericst) then
                   internalerror(200512114);
                   internalerror(200512114);
-                { We are parsing the same objectdef, the def index numbers
-                  are the same }
-                pd.genericdef:=tstoreddef(genericst.DefList[pd.owner.DefList.IndexOf(pd)]);
+
+                { when searching for the correct procdef to use as genericdef we need to ignore
+                  everything except procdefs so that we can find the correct indices }
+                index:=0;
+                found:=false;
+                for i:=0 to pd.owner.deflist.count-1 do
+                  begin
+                    if tdef(pd.owner.deflist[i]).typ<>procdef then
+                      continue;
+                    if pd.owner.deflist[i]=pd then
+                      begin
+                        found:=true;
+                        break;
+                      end;
+                    inc(index);
+                  end;
+                if not found then
+                  internalerror(2014052301);
+
+                for i:=0 to genericst.deflist.count-1 do
+                  begin
+                    if tdef(genericst.deflist[i]).typ<>procdef then
+                      continue;
+                    if index=0 then
+                      pd.genericdef:=tstoreddef(genericst.deflist[i]);
+                    dec(index);
+                  end;
+
                 if not assigned(pd.genericdef) or
                 if not assigned(pd.genericdef) or
                    (pd.genericdef.typ<>procdef) then
                    (pd.genericdef.typ<>procdef) then
                   internalerror(200512115);
                   internalerror(200512115);

+ 66 - 180
compiler/pdecvar.pas

@@ -57,9 +57,6 @@ implementation
        symconst,symbase,symtype,defutil,defcmp,symcreat,
        symconst,symbase,symtype,defutil,defcmp,symcreat,
 {$if defined(i386) or defined(i8086)}
 {$if defined(i386) or defined(i8086)}
        symcpu,
        symcpu,
-{$endif}
-{$ifdef jvm}
-       jvmdef,
 {$endif}
 {$endif}
        fmodule,htypechk,
        fmodule,htypechk,
        { pass 1 }
        { pass 1 }
@@ -70,9 +67,6 @@ implementation
        { parser }
        { parser }
        scanner,
        scanner,
        pbase,pexpr,ptype,ptconst,pdecsub,
        pbase,pexpr,ptype,ptconst,pdecsub,
-{$ifdef jvm}
-       pjvm,
-{$endif}
        { link }
        { link }
        import
        import
        ;
        ;
@@ -82,7 +76,7 @@ implementation
 
 
         { convert a node tree to symlist and return the last
         { convert a node tree to symlist and return the last
           symbol }
           symbol }
-        function parse_symlist(pl:tpropaccesslist;var def:tdef):boolean;
+        function parse_symlist(pl:tpropaccesslist;out def:tdef):boolean;
           var
           var
             idx : longint;
             idx : longint;
             sym : tsym;
             sym : tsym;
@@ -341,16 +335,13 @@ implementation
          paranr : word;
          paranr : word;
          i      : longint;
          i      : longint;
          ImplIntf     : TImplementedInterface;
          ImplIntf     : TImplementedInterface;
-         found        : boolean;
+         found,
+         gotreadorwrite: boolean;
          hreadparavs,
          hreadparavs,
          hparavs      : tparavarsym;
          hparavs      : tparavarsym;
          storedprocdef: tprocvardef;
          storedprocdef: tprocvardef;
          readprocdef,
          readprocdef,
          writeprocdef : tprocdef;
          writeprocdef : tprocdef;
- {$ifdef jvm}
-          orgaccesspd : tprocdef;
-          wrongvisibility : boolean;
- {$endif}
       begin
       begin
          result:=nil;
          result:=nil;
          { Generate temp procdefs to search for matching read/write
          { Generate temp procdefs to search for matching read/write
@@ -502,8 +493,7 @@ implementation
                  not(is_dispinterface(astruct)) then
                  not(is_dispinterface(astruct)) then
                 begin
                 begin
                   tpropertysym(overridden).makeduplicate(p,readprocdef,writeprocdef,paranr);
                   tpropertysym(overridden).makeduplicate(p,readprocdef,writeprocdef,paranr);
-                  p.overriddenpropsym:=tpropertysym(overridden);
-                  include(p.propoptions,ppo_overrides);
+                  p.register_override(tpropertysym(overridden));
                 end
                 end
               else
               else
                 begin
                 begin
@@ -520,164 +510,56 @@ implementation
 
 
          if not(is_dispinterface(astruct)) then
          if not(is_dispinterface(astruct)) then
            begin
            begin
+             gotreadorwrite:=false;
+             { parse accessors }
              if try_to_consume(_READ) then
              if try_to_consume(_READ) then
                begin
                begin
+                 gotreadorwrite:=true;
                  p.propaccesslist[palt_read].clear;
                  p.propaccesslist[palt_read].clear;
                  if parse_symlist(p.propaccesslist[palt_read],def) then
                  if parse_symlist(p.propaccesslist[palt_read],def) then
                   begin
                   begin
                     sym:=p.propaccesslist[palt_read].firstsym^.sym;
                     sym:=p.propaccesslist[palt_read].firstsym^.sym;
-                    case sym.typ of
-                      procsym :
-                        begin
-                          { read is function returning the type of the property }
-                          readprocdef.returndef:=p.propdef;
-                          { Insert hidden parameters }
-                          handle_calling_convention(readprocdef);
-                          { search procdefs matching readprocdef }
-                          { we ignore hidden stuff here because the property access symbol might have
-                            non default calling conventions which might change the hidden stuff;
-                            see tw3216.pp (FK) }
-                          p.propaccesslist[palt_read].procdef:=Tprocsym(sym).Find_procdef_bypara(readprocdef.paras,p.propdef,[cpo_allowdefaults,cpo_ignorehidden]);
-                          if not assigned(p.propaccesslist[palt_read].procdef) or
-                            { because of cpo_ignorehidden we need to compare if it is a static class method and we have a class property }
-                            ((sp_static in p.symoptions) <> tprocdef(p.propaccesslist[palt_read].procdef).no_self_node) then
-                            Message(parser_e_ill_property_access_sym)
-                          else
-                            begin
-{$ifdef jvm}
-                              orgaccesspd:=tprocdef(p.propaccesslist[palt_read].procdef);
-                              wrongvisibility:=tprocdef(p.propaccesslist[palt_read].procdef).visibility<p.visibility;
-                              if (prop_auto_getter_prefix<>'') and
-                                 (wrongvisibility or
-                                   (p.propaccesslist[palt_read].firstsym^.sym.RealName<>prop_auto_getter_prefix+p.RealName)) then
-                                jvm_create_getter_for_property(p,orgaccesspd)
-                              { if the visibility of the getter is lower than
-                                the visibility of the property, wrap it so that
-                                we can call it from all contexts in which the
-                                property is visible }
-                              else if wrongvisibility then
-                               begin
-                                 p.propaccesslist[palt_read].procdef:=jvm_wrap_method_with_vis(tprocdef(p.propaccesslist[palt_read].procdef),p.visibility);
-                                 p.propaccesslist[palt_read].firstsym^.sym:=tprocdef(p.propaccesslist[palt_read].procdef).procsym;
-                               end;
-{$endif jvm}
-                            end;
-                        end;
-                      fieldvarsym :
-                        begin
-                          if not assigned(def) then
-                            internalerror(200310071);
-                          if compare_defs(def,p.propdef,nothingn)>=te_equal then
-                           begin
-                             { property parameters are allowed if this is
-                               an indexed property, because the index is then
-                               the parameter.
-                               Note: In the help of Kylix it is written
-                               that it isn't allowed, but the compiler accepts it (PFV) }
-                             if (ppo_hasparameters in p.propoptions) or
-                                ((sp_static in p.symoptions) <> (sp_static in sym.symoptions)) then
-                               Message(parser_e_ill_property_access_sym);
-{$ifdef jvm}
-                             { if the visibility of the field is lower than the
-                               visibility of the property, wrap it in a getter
-                               so that we can access it from all contexts in
-                               which the property is visibile }
-                             if (prop_auto_getter_prefix<>'') or
-                                (tfieldvarsym(sym).visibility<p.visibility) then
-                               jvm_create_getter_for_property(p,nil);
-{$endif}
-                           end
-                          else
-                           IncompatibleTypes(def,p.propdef);
-                        end;
-                      else
-                        Message(parser_e_ill_property_access_sym);
-                    end;
+                    { getter is a function returning the type of the property }
+                    if sym.typ=procsym then
+                      begin
+                        readprocdef.returndef:=p.propdef;
+                        { Insert hidden parameters }
+                        handle_calling_convention(readprocdef);
+                      end;
+                    p.add_getter_or_setter_for_sym(palt_read,sym,def,readprocdef);
                   end;
                   end;
-               end;
+               end
+             else
+               p.inherit_accessor(palt_read);
              if try_to_consume(_WRITE) then
              if try_to_consume(_WRITE) then
                begin
                begin
+                 gotreadorwrite:=true;
                  p.propaccesslist[palt_write].clear;
                  p.propaccesslist[palt_write].clear;
                  if parse_symlist(p.propaccesslist[palt_write],def) then
                  if parse_symlist(p.propaccesslist[palt_write],def) then
                   begin
                   begin
                     sym:=p.propaccesslist[palt_write].firstsym^.sym;
                     sym:=p.propaccesslist[palt_write].firstsym^.sym;
-                    case sym.typ of
-                      procsym :
-                        begin
-                          { write is a procedure with an extra value parameter
-                            of the of the property }
-                          writeprocdef.returndef:=voidtype;
-                          inc(paranr);
-                          hparavs:=cparavarsym.create('$value',10*paranr,vs_value,p.propdef,[]);
-                          writeprocdef.parast.insert(hparavs);
-                          { Insert hidden parameters }
-                          handle_calling_convention(writeprocdef);
-                          { search procdefs matching writeprocdef }
-                          { skip hidden part (same as for _READ part ) because of the }
-                          { possible different calling conventions and especialy for  }
-                          { records - their methods hidden parameters are handled     }
-                          { after the full record parse                               }
-                          if cs_varpropsetter in current_settings.localswitches then
-                            p.propaccesslist[palt_write].procdef:=Tprocsym(sym).Find_procdef_bypara(writeprocdef.paras,writeprocdef.returndef,[cpo_allowdefaults,cpo_ignorevarspez,cpo_ignorehidden])
-                          else
-                            p.propaccesslist[palt_write].procdef:=Tprocsym(sym).Find_procdef_bypara(writeprocdef.paras,writeprocdef.returndef,[cpo_allowdefaults,cpo_ignorehidden]);
-                          if not assigned(p.propaccesslist[palt_write].procdef) or
-                             { because of cpo_ignorehidden we need to compare if it is a static class method and we have a class property }
-                             ((sp_static in p.symoptions) <> tprocdef(p.propaccesslist[palt_write].procdef).no_self_node) then
-                            Message(parser_e_ill_property_access_sym)
-                          else
-                            begin
-{$ifdef jvm}
-                              orgaccesspd:=tprocdef(p.propaccesslist[palt_write].procdef);
-                              wrongvisibility:=tprocdef(p.propaccesslist[palt_write].procdef).visibility<p.visibility;
-                              if (prop_auto_setter_prefix<>'') and
-                                 ((sym.RealName<>prop_auto_setter_prefix+p.RealName) or
-                                  wrongvisibility) then
-                                jvm_create_setter_for_property(p,orgaccesspd)
-                              { if the visibility of the setter is lower than
-                                the visibility of the property, wrap it so that
-                                we can call it from all contexts in which the
-                                property is visible }
-                              else if wrongvisibility then
-                                begin
-                                  p.propaccesslist[palt_write].procdef:=jvm_wrap_method_with_vis(tprocdef(p.propaccesslist[palt_write].procdef),p.visibility);
-                                  p.propaccesslist[palt_write].firstsym^.sym:=tprocdef(p.propaccesslist[palt_write].procdef).procsym;
-                                end;
-{$endif jvm}
-                            end;
-                        end;
-                      fieldvarsym :
-                        begin
-                          if not assigned(def) then
-                            internalerror(200310072);
-                          if compare_defs(def,p.propdef,nothingn)>=te_equal then
-                           begin
-                             { property parameters are allowed if this is
-                               an indexed property, because the index is then
-                               the parameter.
-                               Note: In the help of Kylix it is written
-                               that it isn't allowed, but the compiler accepts it (PFV) }
-                             if (ppo_hasparameters in p.propoptions) or
-                                ((sp_static in p.symoptions) <> (sp_static in sym.symoptions)) then
-                              Message(parser_e_ill_property_access_sym);
-{$ifdef jvm}
-                             { if the visibility of the field is lower than the
-                               visibility of the property, wrap it in a getter
-                               so that we can access it from all contexts in
-                               which the property is visibile }
-                             if (prop_auto_setter_prefix<>'') or
-                                (tfieldvarsym(sym).visibility<p.visibility) then
-                               jvm_create_setter_for_property(p,nil);
-{$endif}
-                           end
-                          else
-                           IncompatibleTypes(def,p.propdef);
-                        end;
-                      else
-                        Message(parser_e_ill_property_access_sym);
-                    end;
+                    if sym.typ=procsym then
+                      begin
+                        { settter is a procedure with an extra value parameter
+                          of the of the property }
+                        writeprocdef.returndef:=voidtype;
+                        inc(paranr);
+                        hparavs:=cparavarsym.create('$value',10*paranr,vs_value,p.propdef,[]);
+                        writeprocdef.parast.insert(hparavs);
+                        { Insert hidden parameters }
+                        handle_calling_convention(writeprocdef);
+                      end;
+                    p.add_getter_or_setter_for_sym(palt_write,sym,def,writeprocdef);
                   end;
                   end;
-               end;
+               end
+             else
+               p.inherit_accessor(palt_write);
+             { a new property (needs to declare a getter or setter, except in
+               an interface }
+             if not(ppo_overrides in p.propoptions) and
+                not is_interface(astruct) and
+                not gotreadorwrite then
+               Consume(_READ);
            end
            end
          else
          else
            parse_dispinterface(p,readprocdef,writeprocdef,paranr);
            parse_dispinterface(p,readprocdef,writeprocdef,paranr);
@@ -1582,6 +1464,7 @@ implementation
          usedalign,
          usedalign,
          maxalignment,startvarrecalign,
          maxalignment,startvarrecalign,
          maxpadalign, startpadalign: shortint;
          maxpadalign, startpadalign: shortint;
+         stowner : tdef;
          pt : tnode;
          pt : tnode;
          fieldvs   : tfieldvarsym;
          fieldvs   : tfieldvarsym;
          hstaticvs : tstaticvarsym;
          hstaticvs : tstaticvarsym;
@@ -1653,29 +1536,34 @@ implementation
              { allow only static fields reference to struct where they are declared }
              { allow only static fields reference to struct where they are declared }
              if not (vd_class in options) then
              if not (vd_class in options) then
                begin
                begin
-                 if hdef.typ=arraydef then
+                 stowner:=tdef(recst.defowner);
+                 while assigned(stowner) and (stowner.typ in [objectdef,recorddef]) do
                    begin
                    begin
-                     tmpdef:=hdef;
-                     while (tmpdef.typ=arraydef) do
+                     if hdef.typ=arraydef then
                        begin
                        begin
-                         { dynamic arrays are allowed }
-                         if ado_IsDynamicArray in tarraydef(tmpdef).arrayoptions then
+                         tmpdef:=hdef;
+                         while (tmpdef.typ=arraydef) do
                            begin
                            begin
-                             tmpdef:=nil;
-                             break;
+                             { dynamic arrays are allowed }
+                             if ado_IsDynamicArray in tarraydef(tmpdef).arrayoptions then
+                               begin
+                                 tmpdef:=nil;
+                                 break;
+                               end;
+                             tmpdef:=tarraydef(tmpdef).elementdef;
                            end;
                            end;
-                         tmpdef:=tarraydef(tmpdef).elementdef;
+                       end
+                     else
+                       tmpdef:=hdef;
+                     if assigned(tmpdef) and
+                         (is_object(tmpdef) or is_record(tmpdef)) and
+                         is_owned_by(tabstractrecorddef(stowner),tabstractrecorddef(tmpdef)) then
+                       begin
+                         Message1(type_e_type_is_not_completly_defined, tabstractrecorddef(tmpdef).RttiName);
+                         { for error recovery or compiler will crash later }
+                         hdef:=generrordef;
                        end;
                        end;
-                   end
-                 else
-                   tmpdef:=hdef;
-                 if assigned(tmpdef) and
-                     (is_object(tmpdef) or is_record(tmpdef)) and
-                     is_owned_by(tabstractrecorddef(recst.defowner),tabstractrecorddef(tmpdef)) then
-                   begin
-                     Message1(type_e_type_is_not_completly_defined, tabstractrecorddef(tmpdef).RttiName);
-                     { for error recovery or compiler will crash later }
-                     hdef:=generrordef;
+                     stowner:=tdef(stowner.owner.defowner);
                    end;
                    end;
                end;
                end;
 
 
@@ -1791,10 +1679,8 @@ implementation
                      fieldvs:=tfieldvarsym(sc[i]);
                      fieldvs:=tfieldvarsym(sc[i]);
                      fieldvs.visibility:=visibility;
                      fieldvs.visibility:=visibility;
                      hstaticvs:=make_field_static(recst,fieldvs);
                      hstaticvs:=make_field_static(recst,fieldvs);
-                     { for generics it would be better to disable the following,
-                       but simply disabling it in that case breaks linking with
-                       debug info }
-                     cnodeutils.insertbssdata(hstaticvs);
+                     if not parse_generic then
+                       cnodeutils.insertbssdata(hstaticvs);
                      if vd_final in options then
                      if vd_final in options then
                        hstaticvs.varspez:=vs_final;
                        hstaticvs.varspez:=vs_final;
                    end;
                    end;

部分文件因文件數量過多而無法顯示