@@ -296,6 +296,16 @@ const WASM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
296296
297297const BPF_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] = & [ ( "alu32" , Some ( sym:: bpf_target_feature) ) ] ;
298298
299+ const CSKY_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] = & [
300+ ( "hard-float" , Some ( sym:: csky_target_feature) ) ,
301+ ( "hard-float-abi" , Some ( sym:: csky_target_feature) ) ,
302+ ( "fpuv2_sf" , Some ( sym:: csky_target_feature) ) ,
303+ ( "fpuv2_df" , Some ( sym:: csky_target_feature) ) ,
304+ ( "fpuv3_sf" , Some ( sym:: csky_target_feature) ) ,
305+ ( "fpuv3_df" , Some ( sym:: csky_target_feature) ) ,
306+ ( "vdspv2" , Some ( sym:: csky_target_feature) ) ,
307+ ( "dspv2" , Some ( sym:: csky_target_feature) ) ,
308+ ] ;
299309/// When rustdoc is running, provide a list of all known features so that all their respective
300310/// primitives may be documented.
301311///
@@ -311,6 +321,7 @@ pub fn all_known_features() -> impl Iterator<Item = (&'static str, Option<Symbol
311321 . chain ( RISCV_ALLOWED_FEATURES . iter ( ) )
312322 . chain ( WASM_ALLOWED_FEATURES . iter ( ) )
313323 . chain ( BPF_ALLOWED_FEATURES . iter ( ) )
324+ . chain ( CSKY_ALLOWED_FEATURES )
314325 . cloned ( )
315326}
316327
@@ -325,6 +336,7 @@ pub fn supported_target_features(sess: &Session) -> &'static [(&'static str, Opt
325336 "riscv32" | "riscv64" => RISCV_ALLOWED_FEATURES ,
326337 "wasm32" | "wasm64" => WASM_ALLOWED_FEATURES ,
327338 "bpf" => BPF_ALLOWED_FEATURES ,
339+ "csky" => CSKY_ALLOWED_FEATURES ,
328340 _ => & [ ] ,
329341 }
330342}
@@ -396,6 +408,7 @@ pub fn from_target_feature(
396408 Some ( sym:: ermsb_target_feature) => rust_features. ermsb_target_feature ,
397409 Some ( sym:: bpf_target_feature) => rust_features. bpf_target_feature ,
398410 Some ( sym:: aarch64_ver_target_feature) => rust_features. aarch64_ver_target_feature ,
411+ Some ( sym:: csky_target_feature) => rust_features. csky_target_feature ,
399412 Some ( name) => bug ! ( "unknown target feature gate {}" , name) ,
400413 None => true ,
401414 } ;
0 commit comments