[llvm] 54e8cfe - [RISCV] Simplify some predicate functions in RISCVSubtarget.h. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 30 12:41:55 PDT 2023


Author: Craig Topper
Date: 2023-07-30T12:37:50-07:00
New Revision: 54e8cfe6d6d8add38056bf7e294c75f0d9ff3986

URL: https://github.com/llvm/llvm-project/commit/54e8cfe6d6d8add38056bf7e294c75f0d9ff3986
DIFF: https://github.com/llvm/llvm-project/commit/54e8cfe6d6d8add38056bf7e294c75f0d9ff3986.diff

LOG: [RISCV] Simplify some predicate functions in RISCVSubtarget.h. NFC

Remove some redundancy.

HasStdExtZve32f implies HasStdExtF
HasStdExtZve64d implies HasStdExtD
HasStdExtZvfbfwma implies HasStdExtZvfbfmin

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVSubtarget.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVSubtarget.h b/llvm/lib/Target/RISCV/RISCVSubtarget.h
index 8ec87f6cfc8e6b..599d60a28019b5 100644
--- a/llvm/lib/Target/RISCV/RISCVSubtarget.h
+++ b/llvm/lib/Target/RISCV/RISCVSubtarget.h
@@ -124,7 +124,7 @@ class RISCVSubtarget : public RISCVGenSubtargetInfo {
     return hasStdExtZfhOrZfhmin() || hasStdExtZhinxOrZhinxmin();
   }
   bool hasHalfFPLoadStoreMove() const {
-    return HasStdExtZfh || HasStdExtZfhmin || HasStdExtZfbfmin;
+    return hasStdExtZfhOrZfhmin() || HasStdExtZfbfmin;
   }
   bool is64Bit() const { return IsRV64; }
   MVT getXLenVT() const { return XLenVT; }
@@ -167,13 +167,9 @@ class RISCVSubtarget : public RISCVGenSubtargetInfo {
   bool hasVInstructions() const { return HasStdExtZve32x; }
   bool hasVInstructionsI64() const { return HasStdExtZve64x; }
   bool hasVInstructionsF16() const { return HasStdExtZvfh; }
-  bool hasVInstructionsBF16() const { 
-    return HasStdExtZvfbfmin || HasStdExtZvfbfwma; 
-  }
-  // FIXME: Consider Zfinx in the future
-  bool hasVInstructionsF32() const { return HasStdExtZve32f && HasStdExtF; }
-  // FIXME: Consider Zdinx in the future
-  bool hasVInstructionsF64() const { return HasStdExtZve64d && HasStdExtD; }
+  bool hasVInstructionsBF16() const { return HasStdExtZvfbfmin; }
+  bool hasVInstructionsF32() const { return HasStdExtZve32f; }
+  bool hasVInstructionsF64() const { return HasStdExtZve64d; }
   // F16 and F64 both require F32.
   bool hasVInstructionsAnyF() const { return hasVInstructionsF32(); }
   bool hasVInstructionsFullMultiply() const { return HasStdExtV; }


        


More information about the llvm-commits mailing list