Implements asin, acos, atan, and atan2.
Also includes some tests in a new test file.
One possible problem here is that I'm not sure how to test what Microsoft's atan and atan2 outputs are in boundary cases like atan2(1, 0). I've made the test suites adhere with the calculator program I've been using (Qalculate, which I assume is using libc's atan2).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55154
--
v9: vkd3d-shader/hlsl: Implement atan and atan2.
vkd3d-shader/hlsl: Implement acos and asin trig intrinsics.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/364
I had a bugreport here: https://bugs.winehq.org/show_bug.cgi?id=56161
This pull req fixes the bug that programs that do VirtualAlloc(placeholder)/VirtualFree(keep placeholder)/MapViewOfFile3(replace placeholder), do not run. Like the dotnet pe loader in .net 7 for example.
It was not clear to me at first, because i didnt notice it on msdn, but the way that Dmitry Timoshkov "hacked" it in https://bugs.winehq.org/show_bug.cgi?id=56122 is actually (nearly) how it is supposed to happen according to msdn.
From here: https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-… ![image](/uploads/58614927d38c15d4c23517aa5dc09d77/image.png)
So thanks to Dmitry Timoshkov. If you are interested you could also look into the thing i mentioned in the bug report, that MapViewOfFile3 doesn't round down to 64k, but, i don't think this is a serious problem yet.
Edit: I found out that under windows, the alignment constraint is not fully lifted but, it is only required to be pagesize aligned if MEM_REPLACE_PLACEHOLDER is present in the flags.
To clarify why i want this in wine. The PE Loader of .net (see here https://github.com/dotnet/runtime/blob/f21dc6c3dceb6ea76bef73e2a026c770aaed…) does align with page size. Not with 64k. This breaks a .net 7 app during load up, that will execute otherwise just execute fine.
--
v20: kernelbase: Added a test for MapViewOfFile3 with MEM_REPLACE_PLACEHOLDER
https://gitlab.winehq.org/wine/wine/-/merge_requests/4822
On Wed Jan 31 00:51:30 2024 +0000, Alexandre Julliard wrote:
> The tests fail on 64-bit:
> ```
> ../wine/tools/runtest -q -P wine -T . -M kernelbase.dll -p
> dlls/kernelbase/tests/x86_64-windows/kernelbase_test.exe process &&
> touch dlls/kernelbase/tests/x86_64-windows/process.ok
> process.c:156: Test failed: VirtualFree failed to split the placeholder 487
> process.c:160: Test failed: MapViewOfFile3 did not map the file mapping 87
> process.c:163: Test failed: UnmapViewOfFile failed 487
> process.c:185: Test failed: VirtualFree of remaining region failed
> make: *** [Makefile:91467:
> dlls/kernelbase/tests/x86_64-windows/process.ok] Error 4
> ```
Oh! To my shame i must admit i tested this with wine-staging patches applied. There is one patch in there that modifies how views are handled.
But anyways, i fixed the tests now, and i believe using VirtualFree in that way is more correct.
I was just curious before, if it would be possible to split a big placeholder allocation into two, with a hole in the middle. But when i think about it, i dont think that this is how it's supposed to work. You would rather have to start chewing off a big placeholder from the start to the end. Please test again now.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4822#note_59565