[PATCH] D92156: [PowerPC] Add support for "tlbiel" with two arguments

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 15:17:14 PST 2020


nickdesaulniers added a comment.

If `tlbiel %r4` is equivalent encoding wise to `tlbiel %r4, 0`, then we could work around this limitation in Clang's integrated assembler via kernel patch:

  diff --git a/arch/powerpc/mm/book3s64/hash_native.c b/arch/powerpc/mm/book3s64/hash_native.c
  index 52e170bd95ae..3e902dc91582 100644
  --- a/arch/powerpc/mm/book3s64/hash_native.c
  +++ b/arch/powerpc/mm/book3s64/hash_native.c
  @@ -267,7 +267,7 @@ static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize)
                  va |= ssize << 8;
                  sllp = get_sllp_encoding(apsize);
                  va |= sllp << 5;
  -               asm volatile(ASM_FTR_IFSET("tlbiel %0", "tlbiel %0,0", %1)
  +               asm volatile(ASM_FTR_IFSET("tlbiel %0", "tlbiel %0", %1)
                               : : "r" (va), "i" (CPU_FTR_ARCH_206)
                               : "memory");
                  break;

which looks like a mistake in the kernel to not use the same number of operands for either case (though they should encode the same); but I'd much rather improve LLVM if possible.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92156/new/

https://reviews.llvm.org/D92156



More information about the llvm-commits mailing list