[LLVMdev] Named register variables GNU-style

Krzysztof Parzyszek kparzysz at codeaurora.org
Thu Mar 27 12:35:40 PDT 2014


On 3/27/2014 8:55 AM, Renato Golin wrote:
>
> I just had a discussion about __builtin_stack_pointer in the GCC list,
> and there were a number of arguments against it, and it got me
> thinking I didn't have strong arguments against GNU's named register
> extension. Does anyone remember the arguments for not implementing
> that extension?

Is there any sane reason to actually implement it?

Are there any cases when inline asm would work well enough? We have the 
__builtin_stack_pointer now, which is somewhat questionable[1], however 
this should not serve a precedent to implement further "extensions" like 
this. Argument against it..? "Why?"

-Krzysztof


[1] As someone has pointed out, the stack pointer builtin only makes 
sense on targets that actually have a "stack pointer". Not all 
architectures do, and even on those that do, the register could be used 
for other purposes in some cases. I'm guessing that the main use 
scenarios come from OS kernels or device drivers, but even there inline 
asm would likely suffice.


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-dev mailing list