@@ -51,28 +51,15 @@ where
5151 self . constraint . is_some ( )
5252 }
5353
54- /// The binding keyword (e.g. "const" or "let") for the array of possible test inputs.
55- fn rust_vals_array_binding ( & self ) -> impl std:: fmt:: Display {
56- if self . ty . is_rust_vals_array_const ( ) {
57- "const"
58- } else {
59- "let"
60- }
61- }
62-
6354 /// The name (e.g. "A_VALS" or "a_vals") for the array of possible test inputs.
6455 pub ( crate ) fn rust_vals_array_name ( & self ) -> impl std:: fmt:: Display {
65- if self . ty . is_rust_vals_array_const ( ) {
66- let loads = crate :: common:: gen_rust:: PASSES ;
67- format ! (
68- "{}_{ty}_{load_size}" ,
69- self . name. to_uppercase( ) ,
70- ty = self . ty. rust_scalar_type( ) ,
71- load_size = self . ty. num_lanes( ) * self . ty. num_vectors( ) + loads - 1 ,
72- )
73- } else {
74- format ! ( "{}_vals" , self . name. to_lowercase( ) )
75- }
56+ let loads = crate :: common:: gen_rust:: PASSES ;
57+ format ! (
58+ "{}_{ty}_{load_size}" ,
59+ self . name. to_uppercase( ) ,
60+ ty = self . ty. rust_scalar_type( ) ,
61+ load_size = self . ty. num_lanes( ) * self . ty. num_vectors( ) + loads - 1 ,
62+ )
7663 }
7764}
7865
@@ -137,26 +124,6 @@ where
137124 . join ( "" )
138125 }
139126
140- /// Creates a line for each argument that initializes an array for Rust from which `loads` argument
141- /// values can be loaded as a sliding window, e.g `const A_VALS: [u32; 20] = [...];`
142- pub fn gen_arglists_rust (
143- & self ,
144- w : & mut impl std:: io:: Write ,
145- indentation : Indentation ,
146- loads : u32 ,
147- ) -> std:: io:: Result < ( ) > {
148- for arg in self . iter ( ) . filter ( |& arg| !arg. has_constraint ( ) ) {
149- // Constants are defined globally.
150- if arg. ty . is_rust_vals_array_const ( ) {
151- continue ;
152- }
153-
154- Self :: gen_arg_rust ( arg, w, indentation, loads) ?;
155- }
156-
157- Ok ( ( ) )
158- }
159-
160127 pub fn gen_arg_rust (
161128 arg : & Argument < T > ,
162129 w : & mut impl std:: io:: Write ,
@@ -165,8 +132,7 @@ where
165132 ) -> std:: io:: Result < ( ) > {
166133 writeln ! (
167134 w,
168- "{indentation}{bind} {name}: [{ty}; {load_size}] = {values};\n " ,
169- bind = arg. rust_vals_array_binding( ) ,
135+ "{indentation}static {name}: [{ty}; {load_size}] = {values};\n " ,
170136 name = arg. rust_vals_array_name( ) ,
171137 ty = arg. ty. rust_scalar_type( ) ,
172138 load_size = arg. ty. num_lanes( ) * arg. ty. num_vectors( ) + loads - 1 ,
0 commit comments