Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
what is best in optimizer pipeline
value numbering
code motion
peepholing
loop idiom recognition
legalization
thread gassing
op banning
View Results
 
  • Locked thread
TOPS-420
Feb 13, 2012

oh hey yospos whats goin on in this thread

eschaton posted:

is it PowerPC Mach-O, which is gratuitously different than the ABI defined as part of the architecture itself?

you forgot to link the classic bit of nerd rage on this topic

http://archive.li/rDmyF

some vintage cisc vs risc war bullshit there. really it should be "good isas with pc-relative addressing" vs "powerpc (a bad isa)". on a platform where 90% of calls are objc_msgSend or otherwise dynamically dispatched, keeping a toc pointer probably would have been a net loss in performance too vs using plain function pointers and eating the PIC cost for cross-library calls

Adbot
ADBOT LOVES YOU

TOPS-420
Feb 13, 2012


this seems like a p cool approach to get some of the benefits of both

http://compilers.cs.uni-saarland.de/papers/lkh15_cgo.pdf

it's cps but with the structure implied by the dataflow graph instead of scoping, so you can lower all your idiot higher order functions, coroutines, and tail recursion without concretizing a bunch of intermediate closure structures that will just get picked apart by obvious optimizations

TOPS-420
Feb 13, 2012

there’s a lot of old bad c code that assumes it’s still 1979 and arguments are always passed on the stack, so assumes void (*)(butts, ...) can be cast to void (*)(butts, farts) or K&R-style void (*)() and still be called. the c standard says calling a variadic function as not variadic or vice versa is undefined behavior, but most ABIs oblige and implement varargs in a way that works with the normal convention. a lot of bad code also assumes va_list is a flat array of bytes. this is why a lot of older risc-ish abis, rjmccall mentioned 32 bit ARM but also alpha, ppc, and even win64, pass arguments in registers but also reserve shadow space on the stack. that way va_start can spill all the argument registers into their shadow slots, and then va_list can “just” be a flat array. this of course wastes a ton of stack space

with x86-64 amd finally said “use va_arg you idiots” and standardized the abi to only pass args in registers without reserving shadow stack space. however they still maintained compatibility between variadic and normal calling conventions, so the va_list implementation is a nightmare. read https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf#page55 to be terrified

apple arm64 finally did the reasonable thing and said, hey, you can’t do this, it’s UB so the compiler will gently caress you over even if the runtime abi seems to work. so normal arguments get passed in registers and varargs get passed on the stack

TOPS-420
Feb 13, 2012

avoiding ub is easy, just follow these 204 simple rules

https://blog.regehr.org/archives/1520

TOPS-420
Feb 13, 2012

pyf compiler bugs

https://reviews.llvm.org/rL307092

quote:

If the output file is a character file (e.g. /dev/null) unlinking it could
potentially destabilize the user's system. For example,
unlinking causes lld %input -o /dev/null to replace /dev/null with a
regular file, which will lead to unexpected behavior in other programs
that read from /dev/null, and worse than expected peformance for
programs that write to /dev/null.

thansk systemdlld

TOPS-420
Feb 13, 2012

https://twitter.com/johnregehr/status/695271704982069248

TOPS-420
Feb 13, 2012

p sure that's already happened. timing sensitive code these days more or less has to be hand-rolled assembly language

Adbot
ADBOT LOVES YOU

TOPS-420
Feb 13, 2012

follow some simple rules in c (never use typedefs or prototypes, make all your functions return int) and youll never have to forward declare them

  • Locked thread