[llvm] [X86] X86TargetLowering::computeKnownBitsForTargetNode - add X86ISD::VPMADD52L\H handling - again (PR #159230)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 01:24:53 PDT 2025


================
@@ -0,0 +1,138 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx512ifma,+avx512vl | FileCheck %s --check-prefixes=AVX512VL
+
+
+
+; H path: take the high 52 bits of the product and add them to the accumulator
+; 25-bit = (1<<25)-1 = 33554431
+; 26-bit = (1<<26)-1 = 67108863
+
+declare <2 x i64> @llvm.x86.avx512.vpmadd52h.uq.128(<2 x i64>, <2 x i64>, <2 x i64>)
+declare <4 x i64> @llvm.x86.avx512.vpmadd52h.uq.256(<4 x i64>, <4 x i64>, <4 x i64>)
+declare <8 x i64> @llvm.x86.avx512.vpmadd52h.uq.512(<8 x i64>, <8 x i64>, <8 x i64>)
+
+define <2 x i64> @kb52h_128_mask25_and1(<2 x i64> %x, <2 x i64> %y) {
+; AVX512VL-LABEL: kb52h_128_mask25_and1:
+; AVX512VL:       # %bb.0:
+; AVX512VL-NEXT:    vmovddup {{.*#+}} xmm0 = [1,1]
+; AVX512VL-NEXT:    # xmm0 = mem[0,0]
+; AVX512VL-NEXT:    retq
+  %mx  = and <2 x i64> %x, <i64 33554431, i64 33554431>
+  %my  = and <2 x i64> %y, <i64 33554431, i64 33554431>
+  %r   = call <2 x i64> @llvm.x86.avx512.vpmadd52h.uq.128(
+             <2 x i64> <i64 1, i64 1>,           ; acc
+             <2 x i64> %mx,                      ; x (masked to 25-bit)
+             <2 x i64> %my)                      ; y (masked to 25-bit)
----------------
RKSimon wrote:

these per-operand comment really aren't necessary - a short single line comment above the define along witha descriptive function name is all that is necessary

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


More information about the llvm-commits mailing list