Commit Graph

63587 Commits

Author SHA1 Message Date
florian
ea6529ff63 * manually merged merge request 69 by J. Gareth "Kit" Moreton:
x86: CMP/MOV refactoring and expansion
      This merge request refactors the SwapMovCmp routine, and calls to it, to be more self-contained,
      having the preliminary checks built-in to ensure that moving the MOV instruction is
      actually a sound idea, while also making it more general-purpose so it can handle instructions
      that are not MOV operations. This feature is primarily for future expansion,
      but also cleans up the code for the x86 peephole optimizer.
2021-10-17 10:22:30 +02:00
florian
4012c3dbd4 * merge request 75 by J. Gareth "Kit" Moreton manually applied:
This merge request makes a number of improvements to the DeepMOVOpt method and supporting functions:

      * ReplaceRegisterInInstruction now replaces registers in references that are written to
        (since the registers themselves won't change)
      * RegModifiedByInstruction will no longer return True for a register that appears in a reference
        that's written to (for the same reason as above) - special operations like MOVSS
        (the 0-operand version) aren't affected.
      * DeepMOVOpt returning True will now always set the Result of OptPass1MOV to True even though p
        wasn't directly modified, since this often caused missed optimisations.
      * Some of the speed-ups in the patch from #32916 have also been applied in order to make
        the general DeepMOVOpt run faster, notably it tries to avoid calling UpdateUsedRegs where possible.
2021-10-17 09:50:47 +02:00
florian
5c75ef30ce * test for #37785 which is resolved meanwhile 2021-10-16 20:44:52 +02:00
J. Gareth "Curious Kit" Moreton
fd28cc0db0 Better handling of zeroing upper parts of registers
Better handling of zeroing upper parts of registers
2021-10-16 14:42:19 +02:00
J. Gareth "Curious Kit" Moreton
674ed4069a Expanded MM block move to include YMM registers under AVX 2021-10-16 14:17:41 +02:00
florian
d55b2c2a35 + extend assembler optimization MovxMov2Mov to MovxOp2Op 2021-10-15 23:12:59 +02:00
Nikolay Nikolov
21d843128d + added a wrapper function around __wasi_path_readlink that calls it iteratively
with doubling buffer sizes, starting with 64 bytes, until it reaches 16384
  bytes, and reads the link into a rawbytestring. Use that function in all
  places in the WASI rtl that need to read a symlink.
2021-10-15 14:33:43 +03:00
Nikolay Nikolov
0da5d57c1e * replaced the 'if br end_if' sequence with the 'br_if' instruction, when
generating WebAssembly code for try..finally blocks (in all exception modes)
2021-10-14 14:19:13 +03:00
Nikolay Nikolov
dcae87bd52 + support cdecl and stdcall on the WebAssembly target. They are essentially the
same, the only difference is that cdecl creates an unmangled alias
2021-10-14 12:29:59 +03:00
Nikolay Nikolov
b91fc3a0d3 * fixed passing of singleton record parameters, containing a float in WebAssembly 2021-10-14 10:53:55 +03:00
Nikolay Nikolov
df92d88f39 + added support for the handling of singleton record and array types in
defToWasmBasic
2021-10-14 10:53:55 +03:00
Nikolay Nikolov
3511b80972 * fixed formatting in defToWasmBasic 2021-10-14 10:53:55 +03:00
Nikolay Nikolov
ee387f7c66 * C ABI fixes for the passing of records in WebAssembly 2021-10-14 10:53:55 +03:00
Nikolay Nikolov
236e10d03a + pass 64-bit structures by address in WebAssembly for compatibility with LLVM's C ABI 2021-10-14 10:53:55 +03:00
florian
321764bdd9 * fix warnings with -dDEBUG_NODE_XML, resolves #38222 2021-10-13 23:08:32 +02:00
florian
6cb24a3929 * itcpugas unit for Z80 providing gas_regname to fix compilation with -dDEBUG_NODE_XML 2021-10-13 23:08:32 +02:00
Nikolay Nikolov
34587a647f + init the ansistring upper and lower case tables in the WASI SysUtils unit initialization 2021-10-13 06:39:42 +03:00
Nikolay Nikolov
44f862fb4e + added test for SysUtils.GetLocalTime 2021-10-13 03:49:54 +03:00
Nikolay Nikolov
f21273612a + also fill DayOfWeek in the Unix implementation of SysUtils.GetLocalTime 2021-10-13 02:39:04 +03:00
Nikolay Nikolov
f20de5d583 * fixed padding in the filerec to match textrec even on platforms where
sizeof(pointer)<>sizeof(codepointer), like in the medium and compact i8086
  memory models
2021-10-13 02:02:50 +03:00
Nikolay Nikolov
0934df505c + implemented SysUtils.GetLocalTime for WASI 2021-10-13 01:29:04 +03:00
florian
00d4a6889d * add no internal flag when folding constants in taddnode.simplify, resolves #39308 2021-10-12 22:59:45 +02:00
Nikolay Nikolov
099a927331 * fix for the WASI datetime to epoch conversion 2021-10-12 11:27:27 +03:00
Nikolay Nikolov
a55980bfb8 + implemented dos.SetFTime for WASI 2021-10-12 11:06:16 +03:00
Nikolay Nikolov
c4d7773c0e + added platform-specific helper function dos.DTToWasiDate, similar to
DTToUnixDate on Unix
2021-10-12 10:33:28 +03:00
Nikolay Nikolov
ca242e9ad0 + implemented DOS.GetFAttr for WASI 2021-10-12 09:14:14 +03:00
Nikolay Nikolov
4e605fb764 + dummy implementation of dos.SetFAttr for WASI, based on the Unix version 2021-10-12 07:08:32 +03:00
Nikolay Nikolov
00aa7b8ab3 + implemented SysUtils.FileGetAttr for WASI 2021-10-12 05:50:24 +03:00
Nikolay Nikolov
7f7c5785fc * always return an error in SysUtils.FileSetAttr on WASI - this function is not supported by the WASI API 2021-10-12 05:38:16 +03:00
Nikolay Nikolov
809277d2b1 + implemented SysUtils.FileGetSymLinkTarget for WASI 2021-10-12 05:32:53 +03:00
Nikolay Nikolov
1e5ecccdc6 + implemented SysUtils.DirectoryExists for WASI 2021-10-12 03:50:23 +03:00
Nikolay Nikolov
aafb471bc8 * don't set InOutRes in ConvertToFdRelativePath, but return it instead. This
fixes issues in places where this function is used in a way that should not
  set IOResult.
2021-10-12 03:28:03 +03:00
Nikolay Nikolov
4dc0c37678 + implemented SysUtils.FileExists for WASI 2021-10-12 03:28:03 +03:00
Nikolay Nikolov
fe903f2ae4 * fixed range check error in HasDriveLetter when path is 1 character long 2021-10-12 03:28:03 +03:00
Nikolay Nikolov
00d5bb5bbc * fixed off-by-one error when initializing current_drive in the WASI system unit 2021-10-12 03:28:03 +03:00
florian
ca9384fd6c * patch by Dean Mustakino to avoid generation of debug info for generics, resolves #38827
+ test
2021-10-11 18:45:41 +02:00
Nikolay Nikolov
068f781c7a + also implemented FileSetDate(FileName) for WASI, via the __wasi_path_filestat_set_times API call 2021-10-11 17:51:13 +03:00
Nikolay Nikolov
94d8c22c6a + implemented SysUtils.FileSetDate for WASI 2021-10-11 15:51:13 +03:00
Nikolay Nikolov
38075ac30c + implemented SysUtils.FileAge for WASI 2021-10-11 15:26:55 +03:00
Nikolay Nikolov
8f95c14827 + implemented SysUtils.FileGetDate for WASI 2021-10-11 15:08:48 +03:00
Nikolay Nikolov
2a93340bcc + implemented SysUtils.DeleteFile for WASI 2021-10-11 11:27:57 +03:00
Nikolay Nikolov
c8d5bd77a3 - don't call ToSingleByteFileSystemEncodedFileName in SysUtils.FileOpen and
.FileCreate, because ConvertToFdRelativePath already calls it
2021-10-11 11:21:33 +03:00
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