[PATCH] D19061: [ARM] Add support for the X asm constraint

silviu.baranga@arm.com via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 15 11:09:27 PDT 2016


sbaranga added a comment.

In http://reviews.llvm.org/D19061#402662, @rengolin wrote:

> In http://reviews.llvm.org/D19061#402641, @jgreenhalgh wrote:
>
> > A Debian grep gets a few examples out from x86 mmx headers (and a couple for other architectures) https://codesearch.debian.net/results/%22%3DX%22/page_0
>
>
> Hey, I didn't know about this code search, nice!
>
> Silviu, it'd be good to get a few examples from that search result page and at least understand what's going on, and maybe prepare some better error messages than seg faults.


Yeah, I'm currently working through a list of additional use cases to see what works and why other things don't work.
Printing integer immediates and function addresses works.
For labels, we hit an issue where the label's basic block is not considered to have its address taken which can cause the basic block that's being pointed to by the label to be removed (at least in some cases), resulting in invalid output. I'll raise a PR for that.

> 

> 

> > I'm making no promises as to how correct those uses are (http://sources.debian.net/src/php7.0/7.0.5-3/Zend/zend_multiply.h/?hl=56#L56 looks pretty fragile!), but I don't know of any better sources for real world code. I was only guessing this would break somebody's use case (because it is so liberal at the moment), rather than having one in particular in mind.

> 

> 

> Crap. That example can go wrong in so many ways... The complete lack of type safety makes that macro a nightmare for compilers... sigh...

> 

> I think we can retain our current approach that, whatever makes sense, passes, and what doesn't breaks with an error message in the lines of "stupid user".


You'll at least get an assembler error, which is much nicer.

Cheers,
Silviu


http://reviews.llvm.org/D19061





More information about the llvm-commits mailing list