@@ -37,6 +37,13 @@ const char *sparc::getSparcAsmModeForCPU(StringRef Name,
37
37
.Case (" niagara4" , " -Av9d" )
38
38
.Default (DefV9CPU);
39
39
} else {
40
+ const char *DefV8CPU;
41
+
42
+ if (Triple.isOSSolaris ())
43
+ DefV8CPU = " -Av8plus" ;
44
+ else
45
+ DefV8CPU = " -Av8" ;
46
+
40
47
return llvm::StringSwitch<const char *>(Name)
41
48
.Case (" v8" , " -Av8" )
42
49
.Case (" supersparc" , " -Av8" )
@@ -72,7 +79,7 @@ const char *sparc::getSparcAsmModeForCPU(StringRef Name,
72
79
.Case (" gr712rc" , " -Aleon" )
73
80
.Case (" leon4" , " -Aleon" )
74
81
.Case (" gr740" , " -Aleon" )
75
- .Default (" -Av8 " );
82
+ .Default (DefV8CPU );
76
83
}
77
84
}
78
85
@@ -160,6 +167,8 @@ void sparc::getSparcTargetFeatures(const Driver &D, const llvm::Triple &Triple,
160
167
(Triple.getArch () == llvm::Triple::sparcv9) &&
161
168
(Triple.isOSLinux () || Triple.isOSFreeBSD () || Triple.isOSOpenBSD ());
162
169
bool IsSparcV9BTarget = Triple.isOSSolaris ();
170
+ bool IsSparcV8PlusTarget =
171
+ Triple.getArch () == llvm::Triple::sparc && Triple.isOSSolaris ();
163
172
if (Arg *A = Args.getLastArg (options::OPT_mvis, options::OPT_mno_vis)) {
164
173
if (A->getOption ().matches (options::OPT_mvis))
165
174
Features.push_back (" +vis" );
@@ -196,6 +205,8 @@ void sparc::getSparcTargetFeatures(const Driver &D, const llvm::Triple &Triple,
196
205
if (Arg *A = Args.getLastArg (options::OPT_mv8plus, options::OPT_mno_v8plus)) {
197
206
if (A->getOption ().matches (options::OPT_mv8plus))
198
207
Features.push_back (" +v8plus" );
208
+ } else if (IsSparcV8PlusTarget) {
209
+ Features.push_back (" +v8plus" );
199
210
}
200
211
201
212
if (Args.hasArg (options::OPT_ffixed_g1))
0 commit comments