Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dzaima
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
50 ms
·
631.
▲
by
dzaima
3y ago
A couple weeks ago I managed to get a nice setup for viewing Java JIT disassembly[1], and did a bunch of ad-hoc tests on OpenJDK 21 (and some on whatever build of 23 was on openjdk.org). do manage to vectorize a decent amount of vectorizabl
632.
▲
by
dzaima
3y ago
What does preemption change here? Before the stack checker has finished, nothing else should hold a reference to any of the yet-unchecked stack. That's plenty trivial to ensure. (unless you mean preemption somehow breaking the stack ch
633.
▲
by
dzaima
3y ago
The language runtime can require that the OS & hardware always results in an exception on stack overflow (or, alternatively, compile in explicit checks for it). You running the program in an environment without that is, technically, jus
634.
▲
by
dzaima
3y ago
hmm, maybe you're right. Looking back at the "-Os -march=rv64gc_zba" output, it does the strength reduction, even though the applicability of sh2add is the same regardless of strength reduction or not. A thing that might fit
635.
▲
by
dzaima
3y ago
I will agree it's slightly weird. But it seems to me it's less that it "fails", more that there's heuristics at play other than "speed up loop". Perhaps on other loops it's more reasonable and makes a
636.
▲
by
dzaima
3y ago
I haven't bothered to use -Os much (outside of places where performance decidedly does not matter); it seems fairly clear to me that code with like any amount of hot spots (i.e. most code) would greatly suffer. I wonder how different w
637.
▲
by
dzaima
3y ago
Your custom 24-byte version is just two bytes smaller than the "size_t n" gcc -Os version, probably within a rounding error of what compiler developers care to achieve.
638.
▲
by
dzaima
3y ago
Seems it doesn't like -S being present (and it makes sense as you don't want assembly, you want a disassembled object file). In general there's no need for -S in compiler explorer.
639.
▲
by
dzaima
3y ago
Output → Compile to binary object. Appears I was testing on a version with the int counter replaced with size_t (namely, https://godbolt.org/z/sTW64EEYv vs https://godbolt.org/z/zKqjTa5fz ). Regard
640.
▲
by
dzaima
3y ago
gcc does give the 4-instr loop on all of -O1, -O2, and -O3 for the basic loop. And, to its credit, the worse loop on -Os does result in the function being 2 bytes smaller (if I'm reading it right), which is what you ask for with -Os. A
641.
▲
by
dzaima
3y ago
Some attempts to come up with a case where gcc or clang optimize in a way not easily describable as a specific "do_anything()": - printf (or any other external call) before UB - both gcc & clang keep the printf. - write to ato
642.
▲
by
dzaima
3y ago
What happened up to "do_anything()" cannot matter - if you don't like interpreting it as actual time travel, you could alternatively interpret it as the UB rearranging the atoms of the universe to look like some different pas
643.
▲
by
dzaima
3y ago
You can absolutely write formal models with the presence of UB - encountering UB is just a call to do_anything(), and the scenarios in which UB happens is itself well-defined. Determining whether any UB can happen is as "undecidable&qu
644.
▲
by
dzaima
3y ago
But what does it get you that it's a "defined but completely unusable value" versus "undefined"? Indexing an array by it, adding it to some previously-meaningful value, or doing anything else with it, is still gonna
645.
▲
by
dzaima
3y ago
It's optimized out on both gcc and clang on -O1 and above. -O3 is presumably just what the author defaults to for enabling optimizations (I also write -O3 everywhere by default).
646.
▲
by
dzaima
3y ago
How about if the x+1 was from an inlined function? a macro? perhaps even just a variable defined 10 lines up? In a 7-character sequence it may seem pretty obvious that it's probably intended to mean something, but when joining together
647.
▲
by
dzaima
3y ago
UB is far from the only source of systems not doing the desired thing - writing code that ends up at UB is as wrong as writing code that was written with an incorrect understanding of the invoked behavior. Sure, the neat trick of a+1<a n
648.
▲
by
dzaima
3y ago
There's a very simple solver that completes that goal: one that reports that it cannot prove any code as correct. So there must be a secondary goal of "maximize the amount of accepted code", which is a significantly less triv
649.
▲
by
dzaima
3y ago
C11: A pointer to void shall have the same representation and alignment requirements as a pointer to a character type. [48] <blah blah pointers to qualified vs unqualified, structs, and unions also have the same representation
650.
▲
by
dzaima
3y ago
"long" is always a modifier, just potentially applied twice, and potentially to nothing. A more written out version of "long long" is "long long int", and similarly "long" is really "long int&quo
651.
▲
by
dzaima
3y ago
Point being, _kst_'s comment of "I don't know of any compilers that provide them" is correct - there are few if any compilers that actually have actual extended integer types, and thus introducing such in compilers might
652.
▲
by
dzaima
3y ago
Extended integer types are decidedly not just aliases to other types - the C standard has separate "standard integer types" which are the regular char/short/int/long/long long, and "extended integer type
653.
▲
by
dzaima
3y ago
Extended integer types aren't necessarily related to stdint.h - in the vast majority if not every one of those "half-decent compilers" the stdint.h types are just typedefs over plain old char/short/int/long
654.
▲
by
dzaima
3y ago
If one knows about Matrix/Element, it'll of course be from hearing/reading about it somewhere. And thus if they were just told "discussion is at #foo:example.org on Element" or whatever they'll clearly go for E
655.
▲
by
dzaima
3y ago
x86 at least has it being more CISCy on its side, with a read/write potentially being inlined into another instruction (perhaps that's the only significant thing but it's still relatively meaningful). I'm sure intel &
656.
▲
by
dzaima
3y ago
Much as I don't like the track Wayland appears to want to take and plan to stay on X11 for a while, X11 is horrible and bloated and junk. It just appears to work because developers of apps/toolkits have had no choice but to pour i
657.
▲
by
dzaima
3y ago
Of note is that starting a marketplace takes a stand-by letter of credit of €1,000,000 [0], so no getting around the core technology free by just starting a bunch of marketplaces. [0]: https://developer.apple.com/support
658.
▲
by
dzaima
3y ago
Might not be "worse" (I'd definitely agree that the difference is plenty small enough to be considered equal within error bounds), but is certainly not something worthy of RISC-V being noted as doing "great" either.
659.
▲
by
dzaima
3y ago
Smaller-than-'int' types get implicitly promoted to 'int' before arithmetic. Results are indeed very funky.
660.
▲
by
dzaima
3y ago
Here's a mini-quiz: on a regular gcc/clang for x86/x86-64/arm32/arm64, which of the following functions can ever produce undefined behavior? Answers can be obtained by compiling with "-O3 -fsanitize=undefined&q
More ›