Commit Graph

63495 Commits

Author SHA1 Message Date
Nikolay Nikolov
05c6937fd9 + implemented SysUtils.RenameFile for WASI 2021-10-11 11:14:05 +03:00
Nikolay Nikolov
4c89eaa6cf + implemented SysUtils.FileSeek for WASI 2021-10-11 10:50:44 +03:00
Nikolay Nikolov
14f361e13f + implemented SysUtils.FileWrite for WASI 2021-10-11 10:37:11 +03:00
Nikolay Nikolov
09e61201d2 * fixed WASI bug in do_read, where the result of the __wasi_fd_read syscall function was ignored 2021-10-11 10:33:54 +03:00
Nikolay Nikolov
977b2f2a4b + implemented SysUtils.FileRead for WASI 2021-10-11 10:32:50 +03:00
Nikolay Nikolov
305393a9c1 - removed the zero constants from the implementation of SysUtils.FileOpen for WASI 2021-10-11 10:26:06 +03:00
Nikolay Nikolov
0bbc5a7528 + implemented SysUtils.FileCreate for WASI 2021-10-11 10:24:36 +03:00
Nikolay Nikolov
62846f54ad + implemented SysUtils.FileOpen for WASI 2021-10-11 10:11:07 +03:00
Nikolay Nikolov
aa4070ca8a + implemented SysUtils.FileClose for WASI 2021-10-11 09:52:09 +03:00
Nikolay Nikolov
27df4e98d2 * use rawbytestring instead of ansistring for the WASI file name handling 2021-10-11 09:25:01 +03:00
Nikolay Nikolov
a0e7882692 * use AllowDirectorySeparators, instead of checking for '/' and '\' 2021-10-11 09:04:32 +03:00
Nikolay Nikolov
60d350f067 * another instance of ['/','\'] replaced with AllowDirectorySeparators 2021-10-11 08:56:16 +03:00
Nikolay Nikolov
d7755a56f6 * replaced '/' with DirectorySeparator in the WASI directory parsing code 2021-10-11 08:51:39 +03:00
Nikolay Nikolov
13c344a3a0 * replaced ['/','\'] with AllowDirectorySeparators in the WASI directory
parsing code
2021-10-11 08:45:42 +03:00
Nikolay Nikolov
25ac138092 * keep the drive string separate in the preopen and the current dir records on
the WASI platform
2021-10-11 08:38:33 +03:00
florian
07413be8b5 + being able to define change information for xmm0
* corrected change information for SHA256RNDS2
2021-10-10 23:07:23 +02:00
Nikolay Nikolov
64db584eef * moved the preopened dir and current dir handling types and variables to the
implementation part of the system unit, so their implementation is not exposed
  and can be changed in the future (e.g. for thread safety when WebAssembly
  gets multithreading support, etc.)
2021-10-10 20:25:29 +03:00
Nikolay Nikolov
a62c7555d7 - removed the DebugWriteXXX functions from the WASI system unit, since console
output is now quite stable and can be used for debugging
2021-10-10 20:25:29 +03:00
Nikolay Nikolov
0d6b5338d0 + implemented ChDir() for WASI 2021-10-10 20:25:29 +03:00
Nikolay Nikolov
85ebd2c94c * fixed handling of relative paths that are not directly relative to a preopened
dir in ConvertToFdRelativePath. This is a preparation for ChDir support.
2021-10-10 20:25:29 +03:00
J. Gareth "Curious Kit" Moreton
a925522ead xor optimisation now doesn't check to see if the REX prefix will actually be removed, as it's beneficial for speed reasons to only use the 32-bit register when zeroing the whole thing 2021-10-10 16:17:43 +00:00
florian
2c180cf101 * by default, DEBUG_AOPTCPU is only enabled if the compiler is compiled with -dEXTDEBUG 2021-10-10 15:35:38 +02:00
J. Gareth "Curious Kit" Moreton
d502bccc1b A pair of inlines 2021-10-10 09:19:57 +00:00
florian
a41e991a13 * fix also IDE building after fpccrc to fpchash renaming 2021-10-10 11:15:36 +02:00
florian
cc3cbbb7b9 * fix x86 compilation after my last commit 2021-10-10 10:21:21 +02:00
florian
a4672fbd1c o based on a patch by Rika, resolves #39401:
* use Base64 (62=_, 63=$) encoded FNV hash (instead of CR-32) to shorted identifiers
    * renamed fpccrc to fpchash
    + test
2021-10-10 10:09:22 +02:00
Nikolay Nikolov
bae50d80d2 * preopen fd names and current dir changed to use ansistring, as well as the
parameters and result of ConvertToFdRelativePath. This will allow easier
  implementation of ChDir.
2021-10-10 09:11:19 +03:00
florian
bff09e8e9e + CPU units: check for SHA support 2021-10-09 16:23:11 +02:00
florian
6c7e6191f6 + support of SHA extension in the internal assembler 2021-10-09 15:44:46 +02:00
florian
8f68988aef * another location to use source register as second register in VCVTSD2SS and VCVTSS2SD
to break dependency chains, hopefully final fix for #39360
2021-10-09 14:24:14 +02:00
florian
b4bf371b34 * generate VMOVAPS for (V)Cvtss2CvtSd(V)Cvtsd2ss optimization, resolves #39360 2021-10-08 22:59:29 +02:00
Nikolay Nikolov
344da9597f + added the current WebAssembly exceptions mode to the .ppu module flags and
perform a check to ensure all units are compiled in the same exceptions mode
  as the main program
2021-10-08 23:50:28 +03:00
Yuriy Sydorov
7388735b11 * Strength reduction optimization: - Use a temp for complex loop start values to prevent double evaluation.
- For slow CPUs perform the optimization for all sizes of array elements.
2021-10-08 18:04:03 +03:00
Yuriy Sydorov
6bf4c7a68d * Optimized evaluation of the condition. 2021-10-08 16:51:42 +03:00
Pierre Muller
b93998c17c Disable utils for wasi target, because paszlib cannot be compiled due to use of goto labels 2021-10-08 08:41:14 +00:00
florian
4752230c8f * use source register as second register in VCVTSD2SS and VCVTSS2SD, this should break
dependency chains better and resolves partially #39360
2021-10-07 23:16:39 +02:00
florian
ec40db3da7 + (V)Cvtss2CvtSd(V)Cvtsd2ss2Nop optimization, resolves #39360 2021-10-06 21:57:24 +02:00
florian
d5867793f6 * partially applied patch by J. Gareth "Kit" Moreton to inline parts of cclasses, resolves #39344 2021-10-06 21:24:18 +02:00
Bi0T1N
e77bf0f3bd Add two more templates to show the possibilities 2021-10-06 17:26:28 +00:00
Bi0T1N
25af28de1e Add initial Description templates
this adds a description template for issues as well as for
merge requests that target the compiler
2021-10-06 17:26:28 +00:00
Nikolay Nikolov
d45915b6ba * preopened dirs structure in the system unit modified to be a pointer to an
array of records
2021-10-06 07:44:04 +03:00
Nikolay Nikolov
e078408dcf + implemented SysUtils.GetEnvironmentVariable, GetEnvironmentVariableCount and
GetEnvironmentString for WASI
2021-10-06 06:12:58 +03:00
Nikolay Nikolov
7533496505 + implemented SysUtils.Sleep for WASI 2021-10-06 05:39:11 +03:00
Nikolay Nikolov
d134fc1ddf + implemented SysUtils.GetTickCount64 for WASI 2021-10-06 04:46:44 +03:00
florian
91cf1774dd * replace MT random generator by Xoshiro128**, resolves #38237 2021-10-05 22:20:22 +02:00
Nikolay Nikolov
e19fcd2b8b + implemented GetMsCount in the DOS unit for WASI 2021-10-05 20:49:32 +03:00
Nikolay Nikolov
074ce9c50f + added call to g_maybe_checkforexceptions after generating call to fpc_iocheck 2021-10-05 18:02:11 +03:00
Nikolay Nikolov
3c58f26e83 * thlcgwasm.g_checkexceptions renamed .g_maybe_checkforexceptions, added also as
an empty virtual method in thlcgobj and modified the WebAssembly
  implementation, so that it can be called from any exceptions mode (so it
  emits no code in exception modes that don't require it, instead of generating
  an internal error). This will allow .g_maybe_checkforexceptions to be called
  from the generic parts of the code generator, after calls to systemprocs that
  could raise an exceptions.
2021-10-05 17:54:35 +03:00
Nikolay Nikolov
387c80cc57 + default exception handling in WebAssembly native exceptions mode 2021-10-05 08:02:39 +03:00
Nikolay Nikolov
fab4ca449b * twasmexceptionstatehandler_nativeexceptions.handle_nested_exception and
twasmexceptionstatehandler_bfexceptions.handle_nested_exception should not be
  called, so now they cause an internal error
2021-10-05 07:54:57 +03:00