Skip to content

Commit 0f02cdb

Browse files
androm3datru
authored andcommitted
[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 cd97675)
1 parent 7f25508 commit 0f02cdb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4559,6 +4559,8 @@ def mnvs : Flag<["-"], "mnvs">, Group<m_hexagon_Features_Group>,
45594559
Flags<[CC1Option]>, HelpText<"Enable generation of new-value stores">;
45604560
def mno_nvs : Flag<["-"], "mno-nvs">, Group<m_hexagon_Features_Group>,
45614561
Flags<[CC1Option]>, HelpText<"Disable generation of new-value stores">;
4562+
def mcabac: Flag<["-"], "mcabac">, Group<m_hexagon_Features_Group>,
4563+
HelpText<"Enable CABAC instructions">;
45624564

45634565
// SPARC feature flags
45644566
def mfpu : Flag<["-"], "mfpu">, Group<m_sparc_Features_Group>;

clang/test/Driver/hexagon-toolchain-elf.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,16 @@
581581
// RUN: | FileCheck --check-prefix=CHECK371 %s
582582
// CHECK371-NOT: "+reserved-r19"
583583

584+
// -----------------------------------------------------------------------------
585+
// mcabac
586+
// -----------------------------------------------------------------------------
587+
// RUN: %clang -### -target hexagon-unknown-elf -mcabac %s 2>&1 \
588+
// RUN: | FileCheck --check-prefix=CHECK372 %s
589+
// CHECK372: "-target-feature" "+cabac"
590+
// RUN: %clang -### -target hexagon-unknown-elf %s 2>&1 \
591+
// RUN: | FileCheck --check-prefix=CHECK373 %s
592+
// CHECK373-NOT: "+cabac"
593+
584594
// -----------------------------------------------------------------------------
585595
// Misc Defaults
586596
// -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)