x86: paddq

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-10 00:00:00 +00:00
parent 5d774c0947
commit 16ecab4af0
4 changed files with 37 additions and 13 deletions

View File

@@ -13,7 +13,7 @@ ENTRY
.data
u32_0: .word 0xF111F111, 0xF222F222, 0xF333F333, 0xF444F444
u32_1: .word 0x15551555, 0x16661666, 0x17771777, 0x18881888
u32_sum_expect: .word 0x06670666, 0x08890888, 0x0AAB0AAA, 0x0CCD0CCC
u32_sum_expect: .word 0x06670666, 0x08890889, 0x0AAB0AAA, 0x0CCD0CCC
.bss
u32_sum: .skip 16
.text

View File

@@ -39,7 +39,7 @@ int assert_memcmp(const void *s1, const void *s2, size_t n) {
printf(
"%s failed: "
"byte1, byte2, index: "
"0x%02" PRIX8 " 0x%02" PRIX8 " 0x%zx\n",
"0x%02" PRIX8 " 0x%02" PRIX8 " 0x%zX\n",
__func__,
b1,
b2,

View File

@@ -0,0 +1,21 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-simd
*
* Add 4 32-bit integeres in one go.
*/
#include "common.h"
ENTRY
.data
u32_0: .long 0xF111F111, 0xF222F222, 0xF333F333, 0xF444F444
u32_1: .long 0x15551555, 0x16661666, 0x17771777, 0x18881888
u32_expect: .long 0x06670666, 0x08890889, 0x0AAB0AAA, 0x0CCD0CCD
.bss
u32_result: .skip 16
.text
movups u32_0, %xmm0
movups u32_1, %xmm1
paddq %xmm1, %xmm0
movups %xmm0, u32_result
ASSERT_MEMCMP(u32_result, u32_expect, $0x10)
EXIT