[llvm-branch-commits] [clang] 0f02cdb - [hexagon] add a -mcabac flag

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 16 00:50:32 PST 2023


Author: Brian Cain
Date: 2023-02-16T09:48:46+01:00
New Revision: 0f02cdb9dca6ead87820a430e28adaa3cdb624ca

URL: https://github.com/llvm/llvm-project/commit/0f02cdb9dca6ead87820a430e28adaa3cdb624ca
DIFF: https://github.com/llvm/llvm-project/commit/0f02cdb9dca6ead87820a430e28adaa3cdb624ca.diff

LOG: [hexagon] add a -mcabac flag

For v73 and later, clang users who wish to use the cabac instructions need
a way to add the 'cabac' target feature.

Reviewed By: kparzysz

Differential Revision: https://reviews.llvm.org/D142947

(cherry picked from commit cd97675e02368f31d56bd8f143c5987649d162d8)

Added: 
    

Modified: 
    clang/include/clang/Driver/Options.td
    clang/test/Driver/hexagon-toolchain-elf.c

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 23752823e88f6..652c15afcce86 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4559,6 +4559,8 @@ def mnvs : Flag<["-"], "mnvs">, Group<m_hexagon_Features_Group>,
   Flags<[CC1Option]>, HelpText<"Enable generation of new-value stores">;
 def mno_nvs : Flag<["-"], "mno-nvs">, Group<m_hexagon_Features_Group>,
   Flags<[CC1Option]>, HelpText<"Disable generation of new-value stores">;
+def mcabac: Flag<["-"], "mcabac">, Group<m_hexagon_Features_Group>,
+  HelpText<"Enable CABAC instructions">;
 
 // SPARC feature flags
 def mfpu : Flag<["-"], "mfpu">, Group<m_sparc_Features_Group>;

diff  --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c
index 477bc8a969b92..9454c33747630 100644
--- a/clang/test/Driver/hexagon-toolchain-elf.c
+++ b/clang/test/Driver/hexagon-toolchain-elf.c
@@ -581,6 +581,16 @@
 // RUN:        | FileCheck --check-prefix=CHECK371 %s
 // CHECK371-NOT: "+reserved-r19"
 
+// -----------------------------------------------------------------------------
+// mcabac
+// -----------------------------------------------------------------------------
+// RUN: %clang -### -target hexagon-unknown-elf -mcabac %s 2>&1 \
+// RUN:        | FileCheck --check-prefix=CHECK372 %s
+// CHECK372: "-target-feature" "+cabac"
+// RUN: %clang -### -target hexagon-unknown-elf %s 2>&1 \
+// RUN:        | FileCheck --check-prefix=CHECK373 %s
+// CHECK373-NOT: "+cabac"
+
 // -----------------------------------------------------------------------------
 // Misc Defaults
 // -----------------------------------------------------------------------------


        


More information about the llvm-branch-commits mailing list