374 karma · joined Jun 12, 2022 (4y ago) · 76 submissions
comment 2mo ago · link · parent
https://learn.microsoft.com/en-us/cpp/build/reference/stack-...
comment 2mo ago · link · parent
> We are running different workloads including rustc perf suite. In general the runtime performance is on par with llvm.
Not what I would've expected!
comment 3mo ago · link · parent
> has 2-3 wide multiplications compared to 1 for newer methods.
As written, the `shortFloat()` function always calls `uscale()` two times, followed by an optional third call. Each `uscale()` does two wide multiplications (one full 64x64->128 and one 64x64->hi64, in case we want to make that distinction), so that works out to either 4 or 6 wide multiplications in total. I think `shortFloat()` could be rewritten to always do exactly 2 wide multiplications (both 64x64->128) at the cost of some more ALU operations. However, I don't see how that could be further reduced to only one wide multiplication.
EDIT: Going back to look at Zmij's to_decimal, I just realized that it also doesn't do just one wide multiplication in the sense I originally meant, so what you're saying is likely correct in the first place. I overzealously used a different definition of "wide multiplication", which I probably should've realized, given the fact that my numbers are exactly double yours, but alas. My apologies.
comment 3mo ago · link · parent
Zmij and xjb are in a league of their own. Broadly speaking, dtoa first has to find the shortest decimal representation of the floating-point input, and then format that decimal representation into a string. Zmij and xjb pull far ahead of the others mostly by speeding up the second part of that process.
uscale is quite good without the stringification, as are many other algorithms. I would say uscale's main strength isn't its speed, but rather its simplicity and, more importantly, the fact that it does both formatting and parsing using a single ~11 KiB table, which no other state-of-the-art algorithm offers (although yy comes close).
comment 3mo ago · link · parent
https://github.com/golang/go/blob/go1.27.0/src/internal/strc...
comment 3mo ago · link · parent
Make of that what you will.
comment 4mo ago · link · parent
comment 4mo ago · link · parent
comment 5mo ago · link · parent
That being said, the parent commenter is actually referring to other recent proposals as opposed to existing `@Vector` functionality:
comment 1y ago · link · parent
- https://www.mdsec.co.uk/2022/04/resolving-system-service-num...
- https://klezvirus.github.io/RedTeaming/AV_Evasion/NoSysWhisp...
- https://whiteknightlabs.com/2024/07/31/layeredsyscall-abusin...
Though I'm not sure which of these techniques, if any, would be most favored by a game DRM as I've never looked into it.
comment 1y ago · link · parent
[1] https://learn.microsoft.com/en-us/windows/win32/api/dcommon/...
[2] https://learn.microsoft.com/en-us/windows/win32/api/dwrite/n...
comment 1y ago · link · parent
[1] https://github.com/Microsoft/DirectXTK/wiki/throwIfFailed
comment 2y ago · link · parent
On x86, yes. There is no performance penalty for misaligned loads, except when the misaligned load also happens to straddle a cache line boundary, in which case it is slower, but only marginally so.
comment 2y ago · link · parent
Also, you can link against ntdll.lib directly. Manually calling GetProcAddress for a few functions isn't a tragedy by any means, but in this case, why bother?
Great article nonetheless!
comment 2y ago · link · parent