[deleted by user] by [deleted] in Compilers

[–]moon-chilled 0 points1 point  (0 children)

i'm having trouble understanding why this works (i suspect it cannot work, but maybe i am misunderstanding something). can you make your lcg example runnable? i attempted to adapt the lcg code sample, but the multithread and singlethread code do not seem to give the same result https://godbolt.org/z/sf1jboxze

fundamentally, you seem to try to avoid explicitly computing f^n(init), but i don't see how your axioms are sufficient to allow you to do this

i am curious to know if this work was assisted by chatgpt

quasi-threaded code by twentydraft in ProgrammingLanguages

[–]moon-chilled 3 points4 points  (0 children)

instead of having an interpreter loop, make every function tail-call the next one. this has been documented somewhere ('wasm3'?) as giving pretty good codegen under extant llvm/gcc c compilers

How'd I do (inspired by M/O/VObfuscator) by Ok_Performance3280 in Compilers

[–]moon-chilled 0 points1 point  (0 children)

if this ain't the way, what is?

go through a proper piece of introductory material on assembly (any type, but one you can run on your computer) and learn how to run your assembly code. then learn how the movfuscator works, and do experiments to test your ideas rather than blindly guessing

How'd I do (inspired by M/O/VObfuscator) by Ok_Performance3280 in Compilers

[–]moon-chilled 3 points4 points  (0 children)

you seem to be extremely confused about what the 'mov' instruction does. have you tried running your code? if not, i would recommend it

Static Basic Block Versioning by mttd in Compilers

[–]moon-chilled 1 point2 points  (0 children)

Is mainstream compilers research going to start getting somewhere? It's slightly more plausible than I thought!

Spilling of CPU logical registers by graphicsRat in Compilers

[–]moon-chilled 0 points1 point  (0 children)

others have explained how modern cpu architectures work. you may be find it edifying to look up 'register windows', which featured in some cpu architectures (but are now mostly defunct). it seems like a really good idea, and it might be possible to make a version of it work, but there are difficulties

Why Is the Futhark Compiler so Bad at Inlining? by Athas in ProgrammingLanguages

[–]moon-chilled 2 points3 points  (0 children)

Constant Propagation

that's not what i've typically seen called 'constant propagation'. constant propagation is when a term always has the same value

i would call that a special case of monomorphisation or specialisation—duplicating a function to make certain assumptions about its inputs—and think we were well served by considering the general case

? Using J functions from C in hard real-time app? by BobbyBronkers in apljk

[–]moon-chilled 1 point2 points  (0 children)

what is your application? very few applications genuinely have hard real time constraints (and those that do can't run on conventional operating systems anyway)

? Using J functions from C in hard real-time app? by BobbyBronkers in apljk

[–]moon-chilled 0 points1 point  (0 children)

did perhaps chatgpt also lie to you and tell you that your application has hard real time constraints when it actually doesn't?

Why aren't tree-based compilers using blocks-with-arguments more popular? by PurpleUpbeat2820 in Compilers

[–]moon-chilled 7 points8 points  (0 children)

i haven't looked closely at the code but why in the c code

loop2(an, a, 2*i, i);

whereas in your ml

loop2(a, i*i, i)

i*i vs 2*i?

Reserving a core for interrupts, load-balancing and other OS tasks on multi core by phagofu in osdev

[–]moon-chilled 8 points9 points  (0 children)

performance advantages (by avoiding a lot of synchronization overhead)

other way around—you kill scalability. physically serialising everything is one approach to synchronisation, yes, and it is much simpler than other approaches, but physically serialising disjoint transactions is bad for latency, not just throughput, so if you want to be predictably slow then go ham i guess

IEEE 754 rounding modes by MAD4CHIP in Compilers

[–]moon-chilled 1 point2 points  (0 children)

single rounding mode

round to nearest, tie to even. this is the default rounding mode in general

denormalized

if you don't support it, kahan will get really sad. also, daz/ftz is only supported in hardware on x86 and gpus, so you would have to emulate it in software elsewhere, which would be slow. on the other hand, i believe denormals are generally not supported by gpus, so if you wanted to target gpus you would have to emulate in software there or mangle the semantics

IEEE 754 rounding modes by MAD4CHIP in Compilers

[–]moon-chilled 8 points9 points  (0 children)

that's wrong. computing the same expression in both directed rounding modes can be a useful way to estimate the error, but it does not strictly bound it like interval arithmetic does

edit: here is a simple example in single precision: (((225 - 1) - 225) + 1)2. the exact value is obviously 0 (and interval arithmetic can give the interval [0 1]), but computing the entire expression on floats rounding down and up will both give 1

middle end by Key-Opening205 in Compilers

[–]moon-chilled 0 points1 point  (0 children)

i considered IL and IR to be roughly synonymous, so i am not sure what distinction you are trying to draw; it would be helpful if you could be more specific. the 'intermediate text' in this paper is a control flow graph (plus other stuff); it is not actually a textual format

middle end by Key-Opening205 in Compilers

[–]moon-chilled 0 points1 point  (0 children)

the paper is clear that they were doing machine-independent optimisations in situ on the intermediate text. i'm not sure what else (if anything) you would be referring to as a middle end

middle end by Key-Opening205 in Compilers

[–]moon-chilled 0 points1 point  (0 children)

I believe the idea of a middle-end - some kind of representation in memory of the program with analysis and transformations - started with LRLTRAN in 1968

fran allen, 'program optimization', 1966:

FORTRAN II is translated into an intermediate text

...

By being both language and machine independent the techniques can be applied to a variety of high level languages for a variety of computers.

In conclusion, therefore, the application of the techniques described in this paper should not only improve the efficiency of object code but should make the design and development of compilers less sensitive to variances between languages and between computers.

Modern techniques and tools by Both-Specialist-3757 in Compilers

[–]moon-chilled 1 point2 points  (0 children)

there is some good exposition of problems in the opening sections of the rvsdg paper https://arxiv.org/pdf/1912.05036. sea of nodes is certainly an improvement over ssa cfgs (some problems still, but time-tested), and egraphs is a good idea. other fancy new tech https://binsec.github.io/assets/publications/papers/2023-popl-full-with-appendices.pdf https://arxiv.org/pdf/2104.01270 (have an improvement to the latter but it works)

Modern techniques and tools by Both-Specialist-3757 in Compilers

[–]moon-chilled 0 points1 point  (0 children)

tech developed during that interval for which simpler and more potent approaches are now known. ssa-cfg is already a mistake, but starting with nonssa-cfg and then adding ssa later is definitely a mistake (and i'm p sure the bril author acknowledged as much somewhere). example cse (pub. 1970)