Skip to content

Commit 34c12f9

Browse files
committed
[TEST ONLY] Introduce overflow
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
1 parent b1dc236 commit 34c12f9

5 files changed

Lines changed: 5 additions & 7 deletions

File tree

dev/aarch64_opt/src/rej_uniform_asm.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ rej_uniform_loop48_end:
312312
b.lo rej_uniform_memory_copy
313313

314314
sub buflen, buflen, #24
315-
ld3 {buf0.8b, buf1.8b, buf2.8b}, [buf], #24
315+
ld3 {buf0.16b, buf1.16b, buf2.16b}, [buf], #48
316316

317317
zip1 tmp0.16b, buf0.16b, buf1.16b
318318
zip1 tmp1.16b, buf1.16b, buf2.16b

dev/x86_64/src/rej_uniform_asm.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ MLK_ASM_FN_SYMBOL(rej_uniform_asm)
9898
rej_uniform_asm_loop_start:
9999
// 1. Split 96 bits into eight 12-bit integers where each integer.
100100
// We explain the algorithm by considering the lowest 64 bits of vals.
101-
movq (in, pos), vals // Load low 8 bytes into bits [63:0] of vals
102-
pinsrd $2, 8(in, pos), vals // Insert 4 bytes into bits [95:64] of vals
101+
movdqu (in, pos), vals // Load 16 bytes, overread by 4
103102
// vals: [ 63..48 | 47..32 | 31..16 | 15..0 ]
104103
pshufb shuffle_in_mask, vals
105104
// vals: [ 47..32 | 39..24 | 23..8 | 15..0 ]

mlkem/src/native/aarch64/src/rej_uniform_asm.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Lrej_uniform_loop48_end:
158158
cmp x2, #0x18
159159
b.lo Lrej_uniform_memory_copy
160160
sub x2, x2, #0x18
161-
ld3 { v0.8b, v1.8b, v2.8b }, [x1], #24
161+
ld3 { v0.16b, v1.16b, v2.16b }, [x1], #48
162162
zip1 v4.16b, v0.16b, v1.16b
163163
zip1 v5.16b, v1.16b, v2.16b
164164
bic v4.8h, #0xf0, lsl #8

mlkem/src/native/x86_64/src/rej_uniform_asm.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ MLK_ASM_FN_SYMBOL(rej_uniform_asm)
5454
movq $0x5555, %r9 # imm = 0x5555
5555

5656
Lrej_uniform_asm_loop_start:
57-
movq (%rsi,%r8), %xmm2
58-
pinsrd $0x2, 0x8(%rsi,%r8), %xmm2
57+
movdqu (%rsi,%r8), %xmm2
5958
pshufb %xmm4, %xmm2
6059
movdqa %xmm2, %xmm3
6160
psrlw $0x4, %xmm3

proofs/hol_light/aarch64/mlkem/mlkem_rej_uniform.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Lrej_uniform_loop48_end:
160160
cmp x2, #0x18
161161
b.lo Lrej_uniform_memory_copy
162162
sub x2, x2, #0x18
163-
ld3 { v0.8b, v1.8b, v2.8b }, [x1], #24
163+
ld3 { v0.16b, v1.16b, v2.16b }, [x1], #48
164164
zip1 v4.16b, v0.16b, v1.16b
165165
zip1 v5.16b, v1.16b, v2.16b
166166
bic v4.8h, #0xf0, lsl #8

0 commit comments

Comments
 (0)