[LLVMdev] Inline Assembly: Memory constraints with offsets

Daniel Sanders Daniel.Sanders at imgtec.com
Tue Mar 3 04:01:48 PST 2015


Hi,

I'm trying to implement the ZC inline assembly constraint for Mips. This constraint is a memory constraint that expands to an address with an offset (the range of the offset varies according to the subtarget), so the inline assembly in:
  int data[10];
  void ZC(void) {
    asm volatile ("foo %0 %1" : : "ZC"(data[1]), "ZC"(data[2]));
  }
Should expand to something like:
  foo 4($2) 8($2)

At the moment, the best I can get is something like:
  foo 0($2) 0($3)
with the offsets being added before the inline assembly.

Does anyone have any suggestions as to how I can get the offset inside the inline assembly?

Thanks

Daniel Sanders
Leading Software Design Engineer, MIPS Processor IP
Imagination Technologies Limited
www.imgtec.com<http://www.imgtec.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150303/050ca238/attachment.html>


More information about the llvm-dev mailing list