SunOS fixes (thanks Aram Hăvărneanu)

R=rsc, rsc
http://codereview.appspot.com/4271084
This commit is contained in:
Russ Cox 2011-05-17 18:48:42 -04:00
parent 4e247f10fa
commit af0dea4531
5 changed files with 97 additions and 97 deletions

2
bin/9c
View file

@ -46,7 +46,7 @@ quiet()
grep -v '__p9l_autolib_' $1 | grep -v '__p9l_autolib_' $1 |
egrep -v "$ignore" | egrep -v "$ignore" |
sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' | sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
uniq 1>&2 $(which uniq) 1>&2 # avoid built-in uniq on SunOS
} }
useclang() useclang()

View file

@ -1324,21 +1324,21 @@ lookup(char *s, int doreset)
char *ngctypes[] = char *ngctypes[] =
{ {
[Galaxy] "Gx", [Galaxy] = "Gx",
[PlanetaryN] "Pl", [PlanetaryN] = "Pl",
[OpenCl] "OC", [OpenCl] = "OC",
[GlobularCl] "Gb", [GlobularCl] = "Gb",
[DiffuseN] "Nb", [DiffuseN] = "Nb",
[NebularCl] "C+N", [NebularCl] = "C+N",
[Asterism] "Ast", [Asterism] = "Ast",
[Knot] "Kt", [Knot] = "Kt",
[Triple] "***", [Triple] = "***",
[Double] "D*", [Double] = "D*",
[Single] "*", [Single] = "*",
[Uncertain] "?", [Uncertain] = "?",
[Nonexistent] "-", [Nonexistent] = "-",
[Unknown] " ", [Unknown] = " ",
[PlateDefect] "PD" [PlateDefect] = "PD"
}; };
char* char*

View file

@ -1,66 +1,66 @@
/* #
* mpvecdigmul(mpdigit *b, int n, mpdigit m, mpdigit *p) # mpvecdigmul(mpdigit *b, int n, mpdigit m, mpdigit *p)
* #
* p += b*m # p += b*m
* #
* each step look like: # each step look like:
* hi,lo = m*b[i] # hi,lo = m*b[i]
* lo += oldhi + carry # lo += oldhi + carry
* hi += carry # hi += carry
* p[i] += lo # p[i] += lo
* oldhi = hi # oldhi = hi
* #
* the registers are: # the registers are:
* hi = DX - constrained by hardware # hi = DX - constrained by hardware
* lo = AX - constrained by hardware # lo = AX - constrained by hardware
* b+n = SI - can't be BP # b+n = SI - can't be BP
* p+n = DI - can't be BP # p+n = DI - can't be BP
* i-n = BP # i-n = BP
* m = BX # m = BX
* oldhi = CX # oldhi = CX
* #
*/
.text .text
.p2align 2,0x90 .p2align 2,0x90
.globl mpvecdigmuladd .globl mpvecdigmuladd
mpvecdigmuladd: mpvecdigmuladd:
/* Prelude */ # Prelude
pushl %ebp /* save on stack */ pushl %ebp # save on stack
pushl %ebx pushl %ebx
pushl %esi pushl %esi
pushl %edi pushl %edi
leal 20(%esp), %ebp /* %ebp = FP for now */ leal 20(%esp), %ebp # %ebp = FP for now
movl 0(%ebp), %esi /* b */ movl 0(%ebp), %esi # b
movl 4(%ebp), %ecx /* n */ movl 4(%ebp), %ecx # n
movl 8(%ebp), %ebx /* m */ movl 8(%ebp), %ebx # m
movl 12(%ebp), %edi /* p */ movl 12(%ebp), %edi # p
movl %ecx, %ebp movl %ecx, %ebp
negl %ebp /* BP = -n */ negl %ebp # BP = -n
shll $2, %ecx shll $2, %ecx
addl %ecx, %esi /* SI = b + n */ addl %ecx, %esi # SI = b + n
addl %ecx, %edi /* DI = p + n */ addl %ecx, %edi # DI = p + n
xorl %ecx, %ecx xorl %ecx, %ecx
_muladdloop: _muladdloop:
movl (%esi, %ebp, 4), %eax /* lo = b[i] */ movl (%esi, %ebp, 4), %eax # lo = b[i]
mull %ebx /* hi, lo = b[i] * m */ mull %ebx # hi, lo = b[i] * m
addl %ecx,%eax /* lo += oldhi */ addl %ecx,%eax # lo += oldhi
jae _muladdnocarry1 jae _muladdnocarry1
incl %edx /* hi += carry */ incl %edx # hi += carry
_muladdnocarry1: _muladdnocarry1:
addl %eax, (%edi, %ebp, 4) /* p[i] += lo */ addl %eax, (%edi, %ebp, 4) # p[i] += lo
jae _muladdnocarry2 jae _muladdnocarry2
incl %edx /* hi += carry */ incl %edx # hi += carry
_muladdnocarry2: _muladdnocarry2:
movl %edx, %ecx /* oldhi = hi */ movl %edx, %ecx # oldhi = hi
incl %ebp /* i++ */ incl %ebp # i++
jnz _muladdloop jnz _muladdloop
xorl %eax, %eax xorl %eax, %eax
addl %ecx, (%edi, %ebp, 4) /* p[n] + oldhi */ addl %ecx, (%edi, %ebp, 4) # p[n] + oldhi
adcl %eax, %eax /* return carry out of p[n] */ adcl %eax, %eax # return carry out of p[n]
/* Postlude */ # Postlude
popl %edi popl %edi
popl %esi popl %esi
popl %ebx popl %ebx

View file

@ -1,54 +1,54 @@
/* #
* mpvecdigmulsub(mpdigit *b, int n, mpdigit m, mpdigit *p) # mpvecdigmulsub(mpdigit *b, int n, mpdigit m, mpdigit *p)
* #
* p -= b*m # p -= b*m
* #
* each step look like: # each step look like:
* hi,lo = m*b[i] # hi,lo = m*b[i]
* lo += oldhi + carry # lo += oldhi + carry
* hi += carry # hi += carry
* p[i] += lo # p[i] += lo
* oldhi = hi # oldhi = hi
* #
* the registers are: # the registers are:
* hi = DX - constrained by hardware # hi = DX - constrained by hardware
* lo = AX - constrained by hardware # lo = AX - constrained by hardware
* b = SI - can't be BP # b = SI - can't be BP
* p = DI - can't be BP # p = DI - can't be BP
* i = BP # i = BP
* n = CX - constrained by LOOP instr # n = CX - constrained by LOOP instr
* m = BX # m = BX
* oldhi = EX # oldhi = EX
* #
*/
.text .text
.p2align 2,0x90 .p2align 2,0x90
.globl mpvecdigmulsub .globl mpvecdigmulsub
mpvecdigmulsub: mpvecdigmulsub:
/* Prelude */ # Prelude
pushl %ebp /* save on stack */ pushl %ebp # save on stack
pushl %ebx pushl %ebx
pushl %esi pushl %esi
pushl %edi pushl %edi
leal 20(%esp), %ebp /* %ebp = FP for now */ leal 20(%esp), %ebp # %ebp = FP for now
movl 0(%ebp), %esi /* b */ movl 0(%ebp), %esi # b
movl 4(%ebp), %ecx /* n */ movl 4(%ebp), %ecx # n
movl 8(%ebp), %ebx /* m */ movl 8(%ebp), %ebx # m
movl 12(%ebp), %edi /* p */ movl 12(%ebp), %edi # p
xorl %ebp, %ebp xorl %ebp, %ebp
pushl %ebp pushl %ebp
_mulsubloop: _mulsubloop:
movl (%esi, %ebp, 4),%eax /* lo = b[i] */ movl (%esi, %ebp, 4),%eax # lo = b[i]
mull %ebx /* hi, lo = b[i] * m */ mull %ebx # hi, lo = b[i] * m
addl 0(%esp), %eax /* lo += oldhi */ addl 0(%esp), %eax # lo += oldhi
jae _mulsubnocarry1 jae _mulsubnocarry1
incl %edx /* hi += carry */ incl %edx # hi += carry
_mulsubnocarry1: _mulsubnocarry1:
subl %eax, (%edi, %ebp, 4) subl %eax, (%edi, %ebp, 4)
jae _mulsubnocarry2 jae _mulsubnocarry2
incl %edx /* hi += carry */ incl %edx # hi += carry
_mulsubnocarry2: _mulsubnocarry2:
movl %edx, 0(%esp) movl %edx, 0(%esp)
incl %ebp incl %ebp
@ -61,7 +61,7 @@ _mulsubnocarry2:
_mulsubnocarry3: _mulsubnocarry3:
movl $1, %eax movl $1, %eax
done: done:
/* Postlude */ # Postlude
popl %edi popl %edi
popl %esi popl %esi
popl %ebx popl %ebx

View file

@ -158,8 +158,8 @@ _sha1block:
BODY0(0,FN1,0x5a827999,%eax,TMP1(%esp),%ecx,%edx,%esi) BODY0(0,FN1,0x5a827999,%eax,TMP1(%esp),%ecx,%edx,%esi)
addl $4, %ebx addl $4, %ebx
MOVL %ebx, DATA(%esp) /* data */ movl %ebx, DATA(%esp) /* data */
MOVL TMP1(%esp),%ebx movl TMP1(%esp),%ebx
BODY(4,FN1,0x5a827999,%esi,%eax,%ebx,%ecx,%edx) BODY(4,FN1,0x5a827999,%esi,%eax,%ebx,%ecx,%edx)
BODY(8,FN1,0x5a827999,%edx,%esi,%eax,%ebx,%ecx) BODY(8,FN1,0x5a827999,%edx,%esi,%eax,%ebx,%ecx)