Re:New inline assembly syntax available in Rust nightly
by cesarb on Tuesday June 09, 2020 @12:42PM
(#23468184)
New registers are added all the time (for instance, the %zmm registers), so even if a symbol name doesn't conflict now, it might conflict in the future. Having separate namespaces for symbols and registers is a good idea.
Re:New inline assembly syntax available in Rust nightly
by renox on Tuesday June 09, 2020 @10:52PM
(#23473411)
Good point, but I wonder if it shouldn't be the labels which should be prefixed instead of the registers?
Re:New inline assembly syntax available in Rust nightly
by burfog on Wednesday June 10, 2020 @01:43AM
(#23474322)
Yes, ideally the labels would be strings in the style of C source code. That includes using \0 to put NUL bytes in the middle. It also includes wide character strings.
This allows for unusual languages like LISP and FORTH, without mangling the symbols. Symbols could have commas and spaces.
In practice, though, naming a symbol with a register name is error-prone and confusing. I'd rather have a way to escape a symbol when it's really needed than to pay the price of noise for an admittedly bad idea.