Skip to content

Commit ac1e68a

Browse files
p32bloalexcrichton
authored andcommitted
sse4.1 instructions (rust-lang#98)
* sse4.1: _mm_blendv_ps and _mm_blendv_pd * sse4.1: _mm_blend_ps and _mm_blend_pd - HACK warning: messing with the constify macros - Selecting only one buffer gets optimized away and tests need to take this into account * sse4.1: _mm_blend_epi16 * sse4.1: _mm_extract_ps * sse4.1: _mm_extract_epi8 * see4.1: _mm_extract_epi32 * sse4.1: _mm_extract_epi64 * sse4.1: _mm_insert_ps * sse4.1: _mm_insert_epi8 * sse4.1: _mm_insert_epi32 and _mm_insert_epi64 * Formmating * sse4.1: _mm_max_epi8, _mm_max_epu16, _mm_max_epi32 and _mm_max_epu32 * Fix wrong compiler flag - avx -> sse4.1 * Fix intrinsics that only work with x86-64 * sse4.1: use appropriate types * Revert '_mm_extract_ps' to return i32 * sse4.1: Use the v128 types for consistency * Try fix for windows * Try "vectorcall" calling convention * Revert "Try "vectorcall" calling convention" This reverts commit 12936e9976bc6b0e4e538d82f55f0ee2d87a7f25. * Revert "Try fix for windows" This reverts commit 9c473808d334acedd46060b32ceea116662bf6a3. * Change tests for windows * Remove useless Windows test
1 parent cd04817 commit ac1e68a

File tree

2 files changed

+398
-7
lines changed

2 files changed

+398
-7
lines changed

src/x86/macros.rs

+38
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,41 @@ macro_rules! constify_imm6 {
301301
}
302302
}
303303
}
304+
305+
macro_rules! constify_imm4 {
306+
($imm8:expr, $expand:ident) => {
307+
#[allow(overflowing_literals)]
308+
match $imm8 & 0b1111 {
309+
0 => $expand!(0),
310+
1 => $expand!(1),
311+
2 => $expand!(2),
312+
3 => $expand!(3),
313+
4 => $expand!(4),
314+
5 => $expand!(5),
315+
6 => $expand!(6),
316+
7 => $expand!(7),
317+
8 => $expand!(8),
318+
9 => $expand!(9),
319+
10 => $expand!(10),
320+
11 => $expand!(11),
321+
12 => $expand!(12),
322+
13 => $expand!(13),
323+
14 => $expand!(14),
324+
_ => $expand!(15),
325+
}
326+
}
327+
}
328+
329+
macro_rules! constify_imm2 {
330+
($imm8:expr, $expand:ident) => {
331+
#[allow(overflowing_literals)]
332+
match $imm8 & 0b11 {
333+
0 => $expand!(0),
334+
1 => $expand!(1),
335+
2 => $expand!(2),
336+
_ => $expand!(3),
337+
}
338+
}
339+
}
340+
341+

0 commit comments

Comments
 (0)