[clang] [RISCV][Clang] Reuse RVVOutBuiltinSet multiclass for builtin vfrsqrt7. NFC (PR #115269)

Jim Lin via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 6 22:01:36 PST 2024


https://github.com/tclin914 created https://github.com/llvm/llvm-project/pull/115269

None

>From d6a33142b94a6ad0ca747d330a4ac4b3f7a476af Mon Sep 17 00:00:00 2001
From: Jim Lin <jim at andestech.com>
Date: Thu, 7 Nov 2024 13:47:09 +0800
Subject: [PATCH] [RISCV][Clang] Reuse RVVOutBuiltinSet multiclass for builtin
 vfrsqrt7. NFC

---
 clang/include/clang/Basic/riscv_vector.td        | 2 +-
 clang/include/clang/Basic/riscv_vector_common.td | 8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/clang/include/clang/Basic/riscv_vector.td b/clang/include/clang/Basic/riscv_vector.td
index 1387494c4aeb00..74b9a7fc753a62 100644
--- a/clang/include/clang/Basic/riscv_vector.td
+++ b/clang/include/clang/Basic/riscv_vector.td
@@ -1859,7 +1859,7 @@ let ManualCodegen = [{
 }
 
 // 13.9. Vector Floating-Point Reciprocal Square-Root Estimate Instruction
-def vfrsqrt7 : RVVFloatingUnaryVVBuiltin;
+defm vfrsqrt7 : RVVOutBuiltinSet<"vfrsqrt7", "xfd", [["v", "v", "vv"]]>;
 
 // 13.11. Vector Floating-Point MIN/MAX Instructions
 defm vfmin : RVVFloatingBinBuiltinSet;
diff --git a/clang/include/clang/Basic/riscv_vector_common.td b/clang/include/clang/Basic/riscv_vector_common.td
index 33f6441217a5e1..b38ca7341361c4 100644
--- a/clang/include/clang/Basic/riscv_vector_common.td
+++ b/clang/include/clang/Basic/riscv_vector_common.td
@@ -576,14 +576,6 @@ let UnMaskedPolicyScheme = HasPassthruOperand,
   }
 }
 
-class RVVFloatingUnaryBuiltin<string builtin_suffix, string ir_suffix,
-                              string prototype>
-    : RVVOutBuiltin<ir_suffix, prototype, "xfd"> {
-  let Name = NAME # "_" # builtin_suffix;
-}
-
-class RVVFloatingUnaryVVBuiltin : RVVFloatingUnaryBuiltin<"v", "v", "vv">;
-
 class RVVConvBuiltin<string suffix, string prototype, string type_range,
                      string overloaded_name>
     : RVVBuiltin<suffix, prototype, type_range> {



More information about the cfe-commits mailing list