Skip to content

Commit

Permalink
[RISCV] Sync RISCVFeatures.td implies list with RISCVISAInfo.cpp.
Browse files Browse the repository at this point in the history
This makes Zcf imply F and Zcd imply D in RISCVFeatures.td. They
were already implied in RISCISAInfo.cpp.

Some test RUN lines had to be removed because they were testing
that Zcf without F or Zcd without D would reject some instructions.
  • Loading branch information
topperc committed Apr 24, 2024
1 parent 286bd42 commit 8350d9c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
9 changes: 4 additions & 5 deletions llvm/lib/Target/RISCV/RISCVFeatures.td
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def HasStdExtZcb : Predicate<"Subtarget->hasStdExtZcb()">,
def FeatureStdExtZcd
: RISCVExtension<"zcd", 1, 0,
"'Zcd' (Compressed Double-Precision Floating-Point Instructions)",
[FeatureStdExtZca]>;
[FeatureStdExtD, FeatureStdExtZca]>;

def HasStdExtCOrZcd
: Predicate<"Subtarget->hasStdExtCOrZcd()">,
Expand All @@ -402,7 +402,7 @@ def HasStdExtCOrZcd
def FeatureStdExtZcf
: RISCVExtension<"zcf", 1, 0,
"'Zcf' (Compressed Single-Precision Floating-Point Instructions)",
[FeatureStdExtZca]>;
[FeatureStdExtF, FeatureStdExtZca]>;

def FeatureStdExtZcmp
: RISCVExtension<"zcmp", 1, 0,
Expand All @@ -423,8 +423,7 @@ def HasStdExtZcmt : Predicate<"Subtarget->hasStdExtZcmt()">,
def FeatureStdExtZce
: RISCVExtension<"zce", 1, 0,
"'Zce' (Compressed extensions for microcontrollers)",
[FeatureStdExtZca, FeatureStdExtZcb, FeatureStdExtZcmp,
FeatureStdExtZcmt]>;
[FeatureStdExtZcb, FeatureStdExtZcmp, FeatureStdExtZcmt]>;

def HasStdExtCOrZcfOrZce
: Predicate<"Subtarget->hasStdExtC() || Subtarget->hasStdExtZcf() "
Expand Down Expand Up @@ -1088,7 +1087,7 @@ def HasVendorXSfvqmaccqoq
def FeatureVendorXSfvfwmaccqqq
: RISCVExtension<"xsfvfwmaccqqq", 1, 0,
"'XSfvfwmaccqqq' (SiFive Matrix Multiply Accumulate Instruction and 4-by-4))",
[FeatureStdExtZve32f, FeatureStdExtZvfbfmin]>;
[FeatureStdExtZvfbfmin]>;
def HasVendorXSfvfwmaccqqq
: Predicate<"Subtarget->hasVendorXSfvfwmaccqqq()">,
AssemblerPredicate<(all_of FeatureVendorXSfvfwmaccqqq),
Expand Down
3 changes: 0 additions & 3 deletions llvm/test/MC/RISCV/rv32dc-valid.s
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
# RUN: not llvm-mc -triple riscv32 -mattr=+c \
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-D %s
# RUN: not llvm-mc -triple riscv32 -mattr=+zcd \
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-D %s
# RUN: not llvm-mc -triple riscv32 -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-DC %s

Expand Down
3 changes: 0 additions & 3 deletions llvm/test/MC/RISCV/rv32fc-valid.s
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
# RUN: not llvm-mc -triple riscv32 -mattr=+c \
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-F %s
# RUN: not llvm-mc -triple riscv32 -mattr=+zcf \
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-F %s
# RUN: not llvm-mc -triple riscv32 \
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-FC %s
Expand Down
3 changes: 0 additions & 3 deletions llvm/test/MC/RISCV/rv64dc-valid.s
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
# RUN: not llvm-mc -triple riscv64 -mattr=+c \
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-D %s
# RUN: not llvm-mc -triple riscv64 -mattr=+zcd \
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-D %s
# RUN: not llvm-mc -triple riscv64 -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-DC %s

Expand Down

0 comments on commit 8350d9c

Please sign in to comment.