- Get rid of debugging support in order to get rid of the V8-specific C
compiler frame size used there so this whole thing is V8/V9-agnostic. - Use 32-bit function alignment as GCC does when using UltraSPARC I or higher optimizations. - Don't waste delay slots when possible. Unfortunately, this still doesn't make libcompiler_rt a viable replacement for libgcc on sparc64 though as once installed instead, buildworld times increase by nearly 60% (which isn't related to these assembler functions).
This commit is contained in:
parent
edaa25bdae
commit
2040613422
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=235388
@ -59,9 +59,6 @@ define(SC,`%g2')
|
|||||||
|
|
||||||
#include "../assembly.h"
|
#include "../assembly.h"
|
||||||
|
|
||||||
.text
|
|
||||||
.align 4
|
|
||||||
|
|
||||||
define(DEVELOP_QUOTIENT_BITS,
|
define(DEVELOP_QUOTIENT_BITS,
|
||||||
` !depth $1, accumulated bits $2
|
` !depth $1, accumulated bits $2
|
||||||
bl L.$1.eval(TWOSUPN+$2)
|
bl L.$1.eval(TWOSUPN+$2)
|
||||||
@ -84,12 +81,14 @@ L.$1.eval(TWOSUPN+$2):
|
|||||||
ifelse( $1, 1, `9:')
|
ifelse( $1, 1, `9:')
|
||||||
')
|
')
|
||||||
ifelse( ANSWER, `quotient', `
|
ifelse( ANSWER, `quotient', `
|
||||||
|
.text
|
||||||
|
.align 32
|
||||||
DEFINE_COMPILERRT_FUNCTION(__udivsi3)
|
DEFINE_COMPILERRT_FUNCTION(__udivsi3)
|
||||||
save %sp,-64,%sp ! do this for debugging
|
|
||||||
b divide
|
b divide
|
||||||
mov 0,SIGN ! result always nonnegative
|
mov 0,SIGN ! result always nonnegative
|
||||||
|
.text
|
||||||
|
.align 32
|
||||||
DEFINE_COMPILERRT_FUNCTION(__divsi3)
|
DEFINE_COMPILERRT_FUNCTION(__divsi3)
|
||||||
save %sp,-64,%sp ! do this for debugging
|
|
||||||
orcc divisor,dividend,%g0 ! are either dividend or divisor negative
|
orcc divisor,dividend,%g0 ! are either dividend or divisor negative
|
||||||
bge divide ! if not, skip this junk
|
bge divide ! if not, skip this junk
|
||||||
xor divisor,dividend,SIGN ! record sign of result in sign of SIGN
|
xor divisor,dividend,SIGN ! record sign of result in sign of SIGN
|
||||||
@ -104,12 +103,14 @@ DEFINE_COMPILERRT_FUNCTION(__divsi3)
|
|||||||
neg dividend
|
neg dividend
|
||||||
! FALL THROUGH
|
! FALL THROUGH
|
||||||
',`
|
',`
|
||||||
|
.text
|
||||||
|
.align 32
|
||||||
DEFINE_COMPILERRT_FUNCTION(__umodsi3)
|
DEFINE_COMPILERRT_FUNCTION(__umodsi3)
|
||||||
save %sp,-64,%sp ! do this for debugging
|
|
||||||
b divide
|
b divide
|
||||||
mov 0,SIGN ! result always nonnegative
|
mov 0,SIGN ! result always nonnegative
|
||||||
|
.text
|
||||||
|
.align 32
|
||||||
DEFINE_COMPILERRT_FUNCTION(__modsi3)
|
DEFINE_COMPILERRT_FUNCTION(__modsi3)
|
||||||
save %sp,-64,%sp ! do this for debugging
|
|
||||||
orcc divisor,dividend,%g0 ! are either dividend or divisor negative
|
orcc divisor,dividend,%g0 ! are either dividend or divisor negative
|
||||||
bge divide ! if not, skip this junk
|
bge divide ! if not, skip this junk
|
||||||
mov dividend,SIGN ! record sign of result in sign of SIGN
|
mov dividend,SIGN ! record sign of result in sign of SIGN
|
||||||
@ -184,8 +185,8 @@ do_single_div:
|
|||||||
nop
|
nop
|
||||||
sub R,V,R
|
sub R,V,R
|
||||||
mov 1,Q
|
mov 1,Q
|
||||||
b end_single_divloop
|
b,a end_single_divloop
|
||||||
nop
|
! EMPTY
|
||||||
single_divloop:
|
single_divloop:
|
||||||
sll Q,1,Q
|
sll Q,1,Q
|
||||||
bl 1f
|
bl 1f
|
||||||
@ -202,8 +203,8 @@ single_divloop:
|
|||||||
deccc SC
|
deccc SC
|
||||||
bge single_divloop
|
bge single_divloop
|
||||||
tst R
|
tst R
|
||||||
b end_regular_divide
|
b,a end_regular_divide
|
||||||
nop
|
! EMPTY
|
||||||
|
|
||||||
not_really_big:
|
not_really_big:
|
||||||
1:
|
1:
|
||||||
@ -224,9 +225,8 @@ end_regular_divide:
|
|||||||
deccc ITER
|
deccc ITER
|
||||||
bge divloop
|
bge divloop
|
||||||
tst R
|
tst R
|
||||||
bge got_result
|
bl,a got_result
|
||||||
nop
|
! non-restoring fixup if remainder < 0, otherwise annulled
|
||||||
! non-restoring fixup here
|
|
||||||
ifelse( ANSWER, `quotient',
|
ifelse( ANSWER, `quotient',
|
||||||
` dec Q
|
` dec Q
|
||||||
',` add R,divisor,R
|
',` add R,divisor,R
|
||||||
@ -234,13 +234,11 @@ ifelse( ANSWER, `quotient',
|
|||||||
|
|
||||||
got_result:
|
got_result:
|
||||||
tst SIGN
|
tst SIGN
|
||||||
bge 1f
|
bl,a 1f
|
||||||
restore
|
! negate for answer < 0, otherwise annulled
|
||||||
! answer < 0
|
|
||||||
retl ! leaf-routine return
|
|
||||||
ifelse( ANSWER, `quotient',
|
ifelse( ANSWER, `quotient',
|
||||||
` neg %o2,%o0 ! quotient <- -Q
|
` neg %o2,%o2 ! Q <- -Q
|
||||||
',` neg %o3,%o0 ! remainder <- -R
|
',` neg %o3,%o3 ! R <- -R
|
||||||
')
|
')
|
||||||
1:
|
1:
|
||||||
retl ! leaf-routine return
|
retl ! leaf-routine return
|
||||||
|
Loading…
Reference in New Issue
Block a user