Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::arch::x86_64::{_mm_loadu_si128, __m128i, _mm_cmpeq_epi8, _mm_set1_epi8, _mm_sub_epi8, _mm_and_si128, _mm_unpackhi_epi8, _mm_add_epi32, _mm_shufflelo_epi16};
- //use std::arch::x86::_MM_SHUFFLE;
- use std::arch::x86;
- use std::mem;
- fn main() {
- unsafe {
- //let t = _mm_set1_epi8(50);
- let q = _mm_set1_epi8(51);
- let hi8 = _mm_unpackhi_epi8(q, q);
- let sum64 = _mm_add_epi32(hi8, q);
- let hi32 = _mm_shufflelo_epi16(sum64, _MM_SHUFFLE(1, 0, 3, 2));
- let arr: [u8; 16] = mem::transmute(hi32);
- println!("{:?}", arr);
- }
- println!("{} {}", 255 & 48, 255 - 48);
- }
- /*
- 255 - 50 = 205
- 50 == 50 -> 255
- 207 - 205 = 2
- */
Add Comment
Please, Sign In to add comment