aboutsummaryrefslogtreecommitdiff
path: root/residual_calc.asm
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-01-10 09:56:36 +0100
committerAnton Khirnov <anton@khirnov.net>2019-01-13 13:57:07 +0100
commit23be9ec26e6b870795e3af5b837190efe383ee29 (patch)
treeaa0e5ce804e88450896e3cbe1c0d35080a2b9356 /residual_calc.asm
parent685f204c329a59ae2245fa55b8639da73877f39d (diff)
residual_calc.asm: calculate x*=16 by x*=8; x+=x
Frees up one mm register for future use.
Diffstat (limited to 'residual_calc.asm')
-rw-r--r--residual_calc.asm7
1 files changed, 3 insertions, 4 deletions
diff --git a/residual_calc.asm b/residual_calc.asm
index f6f34f3..b6cc70e 100644
--- a/residual_calc.asm
+++ b/residual_calc.asm
@@ -33,7 +33,6 @@
SECTION .rodata
const8: times 8 dq 8.0
-const16: times 8 dq 16.0
const30: times 8 dq 30.0
SECTION .text
@@ -42,7 +41,7 @@ SECTION .text
; m0: accumulator for the residual
; m1-m5: splatted constant finite difference coefficients
; m6-m11: working registers
-; (s2 only) m12-m15: splatted constants 64.0, 16.0, 8.0, 30.0
+; (s2 only) m14-m15: splatted constants 8.0, 30.0
; calculate and add residual contributions from first and second derivatives
; along a single direction (x or y)
@@ -91,7 +90,8 @@ SECTION .text
; second derivative
addpd m11, m7, m9 ; m11 = u[x+1] + u[x-1]
%if stencil == 2
- mulpd m11, m13 ; m11 *= 16
+ mulpd m11, m14
+ addpd m11, m11 ; m11 *= 16
subpd m11, m8 ; m11 -= u[x+2]
subpd m11, m10 ; m11 -= u[x-2]
%endif
@@ -186,7 +186,6 @@ SECTION .text
movu m15, [const30]
movu m14, [const8]
- movu m13, [const16]
%endif
.loop: