@@ -93,8 +93,8 @@ pub fn create_c_test_function<T: IntrinsicTypeDefinition>(
9393pub fn write_mod_cpp < T : IntrinsicTypeDefinition > (
9494 w : & mut impl std:: io:: Write ,
9595 notice : & str ,
96- architecture : & str ,
9796 platform_headers : & [ & str ] ,
97+ forward_declarations : & str ,
9898 intrinsics : & [ Intrinsic < T > ] ,
9999) -> std:: io:: Result < ( ) > {
100100 write ! ( w, "{notice}" ) ?;
@@ -125,12 +125,7 @@ std::ostream& operator<<(std::ostream& os, float16_t value);
125125"#
126126 ) ?;
127127
128- writeln ! ( w, "#ifdef __{architecture}__" ) ?;
129- writeln ! (
130- w,
131- "std::ostream& operator<<(std::ostream& os, poly128_t value);"
132- ) ?;
133- writeln ! ( w, "#endif" ) ?;
128+ writeln ! ( w, "{}" , forward_declarations) ?;
134129
135130 for intrinsic in intrinsics {
136131 create_c_test_function ( w, intrinsic) ?;
@@ -141,7 +136,6 @@ std::ostream& operator<<(std::ostream& os, float16_t value);
141136
142137pub fn write_main_cpp < ' a > (
143138 w : & mut impl std:: io:: Write ,
144- architecture : & str ,
145139 arch_specific_definitions : & str ,
146140 intrinsics : impl Iterator < Item = & ' a str > + Clone ,
147141) -> std:: io:: Result < ( ) > {
@@ -170,9 +164,8 @@ std::ostream& operator<<(std::ostream& os, float16_t value) {{
170164"#
171165 ) ?;
172166
173- writeln ! ( w , "#ifdef __{architecture}__" ) ? ;
167+ // NOTE: It's assumed that this value contains the required `ifdef`s.
174168 writeln ! ( w, "{arch_specific_definitions }" ) ?;
175- writeln ! ( w, "#endif" ) ?;
176169
177170 for intrinsic in intrinsics. clone ( ) {
178171 writeln ! ( w, "extern int run_{intrinsic}(void);" ) ?;
0 commit comments