[llvm-bugs] [Bug 42762] unexpected codegen for inline asm
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Apr 6 05:07:36 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=42762
Nemanja Ivanovic <nemanja.i.ibm at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #5 from Nemanja Ivanovic <nemanja.i.ibm at gmail.com> ---
Proposed fix in https://reviews.llvm.org/D77542
Please note that this won't give you optimal codegen. Namely, we will always
use zero as the index and compute the address into the base register. However,
it will at least generate correct code.
We can revisit optimizing codegen in the future. In the meantime, you could
change something like:
void dcbz_w_offset(void* addr, int offset)
{
asm volatile ("dcbz %y0" :: "Z"(*(unsigned char*)(addr + offset)) :
"memory");
}
into:
void dcbz_w_offset(void* addr, int offset)
{
asm volatile ("dcbz %1, %0" :: "b"((unsigned char*)addr), "r"(offset) :
"memory");
}
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200406/780db60f/attachment-0001.html>
More information about the llvm-bugs
mailing list