Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Hexagon] Handling of new HVX flags and target-features
This patch has the following changes A new flag "-mhvx-length={64B|128B}" is introduced to specify the length of the vector. Previously we have used "-mhvx-double" for 128 Bytes. This adds the target-feature "+hvx-length{64|128}b" The "-mhvx" flag must be provided on command line to enable HVX for Hexagon. If no -mhvx-length flag is specified, a default length is picked from the arch mentioned in this priority order from either -mhvx=vxx or -mcpu. For v60 and v62 the default length is 64 Byte. For unknown versions, the length is 128 Byte. The -mhvx flag adds the target-feature "+hvxv{hvx_version}" The 64 Byte mode is soon going to be deprecated. A warning is emitted if 64 Byte is enabled. A warning is still emitted for the default 64 Byte as well. This warning can be suppressed with a -Wno flag. The "-mhvx-double" and "-mno-hvx-double" flags are deprecated. A warning is emitted if the driver sees them on commandline. "-mhvx-double" is an alias to "-mhvx-length=128B" The compilation will error out if -mhvx-length is specified with out an -mhvx/-mhvx= flag The macro HVX_LENGTH is defined and is set to the length of the vector. Eg: #define HVX_LENGTH 64 The macro HVX_ARCH is defined and is set to the version of the HVX. Eg: #define HVX_ARCH 62 Differential Revision: https://reviews.llvm.org/D38852 llvm-svn: 316102
- Loading branch information
Sumanth Gundapaneni
committed
Oct 18, 2017
1 parent
e1983bc
commit 57098f5
Showing
10 changed files
with
255 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// ----------------------------------------------------------------------------- | ||
// Tests for the hvx features and warnings. | ||
// ----------------------------------------------------------------------------- | ||
|
||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECKHVX162 %s | ||
// CHECKHVX162: "-target-feature" "+hvxv62" | ||
|
||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \ | ||
// RUN: -mhvx-double 2>&1 | FileCheck -check-prefix=CHECKHVX2 %s | ||
|
||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \ | ||
// RUN: -mhvx-length=128B 2>&1 | FileCheck -check-prefix=CHECKHVX2 %s | ||
// CHECKHVX2-NOT: "-target-feature" "+hvx-length64b" | ||
// CHECKHVX2: "-target-feature" "+hvx-length128b" | ||
|
||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=CHECKHVX3 %s | ||
// CHECKHVX3-NOT: "-target-feature" "+hvx | ||
|
||
// -mhvx-double is deprecated. | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx-double \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-DEPRECATED %s | ||
// CHECK-DEPRECATED: warning: argument '-mhvx-double' is deprecated, use '-mhvx-length=128B' instead [-Wdeprecated] | ||
|
||
// -mno-hvx-double is deprecated. | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mno-hvx-double \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NODEPRECATED %s | ||
// CHECK-NODEPRECATED: warning: argument '-mno-hvx-double' is deprecated, use '-mno-hvx' instead [-Wdeprecated] | ||
|
||
// No hvx target feature must be added if -mno-hvx/-mno-hvx-double occurs last | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mno-hvx \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NOHVX %s | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mno-hvx \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NOHVX %s | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mno-hvx-double \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NOHVX %s | ||
// CHECK-NOHVX-NOT: "-target-feature" "+hvx | ||
|
||
// Hvx target feature should be added if -mno-hvx doesnot occur last | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mno-hvx -mhvx\ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXFEAT %s | ||
// CHECK-HVXFEAT: "-target-feature" "+hvxv62" | ||
|
||
// With -mhvx, the version of hvx defaults to Cpu | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVX-DEFAULT %s | ||
// CHECK-HVX-DEFAULT: "-target-feature" "+hvxv60" | ||
|
||
// Test -mhvx= flag | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx=v62 \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXEQ %s | ||
// CHECK-HVXEQ: "-target-feature" "+hvxv62" | ||
|
||
// Honor the last occured -mhvx=, -mhvx flag. | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx=v62 -mhvx\ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXEQ-PRE %s | ||
// CHECK-HVXEQ-PRE-NOT: "-target-feature" "+hvxv62" | ||
// CHECK-HVXEQ-PRE: "-target-feature" "+hvxv60" | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx -mhvx=v62\ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXEQ-PRE2 %s | ||
// CHECK-HVXEQ-PRE2-NOT: "-target-feature" "+hvxv60" | ||
// CHECK-HVXEQ-PRE2: "-target-feature" "+hvxv62" | ||
|
||
// Test -mhvx-length flag | ||
// The default mode on v60,v62 is 64B. | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx -mhvx-length=64B\ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s | ||
// CHECK-HVXLENGTH-64B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length64b" | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mhvx-length=128B\ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-128B %s | ||
// CHECK-HVXLENGTH-128B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length128b" | ||
|
||
// Bail out if -mhvx-length is specified without HVX enabled | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx-length=64B \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-ERROR %s | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx-length=128B \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-ERROR %s | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx-double \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-ERROR %s | ||
// CHECK-HVXLENGTH-ERROR: error: -mhvx-length is not supported without a -mhvx/-mhvx= flag | ||
|
||
// Error out if an unsupported value is passed to -mhvx-length. | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx -mhvx-length=B \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-VALUE-ERROR %s | ||
// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx -mhvx-length=128 \ | ||
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-VALUE-ERROR %s | ||
// CHECK-HVXLENGTH-VALUE-ERROR: error: unsupported argument '{{.*}}' to option 'mhvx-length=' |
Oops, something went wrong.