[PATCH] D26072: [PPC] add absolute difference altivec instructions and matching intrinsics

Ehsan Amiri via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 09:26:03 PDT 2016


amehsan added inline comments.


================
Comment at: lib/Target/PowerPC/PPCInstrAltivec.td:1410-1419
+// Absolute Difference
+def VABSDUB : VXForm_1<1027, (outs vrrc:$vD), (ins vrrc:$vA, vrrc:$vB),
+                      "vabsdub $vD, $vA, $vB", IIC_VecGeneral,
+                      [(set v16i8:$vD, (int_ppc_altivec_vabsdub v16i8:$vA, v16i8:$vB))]>;
+def VABSDUH : VXForm_1<1091, (outs vrrc:$vD), (ins vrrc:$vA, vrrc:$vB),
+                       "vabsduh $vD, $vA, $vB", IIC_VecGeneral,
+                       [(set v8i16:$vD, (int_ppc_altivec_vabsduh v8i16:$vA, v8i16:$vB))]>;
----------------
IIRC, when I was doing the patches that I sent you, there was a generic absolute value intrinsic, that I could use. That is better than the PPC intrinsics, because it is more likely that optimizations understand it. Could you use the generic one here?


================
Comment at: test/CodeGen/PowerPC/vec_absd.ll:1-2
+; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mtriple=powerpc64-unknown-linux-gnu -mattr=+altivec < %s | FileCheck %s
+; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu -mattr=+altivec < %s | FileCheck %s
+
----------------
you should not need -mattr=+altivec when you have -mcpu=pwr9. Does something go wrong when you remove that?


Repository:
  rL LLVM

https://reviews.llvm.org/D26072





More information about the llvm-commits mailing list