summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2018-02-04 05:38:49 +0100
committerEugen Wissner <belka@caraus.de>2018-02-04 07:23:56 +0100
commit2cda82eeea484e2d46908462f755edcb4ef56cce (patch)
treea1d2aac5461c1c008b281930cddc84e301bdfedf /arch
parente9f70853c621d58122fe005f6df40d3154a5f156 (diff)
downloadtanya-2cda82eeea484e2d46908462f755edcb4ef56cce.tar.gz
Fix handling of misaligned bytes in fill
Diffstat (limited to 'arch')
-rw-r--r--arch/x64/linux/memory/fill.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x64/linux/memory/fill.S b/arch/x64/linux/memory/fill.S
index d4fc0ac..2717aa1 100644
--- a/arch/x64/linux/memory/fill.S
+++ b/arch/x64/linux/memory/fill.S
@@ -37,6 +37,11 @@ _D5tanya6memory2op10fillMemoryFNaNbNiAvmZv:
mov %rsi, %r8
+ // If the length is less than the number of misaligned bytes,
+ // write one byte at a time and exit
+ cmp %rax, %rcx
+ jg aligned_1
+
naligned:
mov %dl, (%r8) // Write a byte