1/* Kfrexpf.s 1.3 86/01/05 */ 2 3#include "../tahoe/SYS.h" 4 5 .text 6ENTRY(Kfrexpf, 0) 7 subl3 $60,fp,sp 8 clrl -60(fp) # j=0; 9 clrl -56(fp) # neg=0; 10 tstl 4(fp) # if(x<0){ 11 jgeq 1f 12 lnd 4(fp) 13 std 4(fp) # x = -x; 14 movl $1,-56(fp) # neg=1;} 151: 16 cmpd2 4(fp),one # if (x>1){ 17 jleq 1f 182: 19 cmpd2 4(fp),one # while(x>1){ 20 jleq 3f 21 addl2 $1,-60(fp) # j=j+1; 22 pushl 16(fp) # hfs 23 ldd two 24 pushd 25 ldd 4(fp) 26 pushd 27 callf $24,_Kdivd 28 ldd r0 29 std 4(fp) # x= x/2; 30 jbr 2b 311: 32 cmpd2 4(fp),half # if(x<0.5){ 33 jlss 2f 34 jbr 3f 350: 36 subl2 $1,-60(fp) # j = j-1; 37 pushl 16(fp) # hfs 38 ldd 4(fp) 39 pushd 40 ldd two 41 pushd 42 callf $24,_Kmuld 43 ldd r0 44 std 4(fp) # x = 2*x; 452: 46 cmpd2 4(fp),half # while (x<0.5){ 47 jlss 0b 483: 49 movl -60(fp),*12(fp) # *i=j; 50 tstl -56(fp) # if (neg) 51 jeql 1f 52 lnd 4(fp) 53 std 4(fp) 541: 55 ldd 4(fp) 56 cvdf 57 stf r0 58 ret 59 60 .data 61 .align 2 62one: .long 0x40800000, 0x00000000 # .double 1 63two: .long 0x41000000, 0x00000000 # .double 2 64half: .long 0x40000000, 0x00000000 # .double .5 65