aboutsummaryrefslogtreecommitdiff
path: root/src/libmp/386/mpvecdigmulsub.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-12-30 07:39:16 -0500
committerRuss Cox <rsc@swtch.com>2020-12-30 07:53:28 -0500
commit99dee78c2d44641ba56e5bb640d732f993b3dfa1 (patch)
tree3e785ab1037b96d4eb2dc321925bc0733332cea8 /src/libmp/386/mpvecdigmulsub.s
parent0bd14783426d137428ffae7cd89cfc06b88d1b11 (diff)
downloadplan9port-99dee78c2d44641ba56e5bb640d732f993b3dfa1.tar.gz
plan9port-99dee78c2d44641ba56e5bb640d732f993b3dfa1.tar.bz2
plan9port-99dee78c2d44641ba56e5bb640d732f993b3dfa1.zip
all: remove $OBJTYPE from build
Now that we assume pthreads, the only assembly left is in libmp and libsec. We only ever added assembly for 386. The portable C code is fine for plan9port.
Diffstat (limited to 'src/libmp/386/mpvecdigmulsub.s')
-rw-r--r--src/libmp/386/mpvecdigmulsub.s70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/libmp/386/mpvecdigmulsub.s b/src/libmp/386/mpvecdigmulsub.s
deleted file mode 100644
index 017e86c9..00000000
--- a/src/libmp/386/mpvecdigmulsub.s
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# mpvecdigmulsub(mpdigit *b, int n, mpdigit m, mpdigit *p)
-#
-# p -= b*m
-#
-# each step look like:
-# hi,lo = m*b[i]
-# lo += oldhi + carry
-# hi += carry
-# p[i] += lo
-# oldhi = hi
-#
-# the registers are:
-# hi = DX - constrained by hardware
-# lo = AX - constrained by hardware
-# b = SI - can't be BP
-# p = DI - can't be BP
-# i = BP
-# n = CX - constrained by LOOP instr
-# m = BX
-# oldhi = EX
-#
-
-.text
-
-.p2align 2,0x90
-.globl mpvecdigmulsub
-mpvecdigmulsub:
- # Prelude
- pushl %ebp # save on stack
- pushl %ebx
- pushl %esi
- pushl %edi
-
- leal 20(%esp), %ebp # %ebp = FP for now
- movl 0(%ebp), %esi # b
- movl 4(%ebp), %ecx # n
- movl 8(%ebp), %ebx # m
- movl 12(%ebp), %edi # p
- xorl %ebp, %ebp
- pushl %ebp
-_mulsubloop:
- movl (%esi, %ebp, 4),%eax # lo = b[i]
- mull %ebx # hi, lo = b[i] * m
- addl 0(%esp), %eax # lo += oldhi
- jae _mulsubnocarry1
- incl %edx # hi += carry
-_mulsubnocarry1:
- subl %eax, (%edi, %ebp, 4)
- jae _mulsubnocarry2
- incl %edx # hi += carry
-_mulsubnocarry2:
- movl %edx, 0(%esp)
- incl %ebp
- loop _mulsubloop
- popl %eax
- subl %eax, (%edi, %ebp, 4)
- jae _mulsubnocarry3
- movl $-1, %eax
- jmp done
-_mulsubnocarry3:
- movl $1, %eax
-done:
- # Postlude
- popl %edi
- popl %esi
- popl %ebx
- popl %ebp
- ret
-