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
03fd5bc
commit 309bcf3
Showing
6 changed files
with
47 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,7 @@ psrlq | |
01234 05678 | ||
00617 02839 | ||
00000 00000 | ||
paddq | ||
01234 05678 | ||
11111 11111 | ||
12345 16789 |
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,29 @@ | ||
#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 }; | ||
int64_t buf1111[2] = { 11111, 11111 }; | ||
|
||
// xmm1 Initially 1234 | ||
__m128i xmm1 = _mm_load_si128((__m128i*) buf1234); | ||
_mm_store_si128((__m128i*) out, xmm1); | ||
printout(); | ||
|
||
// xmm2 Initially 1111 | ||
__m128i xmm2 = _mm_load_si128((__m128i*) buf1111); | ||
_mm_store_si128((__m128i*) out, xmm2); | ||
printout(); | ||
|
||
// Result is just each added by 1 | ||
asm volatile( "paddq %[vec2], %[vec1]\n\t" | ||
: [vec1] "+x" (xmm1), [vec2] "+x" (xmm2) | ||
:); | ||
_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