[PATCH] D138888: [AArch64][SVE] Replace destructive operand of vector zeros with a bundled MOVPRFX instruction

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 23:15:17 PST 2023


Allen marked 2 inline comments as done.
Allen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/SVEInstrFormats.td:2798-2799
 
-multiclass sve2_fp_flogb<string asm, SDPatternOperator op> {
-  def _H : sve_fp_2op_p_zd<0b0011010, asm, ZPR16, ZPR16, ElementSizeH>;
-  def _S : sve_fp_2op_p_zd<0b0011100, asm, ZPR32, ZPR32, ElementSizeS>;
-  def _D : sve_fp_2op_p_zd<0b0011110, asm, ZPR64, ZPR64, ElementSizeD>;
+multiclass sve2_fp_flogb<string asm, string Ps, SDPatternOperator op, DestructiveInstTypeEnum flags> {
+  let DestructiveInstType = flags in {
+    def _H : sve_fp_2op_p_zd<0b0011010, asm, ZPR16, ZPR16, ElementSizeH>,
----------------
paulwalker-arm wrote:
> Are these changes required? `sve_fp_2op_p_zd` looks to already set `DestructiveInstType` accordingly.
Thanks, When I try all the modifications of **multiclass sve2_fp_flogb**, an **assert **error occurs when I execute test case sve2-intrinsics-fp-int-binary-logarithm-zeroing.ll. Of course, the condition **let DestructiveInstType = flags in** is unnecessary, I'll delete it.
```
#2  0x0000aaaaaceef5c8 in llvm::AArch64InstPrinter::printInstruction (this=0xaaaab2be5f70, MI=0xffffffffc1c8, Address=0, STI=..., O=...)
    at lib/Target/AArch64/AArch64GenAsmWriter.inc:16963
16963	  assert(Bits != 0 && "Cannot print this instruction.");
(gdb) l
16958	  auto MnemonicInfo = getMnemonic(MI);
16959	
16960	  O << MnemonicInfo.first;
16961	
16962	  uint64_t Bits = MnemonicInfo.second;
16963	  assert(Bits != 0 && "Cannot print this instruction.");                 ----------- here -----------------------
```


================
Comment at: llvm/test/CodeGen/AArch64/sve2-intrinsics-fp-int-binary-logarithm-zeroing.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2 -mattr=+use-experimental-zeroing-pseudos -asm-verbose=1 < %s | FileCheck %s
+
----------------
paulwalker-arm wrote:
> I believe this is the default and thus not required?
Done, thanks


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

https://reviews.llvm.org/D138888



More information about the llvm-commits mailing list