diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref23.txt | 1 | ||||
| -rwxr-xr-x | tests/test23 | bin | 0 -> 15984 bytes | |||
| -rw-r--r-- | tests/test23.c | 28 |
3 files changed, 29 insertions, 0 deletions
diff --git a/tests/ref23.txt b/tests/ref23.txt new file mode 100644 index 00000000..b06138f6 --- /dev/null +++ b/tests/ref23.txt @@ -0,0 +1 @@ +Res = 0xefcd00ef diff --git a/tests/test23 b/tests/test23 new file mode 100755 index 00000000..e6e84636 --- /dev/null +++ b/tests/test23 Binary files differdiff --git a/tests/test23.c b/tests/test23.c new file mode 100644 index 00000000..7328a398 --- /dev/null +++ b/tests/test23.c @@ -0,0 +1,28 @@ +#include <stdio.h> +#include <string.h> +#include <stddef.h> +#include <stdint.h> +// Build with `gcc -march=core2 -O2 test23.c -o test23` + +uint64_t pshufb(uint64_t Gm, uint64_t Em) { +uint64_t Res; +asm( +"movq %[_Gm], %%mm0\n" +"movq %[_Em], %%mm1\n" +"pshufb %%mm1, %%mm0\n" +"movq %%mm0, %[_Res]\n" +: [_Res] "+r"(Res) +: [_Gm] "r"(Gm) +, [_Em] "r"(Em) +); +return Res; +} + +int main() { +uint64_t Gm = 0x12345678abcdef00; +uint64_t Em = 0x8182888971727879; +uint64_t Res = pshufb(Gm, Em); +printf("Res = 0x%lx\n", Res); +//assert(Res == 0xefcd00ef); +return 0; +} |