@@ -93,8 +93,8 @@ pub fn create_c_test_function<T: IntrinsicTypeDefinition>(
93
93
pub fn write_mod_cpp < T : IntrinsicTypeDefinition > (
94
94
w : & mut impl std:: io:: Write ,
95
95
notice : & str ,
96
- architecture : & str ,
97
96
platform_headers : & [ & str ] ,
97
+ forward_declarations : & str ,
98
98
intrinsics : & [ Intrinsic < T > ] ,
99
99
) -> std:: io:: Result < ( ) > {
100
100
write ! ( w, "{notice}" ) ?;
@@ -125,12 +125,7 @@ std::ostream& operator<<(std::ostream& os, float16_t value);
125
125
"#
126
126
) ?;
127
127
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) ?;
134
129
135
130
for intrinsic in intrinsics {
136
131
create_c_test_function ( w, intrinsic) ?;
@@ -141,7 +136,6 @@ std::ostream& operator<<(std::ostream& os, float16_t value);
141
136
142
137
pub fn write_main_cpp < ' a > (
143
138
w : & mut impl std:: io:: Write ,
144
- architecture : & str ,
145
139
arch_specific_definitions : & str ,
146
140
intrinsics : impl Iterator < Item = & ' a str > + Clone ,
147
141
) -> std:: io:: Result < ( ) > {
@@ -170,9 +164,8 @@ std::ostream& operator<<(std::ostream& os, float16_t value) {{
170
164
"#
171
165
) ?;
172
166
173
- writeln ! ( w , "#ifdef __{architecture}__" ) ? ;
167
+ // NOTE: It's assumed that this value contains the required `ifdef`s.
174
168
writeln ! ( w, "{arch_specific_definitions }" ) ?;
175
- writeln ! ( w, "#endif" ) ?;
176
169
177
170
for intrinsic in intrinsics. clone ( ) {
178
171
writeln ! ( w, "extern int run_{intrinsic}(void);" ) ?;
0 commit comments