forked from ish-app/ish
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45f3b38
commit 03fd5bc
Showing
7 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <emmintrin.h> | ||
#include <xmmintrin.h> | ||
|
||
#define printout() printf("%05lld %05lld\n", (long long) out[0], (long long) out[1]) | ||
|
||
void main(void) { | ||
int64_t out[2] = { 0, 0 }; | ||
int64_t buf1234[2] = { 1234, 5678 }; | ||
|
||
// xmm1 Initially 1234 | ||
__m128i xmm1 = _mm_load_si128((__m128i*) buf1234); | ||
_mm_store_si128((__m128i*) out, xmm1); | ||
printout(); | ||
|
||
// xmm2 is just multiply by 2 | ||
asm volatile( "psllq $1, %[vec1]\n\t" | ||
: [vec1] "+x" (xmm1) | ||
:); | ||
_mm_store_si128((__m128i*) out, xmm1); | ||
printout(); | ||
|
||
// xmm1 should be cleared | ||
asm volatile( "psllq $66, %[vec1]\n\t" | ||
: [vec1] "+x" (xmm1) | ||
:); | ||
//shift_right(&xmm1, 66); | ||
_mm_store_si128((__m128i*) out, xmm1); | ||
printout(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters