Using Clang to compile some PS3 headers, I ran into a problem with some inline assembly for some instrinsics macros with an unrecognized “Z” constraint. Looking at the gcc sources, I see there are several other constraints not currently supported. The enclosed macro lets them get through the parser, but at present I have no idea how to actually implement them, so before I look into it more, I thought I’d ask. Can someone help me out?
This from the gcc sources:
(define_memory_constraint “Z”
“Memory operand that is an indexed or indirect from a register (it is
usually better to use @samp{m} or @samp{es} in @code{asm} statements)”
(match_operand 0 “indexed_or_indirect_operand”))
Is it okay to check in the patch as an intermediate step?
-John
Z_constraint.patch (1.82 KB)
it Z a target independent or target-specific constraint? You have some unrelated changes in your diff.
-Chris
Oh, sorry, I forgot to hit the save button in the editor. It’s just one file:
Index: lib/Basic/TargetInfo.cpp
Oh, sorry, I forgot to hit the save button in the editor. It’s just one file:
This isn’t the right patch. These constraints are all target specific, so it’ll have to be sunk into a (probably new) hook in the PowerPC TargetInfo impl. There is documentation of this stuff here:
http://gcc.gnu.org/onlinedocs/gcc/Simple-Constraints.html#Simple-Constraints
http://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints
FWIW, Z is apparently "Memory operand that is an indexed or indirect from a register (it is usually better to use ' or
’ in asm
statements) "
-Chris