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

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 14:21:25 PST 2020


nickdesaulniers added a comment.

In D92156#2459057 <https://reviews.llvm.org/D92156#2459057>, @jsji wrote:

>> Perhaps GNU assembler has a pseudo-instruction for this? If it's not used significantly throughout the Linux kernel, maybe we should change the kernel to use the canonical form of the instruction?
>
> I did some research and chatted with GNU assembler developers. I think the situation is:
> Old ISA used to define 2 operands tlbiel, but we changed the format in ISA 3.0 (Power 9) and later , introducing the 5 operands basic form and its one operand extended mnemonic.
>
> So gas supports the 5 operands basic forms only with -mpower9 and up. The 2 operands mnemonic in gas is actually an extended mnemonic with other 3 operands default to 0.
>
> We are working with ISA guys to confirm whether we can support the 2 operands extended mnemonic.
>
> So my recommendation is we should implement according to ISA 3.1 first for now, we can add the two operands InstAlias later if confirmed by ISA .
>
> Regarding to usage in kernel, I think it depends on which arch are you building for, if it's with -mcpu=pwr9 and above, yes, I would recommend we update the code to use 5 operands basic form.

Hmm...looks like GNU as rejects the 5 operand `tlbie` unless `-mpower9` is passed.  I can see cc1 being invoked with `"-target-cpu" "pwr8"`. Manually changing that to `"-target-cpu" "pwr9"` invokes GAS correctly. Is there an `-mcpu=` value we should be setting with Clang to get cc1 to be invoked with `pwr9` rather than `pwr8`?  For `CONFIG_PPC_BOOK3S_64`, the kernel explicitly builds with `-mcpu=power8 -mtune=power9`, so I don't think we can change the Linux kernel to use the 5 operand encoding of `tlbie`, since it must support `-mcpu=power8` and GNU `as`.

In that case, I think we should proceed with enabling support for 2 operand `tlbie` in LLVM in order to properly support `-mcpu=power8`.


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