News for hackers. Stuff that matters.
Re:New inline assembly syntax available in Rust nightly by pjmlp on Tuesday June 09, 2020 @11:18AM (#23467382)
GCC did not invent anything, that dumb approach to inline Assembly is traditional in UNIX environments.

Amiga and Atari also had similar inline Assembly support.

Re:New inline assembly syntax available in Rust nightly by newacct583 on Tuesday June 09, 2020 @11:52AM (#23467707)
I still think you're missing the point. GCC indeed didn't invent "inline assembly as a string", no.

GCC invented "constraint metalanguage as the foundation for inline assembly generation", which is the model here that enables one compiler and one syntax to work the same way for basically every architecture over decades. Modelling the interior of the assembly code as a black box (which in this implementation means "string") is just a side effect of this important design choice.

Again, the stuff you're imagining isn't a general purpose assembly language model, it's an x86-specific hack that works only on the specific compilers and architectures for which it was targeted.

Re:New inline assembly syntax available in Rust nightly by pjmlp on Tuesday June 09, 2020 @12:06PM (#23467827)
Except that compilers with inline Assembly also don't have dumb backends that just dump Assembly for as, like on UNIX.

They interact with the backend.

They weren't specific of x86, although I mentioned only PC, they were available across all 8 and 16 bit home computers and several embedded targets support it as well.

Re:New inline assembly syntax available in Rust nightly by not2b on Tuesday June 09, 2020 @02:25PM (#23469229)
GCC doesn't implement the "dumb approach" that existed before it, and that Amiga and Atari originally had. The GCC approach provides enough information to the compiler that code can be optimized in the presence of inline assembly; the compiler is informed of what the assembler code reads and writes, and can allocate registers for it. It was much more flexible than the implementation in the original Unix compiler.