File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ use rustc_metadata::EncodedMetadata;
42
42
use rustc_middle:: dep_graph:: { WorkProduct , WorkProductId } ;
43
43
use rustc_session:: config:: OutputFilenames ;
44
44
use rustc_session:: Session ;
45
- use rustc_span:: Symbol ;
45
+ use rustc_span:: { sym , Symbol } ;
46
46
47
47
pub use crate :: config:: * ;
48
48
use crate :: prelude:: * ;
@@ -190,8 +190,17 @@ impl CodegenBackend for CraneliftCodegenBackend {
190
190
}
191
191
}
192
192
193
- fn target_features ( & self , _sess : & Session , _allow_unstable : bool ) -> Vec < rustc_span:: Symbol > {
194
- vec ! [ ] // FIXME necessary for #[cfg(target_feature]
193
+ fn target_features ( & self , sess : & Session , _allow_unstable : bool ) -> Vec < rustc_span:: Symbol > {
194
+ // FIXME return the actually used target features. this is necessary for #[cfg(target_feature)]
195
+ if sess. target . arch == "x86_64" && sess. target . os != "none" {
196
+ // x86_64 mandates SSE2 support
197
+ vec ! [ Symbol :: intern( "fxsr" ) , sym:: sse, Symbol :: intern( "sse2" ) ]
198
+ } else if sess. target . arch == "aarch64" && sess. target . os != "none" {
199
+ // AArch64 mandates Neon support
200
+ vec ! [ sym:: neon]
201
+ } else {
202
+ vec ! [ ]
203
+ }
195
204
}
196
205
197
206
fn print_version ( & self ) {
You can’t perform that action at this time.
0 commit comments