|
oh hey yospos whats goin on in this threadeschaton 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
|
# ¿ Jun 30, 2017 22:56 |
|
|
# ¿ May 11, 2024 14:48 |
|
Malcolm XML posted:CPS >> SSA 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
|
# ¿ Jul 1, 2017 01:18 |
|
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
|
# ¿ Jul 1, 2017 16:07 |
|
avoiding ub is easy, just follow these 204 simple rules https://blog.regehr.org/archives/1520
|
# ¿ Jul 8, 2017 02:48 |
|
pyf compiler bugs https://reviews.llvm.org/rL307092 quote:If the output file is a character file (e.g. /dev/null) unlinking it could thansk
|
# ¿ Jul 10, 2017 18:39 |
|
https://twitter.com/johnregehr/status/695271704982069248
|
# ¿ Jul 10, 2017 19:24 |
|
p sure that's already happened. timing sensitive code these days more or less has to be hand-rolled assembly language
|
# ¿ Jul 11, 2017 18:51 |
|
|
# ¿ May 11, 2024 14:48 |
|
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
|
# ¿ Aug 4, 2017 21:49 |