https://gcc.gnu.org/g:80c09542738707f285d8654af8a418653434bfe1

commit 80c09542738707f285d8654af8a418653434bfe1
Author: Kishan Parmar <[email protected]>
Date:   Mon Jul 6 19:21:28 2026 +0530

    rs6000: Add Dense Math register predicates
    
    Add a new predicate, dmr_register_operand, to recognize Dense Math
    register operands. Also update gpc_reg_operand to accept Dense Math
    registers when Dense Math support is enabled.

Diff:
---
 gcc/config/rs6000/predicates.md | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index 63588ff99613..8dd10262534d 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -163,6 +163,22 @@
   return VINT_REGNO_P (REGNO (op));
 })
 
+;; Return 1 if op is a dense math register
+(define_predicate "dmr_register_operand"
+  (match_operand 0 "register_operand")
+{
+  if (!TARGET_DMF)
+    return 0;
+
+  if (!REG_P (op))
+    return 0;
+
+  if (!HARD_REGISTER_P (op))
+    return 1;
+
+  return DMR_REGNO_P (REGNO (op));
+})
+
 ;; Return 1 if op is an accumulator.  On power10/11 systems, the accumulators
 ;; overlap with the FPRs. On future systems, it will be a separate set of
 ;; registers.
@@ -388,6 +404,9 @@
   if (TARGET_VSX && VSX_REGNO_P (REGNO (op)))
     return 1;
 
+  if (TARGET_DMF && DMR_REGNO_P (REGNO (op)))
+    return 1;
+
   return INT_REGNO_P (REGNO (op)) || FP_REGNO_P (REGNO (op));
 })

Reply via email to