@@ -94,97 +94,15 @@ macro_rules! types {
9494}
9595
9696#[ allow( unused) ]
97- macro_rules! simd_shuffle2 {
98- ( $x: expr, $y: expr, <$( const $imm: ident : $ty: ty) ,+ $( , ) ?> $idx: expr $( , ) ?) => { {
99- struct ConstParam <$( const $imm: $ty) ,+>;
100- impl <$( const $imm: $ty) ,+> ConstParam <$( $imm) ,+> {
101- const IDX : [ u32 ; 2 ] = $idx;
102- }
103-
104- simd_shuffle( $x, $y, ConstParam :: <$( $imm) ,+>:: IDX )
105- } } ;
106- ( $x: expr, $y: expr, $idx: expr $( , ) ?) => { {
107- const IDX : [ u32 ; 2 ] = $idx;
108- simd_shuffle( $x, $y, IDX )
109- } } ;
110- }
111-
112- #[ allow( unused_macros) ]
113- macro_rules! simd_shuffle4 {
114- ( $x: expr, $y: expr, <$( const $imm: ident : $ty: ty) ,+ $( , ) ?> $idx: expr $( , ) ?) => { {
115- struct ConstParam <$( const $imm: $ty) ,+>;
116- impl <$( const $imm: $ty) ,+> ConstParam <$( $imm) ,+> {
117- const IDX : [ u32 ; 4 ] = $idx;
118- }
119-
120- simd_shuffle( $x, $y, ConstParam :: <$( $imm) ,+>:: IDX )
121- } } ;
122- ( $x: expr, $y: expr, $idx: expr $( , ) ?) => { {
123- const IDX : [ u32 ; 4 ] = $idx;
124- simd_shuffle( $x, $y, IDX )
125- } } ;
126- }
127-
128- #[ allow( unused_macros) ]
129- macro_rules! simd_shuffle8 {
130- ( $x: expr, $y: expr, <$( const $imm: ident : $ty: ty) ,+ $( , ) ?> $idx: expr $( , ) ?) => { {
131- struct ConstParam <$( const $imm: $ty) ,+>;
132- impl <$( const $imm: $ty) ,+> ConstParam <$( $imm) ,+> {
133- const IDX : [ u32 ; 8 ] = $idx;
134- }
135-
136- simd_shuffle( $x, $y, ConstParam :: <$( $imm) ,+>:: IDX )
137- } } ;
138- ( $x: expr, $y: expr, $idx: expr $( , ) ?) => { {
139- const IDX : [ u32 ; 8 ] = $idx;
140- simd_shuffle( $x, $y, IDX )
141- } } ;
142- }
143-
144- #[ allow( unused) ]
145- macro_rules! simd_shuffle16 {
146- ( $x: expr, $y: expr, <$( const $imm: ident : $ty: ty) ,+ $( , ) ?> $idx: expr $( , ) ?) => { {
147- struct ConstParam <$( const $imm: $ty) ,+>;
148- impl <$( const $imm: $ty) ,+> ConstParam <$( $imm) ,+> {
149- const IDX : [ u32 ; 16 ] = $idx;
150- }
151-
152- simd_shuffle( $x, $y, ConstParam :: <$( $imm) ,+>:: IDX )
153- } } ;
154- ( $x: expr, $y: expr, $idx: expr $( , ) ?) => { {
155- const IDX : [ u32 ; 16 ] = $idx;
156- simd_shuffle( $x, $y, IDX )
157- } } ;
158- }
159-
160- #[ allow( unused_macros) ]
161- macro_rules! simd_shuffle32 {
162- ( $x: expr, $y: expr, <$( const $imm: ident : $ty: ty) ,+> $( , ) ? $idx: expr $( , ) ?) => { {
163- struct ConstParam <$( const $imm: $ty) ,+>;
164- impl <$( const $imm: $ty) ,+> ConstParam <$( $imm) ,+> {
165- const IDX : [ u32 ; 32 ] = $idx;
166- }
167-
168- simd_shuffle( $x, $y, ConstParam :: <$( $imm) ,+>:: IDX )
169- } } ;
170- ( $x: expr, $y: expr, $idx: expr $( , ) ?) => { {
171- const IDX : [ u32 ; 32 ] = $idx;
172- simd_shuffle( $x, $y, IDX )
173- } } ;
174- }
175-
176- #[ allow( unused_macros) ]
177- macro_rules! simd_shuffle64 {
178- ( $x: expr, $y: expr, <$( const $imm: ident : $ty: ty) ,+ $( , ) ?> $idx: expr $( , ) ?) => { {
179- struct ConstParam <$( const $imm: $ty) ,+>;
180- impl <$( const $imm: $ty) ,+> ConstParam <$( $imm) ,+> {
181- const IDX : [ u32 ; 64 ] = $idx;
182- }
183-
184- simd_shuffle( $x, $y, ConstParam :: <$( $imm) ,+>:: IDX )
185- } } ;
97+ macro_rules! simd_shuffle {
18698 ( $x: expr, $y: expr, $idx: expr $( , ) ?) => { {
187- const IDX : [ u32 ; 64 ] = $idx;
188- simd_shuffle( $x, $y, IDX )
99+ simd_shuffle(
100+ $x,
101+ $y,
102+ const {
103+ let v: [ u32 ; _] = $idx;
104+ v
105+ } ,
106+ )
189107 } } ;
190108}
0 commit comments