[llvm] [WIP][DAG] Add legalization handling for AVGCEIL/AVGFLOOR nodes (PR #92096)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 14:00:39 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 @preames These are the last outstanding regressions in the draft patch before I start cleanup - do you have any suggestions on the preferred way that riscv should handle AVGFLOORS? AVGCEILS appears to be fine.

https://github.com/llvm/llvm-project/pull/92096


More information about the llvm-commits mailing list