File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
lib/Target/Sparc/MCTargetDesc Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,14 @@ static unsigned getEFlagsForFeatureSet(const MCSubtargetInfo &STI) {
27
27
if (STI.hasFeature (Sparc::FeatureV8Plus))
28
28
EFlags |= ELF::EF_SPARC_32PLUS;
29
29
30
+ if (STI.hasFeature (Sparc::FeatureVIS))
31
+ EFlags |= ELF::EF_SPARC_SUN_US1;
32
+
33
+ if (STI.hasFeature (Sparc::FeatureVIS2))
34
+ EFlags |= ELF::EF_SPARC_SUN_US3;
35
+
36
+ // VIS 3 and other ISA extensions doesn't set any flags.
37
+
30
38
return EFlags;
31
39
}
32
40
Original file line number Diff line number Diff line change
1
+ ## Emit correct SPARC v9 ELF flags depending on feature options.
2
+ ## - `-mattr=+vis` sets the EF_SPARC_SUN_US1 flag; and
3
+ ## - `-mattr=+vis2` sets the EF_SPARC_SUN_US3 flag.
4
+
5
+ # RUN: llvm-mc -filetype=obj -triple sparcv9 %s -o - | llvm-readobj -h - | FileCheck --check-prefixes=COMMON -DFLAG_VALUE=0x0 %s
6
+ # RUN: llvm-mc -filetype=obj -triple sparcv9 -mattr=+vis %s -o - | llvm-readobj -h - | FileCheck --check-prefixes=COMMON,FLAG -DFLAG_VALUE=0x200 -DFLAG_NAME=EF_SPARC_SUN_US1 %s
7
+ # RUN: llvm-mc -filetype=obj -triple sparcv9 -mattr=+vis2 %s -o - | llvm-readobj -h - | FileCheck --check-prefixes=COMMON,FLAG -DFLAG_VALUE=0x800 -DFLAG_NAME=EF_SPARC_SUN_US3 %s
8
+
9
+ # COMMON: Flags [ ([[FLAG_VALUE]])
10
+ # FLAG: [[FLAG_NAME]]
11
+ # COMMON-NEXT: ]
You can’t perform that action at this time.
0 commit comments