[llvm] [WIP][DAG] Add legalization handling for AVGCEIL/AVGFLOOR nodes (PR #92096)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 07:46:00 PDT 2024
================
@@ -39,8 +39,10 @@ define <8 x i8> @vaaddu_vv_v8i8_floor_sexti16(<8 x i8> %x, <8 x i8> %y) {
; CHECK-LABEL: vaaddu_vv_v8i8_floor_sexti16:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
-; CHECK-NEXT: vwadd.vv v10, v8, v9
-; CHECK-NEXT: vnsrl.wi v8, v10, 1
+; CHECK-NEXT: vand.vv v10, v8, v9
+; CHECK-NEXT: vxor.vv v8, v8, v9
+; CHECK-NEXT: vsra.vi v8, v8, 1
+; CHECK-NEXT: vadd.vv v8, v10, v8
----------------
RKSimon wrote:
@topperc Would it be acceptable to just add avgfloors/avgflooru custom lowering to riscv? I'm not sure how better we can make use the vwadd widening add instruction.
https://github.com/llvm/llvm-project/pull/92096
More information about the llvm-commits
mailing list