mirror of
https://github.com/golang/go
synced 2024-11-21 20:44:39 -07:00
arm: bugfixes and syscall
- integer divide by zero raises panic - float comparisons involving NaNs work - syscall interface actually handles return values and errno correctly. R=rsc, bradfitzpatrick CC=golang-dev https://golang.org/cl/1847047
This commit is contained in:
parent
c8c2bdbc59
commit
df88fc6109
@ -1044,7 +1044,16 @@ bgen(Node *n, int true, Prog *to)
|
||||
cgen(nr, &n2);
|
||||
|
||||
gcmp(optoas(OCMP, nr->type), &n1, &n2);
|
||||
patch(gbranch(a, nr->type), to);
|
||||
if(isfloat[nl->type->etype]) {
|
||||
p1 = gbranch(ABVS, nr->type);
|
||||
patch(gbranch(a, nr->type), to);
|
||||
if(n->op == ONE)
|
||||
patch(p1, to);
|
||||
else
|
||||
patch(p1, pc);
|
||||
} else {
|
||||
patch(gbranch(a, nr->type), to);
|
||||
}
|
||||
|
||||
regfree(&n1);
|
||||
regfree(&n2);
|
||||
|
@ -62,7 +62,7 @@ TEXT save<>(SB), 7, $0
|
||||
MOVW 20(FP), R(D) /* denominator */
|
||||
CMP $0, R(D)
|
||||
BNE s1
|
||||
SWI 0
|
||||
BL panicdivide(SB)
|
||||
/* MOVW -1(R(D)), R(TMP) /* divide by zero fault */
|
||||
s1: RET
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -17,9 +17,21 @@ TEXT ·Syscall(SB),7,$0
|
||||
MOVW 12(SP), R1
|
||||
MOVW 16(SP), R2
|
||||
SWI $0
|
||||
MOVW R0, 20(SP) // r1
|
||||
MOVW R1, 24(SP) // r2
|
||||
MOVW $0xfffff001, R1
|
||||
CMP R1, R0
|
||||
BLS ok
|
||||
MOVW $-1, R1
|
||||
MOVW R1, 20(SP) // r1
|
||||
MOVW $0, R2
|
||||
MOVW R2, 24(SP) // r2
|
||||
RSB $0, R0, R0
|
||||
MOVW R0, 28(SP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
ok:
|
||||
MOVW R0, 20(SP) // r1
|
||||
MOVW $0, R0
|
||||
MOVW R0, 24(SP) // r2
|
||||
MOVW R0, 28(SP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
@ -36,9 +48,21 @@ TEXT ·Syscall6(SB),7,$0
|
||||
MOVW 24(SP), R4
|
||||
MOVW 28(SP), R5
|
||||
SWI $0
|
||||
MOVW R0, 32(SP) // r1
|
||||
MOVW R1, 36(SP) // r2
|
||||
MOVW $0xfffff001, R1
|
||||
CMP R1, R0
|
||||
BLS ok6
|
||||
MOVW $-1, R1
|
||||
MOVW R1, 32(SP) // r1
|
||||
MOVW $0, R2
|
||||
MOVW R2, 36(SP) // r2
|
||||
RSB $0, R0, R0
|
||||
MOVW R0, 40(SP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
ok6:
|
||||
MOVW R0, 32(SP) // r1
|
||||
MOVW $0, R0
|
||||
MOVW R0, 36(SP) // r2
|
||||
MOVW R0, 40(SP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
@ -50,8 +74,19 @@ TEXT ·RawSyscall(SB),7,$0
|
||||
MOVW 12(SP), R1
|
||||
MOVW 16(SP), R2
|
||||
SWI $0
|
||||
MOVW R0, 20(SP) // r1
|
||||
MOVW R1, 24(SP) // r2
|
||||
MOVW $0, R0
|
||||
MOVW $0xfffff001, R1
|
||||
CMP R1, R0
|
||||
BLS ok1
|
||||
MOVW $-1, R1
|
||||
MOVW R1, 20(SP) // r1
|
||||
MOVW $0, R2
|
||||
MOVW R2, 24(SP) // r2
|
||||
RSB $0, R0, R0
|
||||
MOVW R0, 28(SP) // errno
|
||||
RET
|
||||
ok1:
|
||||
MOVW R0, 20(SP) // r1
|
||||
MOVW $0, R0
|
||||
MOVW R0, 24(SP) // r2
|
||||
MOVW R0, 28(SP) // errno
|
||||
RET
|
||||
|
@ -43,7 +43,7 @@
|
||||
./env.go
|
||||
./escape.go
|
||||
./float_lit.go
|
||||
# ./floatcmp.go # fail, BUG
|
||||
./floatcmp.go
|
||||
./for.go
|
||||
./func.go
|
||||
./func1.go
|
||||
@ -116,7 +116,7 @@
|
||||
./varerr.go
|
||||
./varinit.go
|
||||
./vectors.go
|
||||
# ./zerodivide.go # fail, BUG
|
||||
./zerodivide.go
|
||||
ken/array.go
|
||||
ken/chan.go
|
||||
ken/chan1.go
|
||||
|
Loading…
Reference in New Issue
Block a user