News for hackers. Stuff that matters.

cmovq

Always thought it was strange that fptan also pushes 1 to the register stack. It now makes sense it’s so existing code for the 8087 which was expected to do y/x to get the actual tangent could keep working by doing y/1 on newer processors.
Re:Reversing Factorio's RNG on Friday September 18, 2026 @12:35AM (#49750236)
My point is that the straight-line non-templated function presented later in the article is significantly more readable, it’s like 8 lines of code with a few shifts and xors.
Re:Reversing Factorio's RNG on Wednesday September 16, 2026 @09:43PM (#49735445)
One of the reasons I dislike boost is in the first code sample. What’s the point of implementing what boils down to a 10 line function (as shown in the decompiled output) like this

    typedef xor_combine_engine<
  xor_combine_engine<
    linear_feedback_shift_engine<uint32_t, 32, 31, 13, 12>, 0,
    linear_feedback_shift_engine<uint32_t, 32, 29, 2, 4>, 0>, 0,
  linear_feedback_shift_engine<uint32_t, 32, 28, 3, 17>, 0> taus88;
Re:Base84 deserves a place in file names on Sunday September 13, 2026 @01:22PM (#49686275)
> Base84 distinguishes uppercase and lowercase letters, so different encoded names can compare equal on a case-insensitive filesystem.

I understand for the authors particular application the probability of collision is small, but this makes this encoding completely impractical for filenames generally.

Re:Recovering Corrupt Zip Files on Saturday August 29, 2026 @08:43PM (#49494620)
> Perhaps surprisingly, the ZIP file puts the central directory - which lists the content of the ZIP file - at the end of the file

This is very common for archive files. It lets you easily append a file to the end of the archive (overwriting the directory) followed by the updated directory. If it were at the start, you’d have to rewrite the entire contents of the archive to grow the directory.

Re:Tail-call optimization in C is relatively recent on Monday August 10, 2026 @01:47PM (#49247160)
Note that compilers are more than happy to delete 'while (true)' if the loop doesn't have side-effects.
64 bit cpus have 128 bit mul results if that’s what you mean
Re:Log is non-monotonic in PHP and Lua on Wednesday July 29, 2026 @03:19AM (#49094360)
> The PlayStation 1 didn't have jiggly vertices and warpy textures because of fixed-point

Indeed modern GPUs still use fixed-point rasterizers.

Re:Building a Tiny 3D Renderer for a Tiny Handheld on Saturday July 25, 2026 @03:44PM (#49050851)
+1 for TrenchBroom, it’s amazing software.
Re:CarPlay Is Additive on Friday July 03, 2026 @03:01AM (#48771787)
I wish everyone would just have an option to see the navigation the the gauge cluster.
Re:Free the Icons on Tuesday June 30, 2026 @03:21AM (#48729513)
I understand this logic, but at some point it makes sense to design the system for the millions of people on macs rather than make compromises for the sake of dozens of Vision Pro users.
Is there a technical reason why apple doesn’t allow HDR to be selectively turned off? I’m surprised this is still not at least an accessibility option.
Re:Zigzag Decoding with AVX-512 on Sunday June 21, 2026 @04:04AM (#48616709)
Compilers can’t really, in a meaningful way, change the layout of your data in memory. And you do need to think about your memory layout to get any benefit from SIMD. You’ll notice a lot of compiler auto vectorization insert many instructions just to shuffle data around to get to a usable layout, which negates much of the benefit.
Re:I Hate (Most) Keyboard 'Fn' Keys on Wednesday June 10, 2026 @11:50AM (#48478202)
Lenovo is the “weird exception” because thinkpads have always had the Fn key on the bottom left. Just like they still keep the track point.

I would presume most people buying a thinkpad don’t want to buy “the vast majority” of laptops.

Re:WSL 2 is getting faster Windows file system access on Thursday June 04, 2026 @09:49PM (#48407025)
I had no idea they used the Plan 9 file server for accessing files in WSL. I wonder what the original reasoning for choosing 9P was.
That and a reset button.
For GeForce cards you can get similar behavior by setting “Prefer maximum performance” which disables some of the low power states.
Re:C constructs that still don't work in C++ on Monday May 25, 2026 @03:33AM (#48264369)
Designated initializers is one area where C feels much more expressive than C++. And that feature has been standard since C99.
The Coca Cola company still makes advertisements, even though everyone already knows about Coke. You have to keep your name in the top of your target audience’s mind.
Re:Taking on CUDA with ROCm: 'One Step After Another' on Sunday April 12, 2026 @09:44PM (#47746588)
Vulkan is a pain for different reasons. Easier to install sure, but you need a few hundred lines of code to set up shader compilation and resources, and you’ll need extensions to deal with GPU addresses like you can with CUDA.
Re:Doom, Played over Curl on Sunday April 12, 2026 @12:40PM (#47741715)
Except it’s actually called “cooked mode” [1] and predates the use of the slang.

[1]: https://en.wikipedia.org/wiki/Terminal_mode https://www.linusakesson.net/programming/tty/

Software wants to be installed in C:\Program Files so that other software can’t modify their installation without admin permissions. Of course to do that your installer needs to be run as administrator which makes the whole thing rather silly.
Re:Age Verification on Systemd and Flatpak on Saturday April 04, 2026 @02:20AM (#47636377)
> The OS then provides a native API to return a user's age bracket (not full date-of-birth)

Call the API every day, when the age bracket changes you can infer the date-of-birth.

Re:Gzip decompression in 250 lines of Rust on Friday March 27, 2026 @04:40PM (#47547966)
Even the function names are identical :/
Re:Intel Announces Arc Pro B70 and Arc Pro B65 GPUs on Thursday March 26, 2026 @02:43PM (#47534135)
I mean it kind of is considering that's comparable to a 5070 which has 672 GB/s? Benefit of NVIDIA being the only one using GDDR7 for now I guess.
Re:Too Much Color on Friday March 20, 2026 @05:21PM (#47460744)
I've always assumed minifiers were a kind of lossless compression. I guess this optimization makes it lossy? Even if we can't tell the difference between oklch(0.659432 0.304219 234.75238) and oklch(.659 .304 234.752) they're still different colors.
Re:Java is fast, code might not be on Friday March 20, 2026 @11:56AM (#47456436)
When you're using a programming language that naturally steers you to write slow code you can't only blame the programmer.

I was listening to someone say they write fast code in Java by avoiding allocations with a PoolAllocator that would "cache" small objects with poolAllocator.alloc(), poolAllocator.release(). So just manual memory management with extra steps. At that point why not use a better language for the task?

Re:Rob Pike's 5 Rules of Programming on Thursday March 19, 2026 @02:42AM (#47435744)
This comment assumes game companies throw away all their code and start from scratch on their next title. Which is completely untrue, games are built on decades old code, like most software. There is absolutely a need for maintainable code.
Re:NaN Is Weird on Thursday March 12, 2026 @04:35PM (#47356696)
> we had an unusual discussion about a Python oddity

There are so many discussions about "X language is so weird about it handles numbers!" and it's just IEEE 754 floats.

Re:Avoiding Trigonometry (2013) on Thursday March 12, 2026 @12:00PM (#47352775)
For a graphics programmer acos(dot(x, y)) always raises an eyebrow. Since most of the time you actually want cos(theta) and even when you think you need the angle you probably don’t.

Older »