michael@0: ! michael@0: ! This Source Code Form is subject to the terms of the Mozilla Public michael@0: ! License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: ! file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: .section ".text",#alloc,#execinstr michael@0: .file "montmulf.c" michael@0: michael@0: .section ".rodata",#alloc michael@0: .global TwoTo16 michael@0: .align 8 michael@0: ! michael@0: ! CONSTANT POOL michael@0: ! michael@0: .global TwoTo16 michael@0: TwoTo16: michael@0: .word 1089470464 michael@0: .word 0 michael@0: .type TwoTo16,#object michael@0: .size TwoTo16,8 michael@0: .global TwoToMinus16 michael@0: ! michael@0: ! CONSTANT POOL michael@0: ! michael@0: .global TwoToMinus16 michael@0: TwoToMinus16: michael@0: .word 1055916032 michael@0: .word 0 michael@0: .type TwoToMinus16,#object michael@0: .size TwoToMinus16,8 michael@0: .global Zero michael@0: ! michael@0: ! CONSTANT POOL michael@0: ! michael@0: .global Zero michael@0: Zero: michael@0: .word 0 michael@0: .word 0 michael@0: .type Zero,#object michael@0: .size Zero,8 michael@0: .global TwoTo32 michael@0: ! michael@0: ! CONSTANT POOL michael@0: ! michael@0: .global TwoTo32 michael@0: TwoTo32: michael@0: .word 1106247680 michael@0: .word 0 michael@0: .type TwoTo32,#object michael@0: .size TwoTo32,8 michael@0: .global TwoToMinus32 michael@0: ! michael@0: ! CONSTANT POOL michael@0: ! michael@0: .global TwoToMinus32 michael@0: TwoToMinus32: michael@0: .word 1039138816 michael@0: .word 0 michael@0: .type TwoToMinus32,#object michael@0: .size TwoToMinus32,8 michael@0: michael@0: .section ".text",#alloc,#execinstr michael@0: /* 000000 0 */ .align 4 michael@0: ! michael@0: ! SUBROUTINE conv_d16_to_i32 michael@0: ! michael@0: ! OFFSET SOURCE LINE LABEL INSTRUCTION michael@0: michael@0: .global conv_d16_to_i32 michael@0: conv_d16_to_i32: michael@0: /* 000000 */ save %sp,-128,%sp michael@0: ! FILE montmulf.c michael@0: michael@0: ! 36 !#define RF_INLINE_MACROS michael@0: ! 38 !static const double TwoTo16=65536.0; michael@0: ! 39 !static const double TwoToMinus16=1.0/65536.0; michael@0: ! 40 !static const double Zero=0.0; michael@0: ! 41 !static const double TwoTo32=65536.0*65536.0; michael@0: ! 42 !static const double TwoToMinus32=1.0/(65536.0*65536.0); michael@0: ! 44 !#ifdef RF_INLINE_MACROS michael@0: ! 46 !double upper32(double); michael@0: ! 47 !double lower32(double, double); michael@0: ! 48 !double mod(double, double, double); michael@0: ! 50 !void i16_to_d16_and_d32x4(const double * /*1/(2^16)*/, michael@0: ! 51 ! const double * /* 2^16*/, michael@0: ! 52 ! const double * /* 0 */, michael@0: ! 53 ! double * /*result16*/, michael@0: ! 54 ! double * /* result32 */, michael@0: ! 55 ! float * /*source - should be unsigned int* michael@0: ! 56 ! converted to float* */); michael@0: ! 58 !#else michael@0: ! 60 !static double upper32(double x) michael@0: ! 61 !{ michael@0: ! 62 ! return floor(x*TwoToMinus32); michael@0: ! 63 !} michael@0: ! 65 !static double lower32(double x, double y) michael@0: ! 66 !{ michael@0: ! 67 ! return x-TwoTo32*floor(x*TwoToMinus32); michael@0: ! 68 !} michael@0: ! 70 !static double mod(double x, double oneoverm, double m) michael@0: ! 71 !{ michael@0: ! 72 ! return x-m*floor(x*oneoverm); michael@0: ! 73 !} michael@0: ! 75 !#endif michael@0: ! 78 !static void cleanup(double *dt, int from, int tlen) michael@0: ! 79 !{ michael@0: ! 80 ! int i; michael@0: ! 81 ! double tmp,tmp1,x,x1; michael@0: ! 83 ! tmp=tmp1=Zero; michael@0: ! 84 ! /* original code ** michael@0: ! 85 ! for(i=2*from;i<2*tlen-2;i++) michael@0: ! 86 ! { michael@0: ! 87 ! x=dt[i]; michael@0: ! 88 ! dt[i]=lower32(x,Zero)+tmp1; michael@0: ! 89 ! tmp1=tmp; michael@0: ! 90 ! tmp=upper32(x); michael@0: ! 91 ! } michael@0: ! 92 ! dt[tlen-2]+=tmp1; michael@0: ! 93 ! dt[tlen-1]+=tmp; michael@0: ! 94 ! **end original code ***/ michael@0: ! 95 ! /* new code ***/ michael@0: ! 96 ! for(i=2*from;i<2*tlen;i+=2) michael@0: ! 97 ! { michael@0: ! 98 ! x=dt[i]; michael@0: ! 99 ! x1=dt[i+1]; michael@0: ! 100 ! dt[i]=lower32(x,Zero)+tmp; michael@0: ! 101 ! dt[i+1]=lower32(x1,Zero)+tmp1; michael@0: ! 102 ! tmp=upper32(x); michael@0: ! 103 ! tmp1=upper32(x1); michael@0: ! 104 ! } michael@0: ! 105 ! /** end new code **/ michael@0: ! 106 !} michael@0: ! 109 !void conv_d16_to_i32(unsigned int *i32, double *d16, long long *tmp, int ilen) michael@0: ! 110 !{ michael@0: ! 111 !int i; michael@0: ! 112 !long long t, t1, a, b, c, d; michael@0: ! 114 ! t1=0; michael@0: ! 115 ! a=(long long)d16[0]; michael@0: michael@0: /* 0x0004 115 */ ldd [%i1],%f0 michael@0: /* 0x0008 110 */ or %g0,%i1,%o0 michael@0: michael@0: ! 116 ! b=(long long)d16[1]; michael@0: ! 117 ! for(i=0; i>32); michael@0: ! 122 ! d=(long long)d16[2*i+3]; michael@0: ! 123 ! t1+=(b&0xffff)<<16; michael@0: ! 124 ! t+=(b>>16)+(t1>>32); michael@0: ! 125 ! i32[i]=t1&0xffffffff; michael@0: ! 126 ! t1=t; michael@0: ! 127 ! a=c; michael@0: ! 128 ! b=d; michael@0: michael@0: /* 0x0070 128 */ add %o0,16,%g2 michael@0: /* 0x0074 123 */ and %g1,%o1,%o0 michael@0: /* 0x0078 */ sllx %o0,16,%g3 michael@0: /* 0x007c 120 */ and %g4,%o3,%o0 michael@0: /* 0x0080 117 */ add %o0,%g3,%o4 michael@0: /* 0x0084 119 */ fdtox %f0,%f0 michael@0: /* 0x0088 */ std %f0,[%sp+104] michael@0: /* 0x008c 125 */ and %o4,%o3,%g5 michael@0: /* 0x0090 122 */ ldd [%g2+8],%f2 michael@0: /* 0x0094 128 */ add %o5,4,%o5 michael@0: /* 0x0098 124 */ srax %o4,32,%o4 michael@0: /* 0x009c */ stx %o4,[%sp+112] michael@0: /* 0x00a0 122 */ fdtox %f2,%f0 michael@0: /* 0x00a4 */ std %f0,[%sp+96] michael@0: /* 0x00a8 124 */ srax %g1,16,%o0 michael@0: /* 0x00ac */ ldx [%sp+112],%o7 michael@0: /* 0x00b0 121 */ srax %g4,32,%o4 michael@0: /* 0x00b4 124 */ add %o0,%o7,%g4 michael@0: /* 0x00b8 128 */ or %g0,1,%o7 michael@0: /* 0x00bc 119 */ ldx [%sp+104],%g3 michael@0: /* 0x00c0 124 */ add %o4,%g4,%o4 michael@0: /* 0x00c4 122 */ ldx [%sp+96],%g1 michael@0: /* 0x00c8 125 */ st %g5,[%o5-4] michael@0: /* 0x00cc 127 */ or %g0,%g3,%g4 michael@0: .L900000112: michael@0: /* 0x00d0 119 */ ldd [%g2+16],%f0 michael@0: /* 0x00d4 128 */ add %o7,1,%o7 michael@0: /* 0x00d8 */ add %o5,4,%o5 michael@0: /* 0x00dc */ cmp %o7,%o2 michael@0: /* 0x00e0 */ add %g2,16,%g2 michael@0: /* 0x00e4 119 */ fdtox %f0,%f0 michael@0: /* 0x00e8 */ std %f0,[%sp+104] michael@0: /* 0x00ec 122 */ ldd [%g2+8],%f0 michael@0: /* 0x00f0 */ fdtox %f0,%f0 michael@0: /* 0x00f4 */ std %f0,[%sp+96] michael@0: /* 0x00f8 123 */ and %g1,%o1,%g3 michael@0: /* 0x00fc */ sllx %g3,16,%g5 michael@0: /* 0x0100 120 */ and %g4,%o3,%g3 michael@0: /* 0x0104 117 */ add %g3,%g5,%g3 michael@0: /* 0x0108 124 */ srax %g1,16,%g1 michael@0: /* 0x010c 117 */ add %g3,%o4,%g3 michael@0: /* 0x0110 124 */ srax %g3,32,%o4 michael@0: /* 0x0114 */ stx %o4,[%sp+112] michael@0: /* 0x0118 119 */ ldx [%sp+104],%g5 michael@0: /* 0x011c 121 */ srax %g4,32,%o4 michael@0: /* 0x0120 124 */ ldx [%sp+112],%g4 michael@0: /* 0x0124 */ add %g1,%g4,%g4 michael@0: /* 0x0128 122 */ ldx [%sp+96],%g1 michael@0: /* 0x012c 124 */ add %o4,%g4,%o4 michael@0: /* 0x0130 125 */ and %g3,%o3,%g3 michael@0: /* 0x0134 127 */ or %g0,%g5,%g4 michael@0: /* 0x0138 128 */ ble,pt %icc,.L900000112 michael@0: /* 0x013c */ st %g3,[%o5-4] michael@0: .L900000115: michael@0: /* 0x0140 128 */ ba .L900000117 michael@0: /* 0x0144 */ sethi %hi(0xfc00),%g2 michael@0: .L77000134: michael@0: /* 0x0148 119 */ ldd [%g2+16],%f0 michael@0: .L900000116: michael@0: /* 0x014c 120 */ and %g4,%o3,%o0 michael@0: /* 0x0150 123 */ and %g1,%o1,%g3 michael@0: /* 0x0154 119 */ fdtox %f0,%f0 michael@0: /* 0x0158 120 */ add %o4,%o0,%o0 michael@0: /* 0x015c 119 */ std %f0,[%sp+104] michael@0: /* 0x0160 128 */ add %o7,1,%o7 michael@0: /* 0x0164 123 */ sllx %g3,16,%o4 michael@0: /* 0x0168 122 */ ldd [%g2+24],%f2 michael@0: /* 0x016c 128 */ add %g2,16,%g2 michael@0: /* 0x0170 123 */ add %o0,%o4,%o0 michael@0: /* 0x0174 128 */ cmp %o7,%o2 michael@0: /* 0x0178 125 */ and %o0,%o3,%g3 michael@0: /* 0x017c 122 */ fdtox %f2,%f0 michael@0: /* 0x0180 */ std %f0,[%sp+96] michael@0: /* 0x0184 124 */ srax %o0,32,%o0 michael@0: /* 0x0188 */ stx %o0,[%sp+112] michael@0: /* 0x018c 121 */ srax %g4,32,%o4 michael@0: /* 0x0190 122 */ ldx [%sp+96],%o0 michael@0: /* 0x0194 124 */ srax %g1,16,%g5 michael@0: /* 0x0198 */ ldx [%sp+112],%g4 michael@0: /* 0x019c 119 */ ldx [%sp+104],%g1 michael@0: /* 0x01a0 125 */ st %g3,[%o5] michael@0: /* 0x01a4 124 */ add %g5,%g4,%g4 michael@0: /* 0x01a8 128 */ add %o5,4,%o5 michael@0: /* 0x01ac 124 */ add %o4,%g4,%o4 michael@0: /* 0x01b0 127 */ or %g0,%g1,%g4 michael@0: /* 0x01b4 128 */ or %g0,%o0,%g1 michael@0: /* 0x01b8 */ ble,a,pt %icc,.L900000116 michael@0: /* 0x01bc */ ldd [%g2+16],%f0 michael@0: .L77000127: michael@0: michael@0: ! 129 ! } michael@0: ! 130 ! t1+=a&0xffffffff; michael@0: ! 131 ! t=(a>>32); michael@0: ! 132 ! t1+=(b&0xffff)<<16; michael@0: ! 133 ! i32[i]=t1&0xffffffff; michael@0: michael@0: /* 0x01c0 133 */ sethi %hi(0xfc00),%g2 michael@0: .L900000117: michael@0: /* 0x01c4 133 */ or %g0,-1,%g3 michael@0: /* 0x01c8 */ add %g2,1023,%g2 michael@0: /* 0x01cc */ srl %g3,0,%g3 michael@0: /* 0x01d0 */ and %g1,%g2,%g2 michael@0: /* 0x01d4 */ and %g4,%g3,%g4 michael@0: /* 0x01d8 */ sllx %g2,16,%g2 michael@0: /* 0x01dc */ add %o4,%g4,%g4 michael@0: /* 0x01e0 */ add %g4,%g2,%g2 michael@0: /* 0x01e4 */ sll %o7,2,%g4 michael@0: /* 0x01e8 */ and %g2,%g3,%g2 michael@0: /* 0x01ec */ st %g2,[%i0+%g4] michael@0: /* 0x01f0 */ ret ! Result = michael@0: /* 0x01f4 */ restore %g0,%g0,%g0 michael@0: /* 0x01f8 0 */ .type conv_d16_to_i32,2 michael@0: /* 0x01f8 */ .size conv_d16_to_i32,(.-conv_d16_to_i32) michael@0: michael@0: .section ".text",#alloc,#execinstr michael@0: /* 000000 0 */ .align 8 michael@0: ! michael@0: ! CONSTANT POOL michael@0: ! michael@0: .L_const_seg_900000201: michael@0: /* 000000 0 */ .word 1127219200,0 michael@0: /* 0x0008 0 */ .align 4 michael@0: /* 0x0008 */ .skip 16 michael@0: ! michael@0: ! SUBROUTINE conv_i32_to_d32 michael@0: ! michael@0: ! OFFSET SOURCE LINE LABEL INSTRUCTION michael@0: michael@0: .global conv_i32_to_d32 michael@0: conv_i32_to_d32: michael@0: /* 000000 */ or %g0,%o7,%g2 michael@0: michael@0: ! 135 !} michael@0: ! 137 !void conv_i32_to_d32(double *d32, unsigned int *i32, int len) michael@0: ! 138 !{ michael@0: ! 139 !int i; michael@0: ! 141 !#pragma pipeloop(0) michael@0: ! 142 ! for(i=0;i>16); michael@0: michael@0: /* 0x0008 156 */ sethi %hi(.L_const_seg_900000301),%g2 michael@0: .L900000310: michael@0: /* 0x000c */ call .+8 michael@0: /* 0x0010 */ sethi /*X*/%hi(_GLOBAL_OFFSET_TABLE_-(.L900000310-.)),%g3 michael@0: /* 0x0014 152 */ cmp %o0,0 michael@0: /* 0x0018 147 */ add %g3,/*X*/%lo(_GLOBAL_OFFSET_TABLE_-(.L900000310-.)),%g3 michael@0: /* 0x001c 152 */ ble,pt %icc,.L77000150 michael@0: /* 0x0020 */ add %g3,%o7,%o2 michael@0: /* 0x0024 */ sub %i2,1,%o5 michael@0: /* 0x0028 156 */ add %g2,%lo(.L_const_seg_900000301),%o1 michael@0: /* 0x002c 152 */ sethi %hi(0xfc00),%o0 michael@0: /* 0x0030 */ ld [%o2+%o1],%o3 michael@0: /* 0x0034 */ add %o5,1,%g2 michael@0: /* 0x0038 */ or %g0,0,%g1 michael@0: /* 0x003c */ cmp %g2,3 michael@0: /* 0x0040 */ or %g0,%i1,%o7 michael@0: /* 0x0044 */ add %o0,1023,%o4 michael@0: /* 0x0048 */ or %g0,%i0,%g3 michael@0: /* 0x004c */ bl,pn %icc,.L77000154 michael@0: /* 0x0050 */ add %o7,4,%o0 michael@0: /* 0x0054 155 */ ldd [%o3],%f0 michael@0: /* 0x0058 156 */ or %g0,1,%g1 michael@0: /* 0x005c 154 */ ld [%o0-4],%o1 michael@0: /* 0x0060 0 */ or %g0,%o0,%o7 michael@0: /* 0x0064 155 */ and %o1,%o4,%o0 michael@0: .L900000306: michael@0: /* 0x0068 155 */ st %o0,[%sp+96] michael@0: /* 0x006c 156 */ add %g1,1,%g1 michael@0: /* 0x0070 */ add %g3,16,%g3 michael@0: /* 0x0074 */ cmp %g1,%o5 michael@0: /* 0x0078 */ add %o7,4,%o7 michael@0: /* 0x007c 155 */ ld [%sp+96],%f3 michael@0: /* 0x0080 */ fmovs %f0,%f2 michael@0: /* 0x0084 */ fsubd %f2,%f0,%f2 michael@0: /* 0x0088 156 */ srl %o1,16,%o0 michael@0: /* 0x008c 155 */ std %f2,[%g3-16] michael@0: /* 0x0090 156 */ st %o0,[%sp+92] michael@0: /* 0x0094 */ ld [%sp+92],%f3 michael@0: /* 0x0098 154 */ ld [%o7-4],%o1 michael@0: /* 0x009c 156 */ fmovs %f0,%f2 michael@0: /* 0x00a0 */ fsubd %f2,%f0,%f2 michael@0: /* 0x00a4 155 */ and %o1,%o4,%o0 michael@0: /* 0x00a8 156 */ ble,pt %icc,.L900000306 michael@0: /* 0x00ac */ std %f2,[%g3-8] michael@0: .L900000309: michael@0: /* 0x00b0 155 */ st %o0,[%sp+96] michael@0: /* 0x00b4 */ fmovs %f0,%f2 michael@0: /* 0x00b8 156 */ add %g3,16,%g3 michael@0: /* 0x00bc */ srl %o1,16,%o0 michael@0: /* 0x00c0 155 */ ld [%sp+96],%f3 michael@0: /* 0x00c4 */ fsubd %f2,%f0,%f2 michael@0: /* 0x00c8 */ std %f2,[%g3-16] michael@0: /* 0x00cc 156 */ st %o0,[%sp+92] michael@0: /* 0x00d0 */ fmovs %f0,%f2 michael@0: /* 0x00d4 */ ld [%sp+92],%f3 michael@0: /* 0x00d8 */ fsubd %f2,%f0,%f0 michael@0: /* 0x00dc */ std %f0,[%g3-8] michael@0: /* 0x00e0 */ ret ! Result = michael@0: /* 0x00e4 */ restore %g0,%g0,%g0 michael@0: .L77000154: michael@0: /* 0x00e8 154 */ ld [%o7],%o0 michael@0: .L900000311: michael@0: /* 0x00ec 155 */ and %o0,%o4,%o1 michael@0: /* 0x00f0 */ st %o1,[%sp+96] michael@0: /* 0x00f4 156 */ add %g1,1,%g1 michael@0: /* 0x00f8 155 */ ldd [%o3],%f0 michael@0: /* 0x00fc 156 */ srl %o0,16,%o0 michael@0: /* 0x0100 */ add %o7,4,%o7 michael@0: /* 0x0104 */ cmp %g1,%o5 michael@0: /* 0x0108 155 */ fmovs %f0,%f2 michael@0: /* 0x010c */ ld [%sp+96],%f3 michael@0: /* 0x0110 */ fsubd %f2,%f0,%f2 michael@0: /* 0x0114 */ std %f2,[%g3] michael@0: /* 0x0118 156 */ st %o0,[%sp+92] michael@0: /* 0x011c */ fmovs %f0,%f2 michael@0: /* 0x0120 */ ld [%sp+92],%f3 michael@0: /* 0x0124 */ fsubd %f2,%f0,%f0 michael@0: /* 0x0128 */ std %f0,[%g3+8] michael@0: /* 0x012c */ add %g3,16,%g3 michael@0: /* 0x0130 */ ble,a,pt %icc,.L900000311 michael@0: /* 0x0134 */ ld [%o7],%o0 michael@0: .L77000150: michael@0: /* 0x0138 */ ret ! Result = michael@0: /* 0x013c */ restore %g0,%g0,%g0 michael@0: /* 0x0140 0 */ .type conv_i32_to_d16,2 michael@0: /* 0x0140 */ .size conv_i32_to_d16,(.-conv_i32_to_d16) michael@0: michael@0: .section ".text",#alloc,#execinstr michael@0: /* 000000 0 */ .align 8 michael@0: ! michael@0: ! CONSTANT POOL michael@0: ! michael@0: .L_const_seg_900000401: michael@0: /* 000000 0 */ .word 1127219200,0 michael@0: /* 0x0008 0 */ .align 4 michael@0: /* 0x0008 */ .skip 16 michael@0: ! michael@0: ! SUBROUTINE conv_i32_to_d32_and_d16 michael@0: ! michael@0: ! OFFSET SOURCE LINE LABEL INSTRUCTION michael@0: michael@0: .global conv_i32_to_d32_and_d16 michael@0: conv_i32_to_d32_and_d16: michael@0: /* 000000 */ save %sp,-120,%sp michael@0: .L900000415: michael@0: /* 0x0004 */ call .+8 michael@0: /* 0x0008 */ sethi /*X*/%hi(_GLOBAL_OFFSET_TABLE_-(.L900000415-.)),%g4 michael@0: michael@0: ! 157 ! } michael@0: ! 158 !} michael@0: ! 161 !void conv_i32_to_d32_and_d16(double *d32, double *d16, michael@0: ! 162 ! unsigned int *i32, int len) michael@0: ! 163 !{ michael@0: ! 164 !int i = 0; michael@0: ! 165 !unsigned int a; michael@0: ! 167 !#pragma pipeloop(0) michael@0: ! 168 !#ifdef RF_INLINE_MACROS michael@0: ! 169 ! for(;i>16); michael@0: michael@0: /* 0x0158 180 */ sethi %hi(.L_const_seg_900000401),%g2 michael@0: /* 0x015c */ add %g2,%lo(.L_const_seg_900000401),%o1 michael@0: /* 0x0160 175 */ sethi %hi(0xfc00),%o0 michael@0: /* 0x0164 */ ld [%o4+%o1],%o2 michael@0: /* 0x0168 */ sll %g5,2,%o3 michael@0: /* 0x016c */ sub %i3,%g5,%g3 michael@0: /* 0x0170 */ sll %g5,3,%g2 michael@0: /* 0x0174 */ add %o0,1023,%o4 michael@0: /* 0x0178 178 */ ldd [%o2],%f0 michael@0: /* 0x017c */ add %i2,%o3,%o0 michael@0: /* 0x0180 175 */ cmp %g3,3 michael@0: /* 0x0184 */ add %i4,%g2,%o3 michael@0: /* 0x0188 */ sub %i3,1,%o1 michael@0: /* 0x018c */ sll %g5,4,%g4 michael@0: /* 0x0190 */ bl,pn %icc,.L77000161 michael@0: /* 0x0194 */ add %i1,%g4,%o5 michael@0: /* 0x0198 178 */ ld [%o0],%f3 michael@0: /* 0x019c 180 */ add %o3,8,%o3 michael@0: /* 0x01a0 177 */ ld [%o0],%o7 michael@0: /* 0x01a4 180 */ add %o5,16,%o5 michael@0: /* 0x01a8 */ add %g5,1,%g5 michael@0: /* 0x01ac 178 */ fmovs %f0,%f2 michael@0: /* 0x01b0 180 */ add %o0,4,%o0 michael@0: /* 0x01b4 179 */ and %o7,%o4,%g1 michael@0: /* 0x01b8 178 */ fsubd %f2,%f0,%f2 michael@0: /* 0x01bc */ std %f2,[%o3-8] michael@0: /* 0x01c0 180 */ srl %o7,16,%o7 michael@0: /* 0x01c4 179 */ st %g1,[%sp+96] michael@0: /* 0x01c8 */ fmovs %f0,%f2 michael@0: /* 0x01cc */ ld [%sp+96],%f3 michael@0: /* 0x01d0 */ fsubd %f2,%f0,%f2 michael@0: /* 0x01d4 */ std %f2,[%o5-16] michael@0: /* 0x01d8 180 */ st %o7,[%sp+92] michael@0: /* 0x01dc */ fmovs %f0,%f2 michael@0: /* 0x01e0 */ ld [%sp+92],%f3 michael@0: /* 0x01e4 */ fsubd %f2,%f0,%f2 michael@0: /* 0x01e8 */ std %f2,[%o5-8] michael@0: .L900000411: michael@0: /* 0x01ec 178 */ ld [%o0],%f3 michael@0: /* 0x01f0 180 */ add %g5,2,%g5 michael@0: /* 0x01f4 */ add %o5,32,%o5 michael@0: /* 0x01f8 177 */ ld [%o0],%o7 michael@0: /* 0x01fc 180 */ cmp %g5,%o1 michael@0: /* 0x0200 */ add %o3,16,%o3 michael@0: /* 0x0204 178 */ fmovs %f0,%f2 michael@0: /* 0x0208 */ fsubd %f2,%f0,%f2 michael@0: /* 0x020c */ std %f2,[%o3-16] michael@0: /* 0x0210 179 */ and %o7,%o4,%g1 michael@0: /* 0x0214 */ st %g1,[%sp+96] michael@0: /* 0x0218 */ ld [%sp+96],%f3 michael@0: /* 0x021c */ fmovs %f0,%f2 michael@0: /* 0x0220 */ fsubd %f2,%f0,%f2 michael@0: /* 0x0224 180 */ srl %o7,16,%o7 michael@0: /* 0x0228 179 */ std %f2,[%o5-32] michael@0: /* 0x022c 180 */ st %o7,[%sp+92] michael@0: /* 0x0230 */ ld [%sp+92],%f3 michael@0: /* 0x0234 */ fmovs %f0,%f2 michael@0: /* 0x0238 */ fsubd %f2,%f0,%f2 michael@0: /* 0x023c */ std %f2,[%o5-24] michael@0: /* 0x0240 */ add %o0,4,%o0 michael@0: /* 0x0244 178 */ ld [%o0],%f3 michael@0: /* 0x0248 177 */ ld [%o0],%o7 michael@0: /* 0x024c 178 */ fmovs %f0,%f2 michael@0: /* 0x0250 */ fsubd %f2,%f0,%f2 michael@0: /* 0x0254 */ std %f2,[%o3-8] michael@0: /* 0x0258 179 */ and %o7,%o4,%g1 michael@0: /* 0x025c */ st %g1,[%sp+96] michael@0: /* 0x0260 */ ld [%sp+96],%f3 michael@0: /* 0x0264 */ fmovs %f0,%f2 michael@0: /* 0x0268 */ fsubd %f2,%f0,%f2 michael@0: /* 0x026c 180 */ srl %o7,16,%o7 michael@0: /* 0x0270 179 */ std %f2,[%o5-16] michael@0: /* 0x0274 180 */ st %o7,[%sp+92] michael@0: /* 0x0278 */ ld [%sp+92],%f3 michael@0: /* 0x027c */ fmovs %f0,%f2 michael@0: /* 0x0280 */ fsubd %f2,%f0,%f2 michael@0: /* 0x0284 */ std %f2,[%o5-8] michael@0: /* 0x0288 */ bl,pt %icc,.L900000411 michael@0: /* 0x028c */ add %o0,4,%o0 michael@0: .L900000414: michael@0: /* 0x0290 180 */ cmp %g5,%i3 michael@0: /* 0x0294 */ bge,pn %icc,.L77000164 michael@0: /* 0x0298 */ nop michael@0: .L77000161: michael@0: /* 0x029c 178 */ ld [%o0],%f3 michael@0: .L900000416: michael@0: /* 0x02a0 178 */ ldd [%o2],%f0 michael@0: /* 0x02a4 180 */ add %g5,1,%g5 michael@0: /* 0x02a8 177 */ ld [%o0],%o1 michael@0: /* 0x02ac 180 */ add %o0,4,%o0 michael@0: /* 0x02b0 */ cmp %g5,%i3 michael@0: /* 0x02b4 178 */ fmovs %f0,%f2 michael@0: /* 0x02b8 179 */ and %o1,%o4,%o7 michael@0: /* 0x02bc 178 */ fsubd %f2,%f0,%f2 michael@0: /* 0x02c0 */ std %f2,[%o3] michael@0: /* 0x02c4 180 */ srl %o1,16,%o1 michael@0: /* 0x02c8 179 */ st %o7,[%sp+96] michael@0: /* 0x02cc 180 */ add %o3,8,%o3 michael@0: /* 0x02d0 179 */ fmovs %f0,%f2 michael@0: /* 0x02d4 */ ld [%sp+96],%f3 michael@0: /* 0x02d8 */ fsubd %f2,%f0,%f2 michael@0: /* 0x02dc */ std %f2,[%o5] michael@0: /* 0x02e0 180 */ st %o1,[%sp+92] michael@0: /* 0x02e4 */ fmovs %f0,%f2 michael@0: /* 0x02e8 */ ld [%sp+92],%f3 michael@0: /* 0x02ec */ fsubd %f2,%f0,%f0 michael@0: /* 0x02f0 */ std %f0,[%o5+8] michael@0: /* 0x02f4 */ add %o5,16,%o5 michael@0: /* 0x02f8 */ bl,a,pt %icc,.L900000416 michael@0: /* 0x02fc */ ld [%o0],%f3 michael@0: .L77000164: michael@0: /* 0x0300 */ ret ! Result = michael@0: /* 0x0304 */ restore %g0,%g0,%g0 michael@0: /* 0x0308 0 */ .type conv_i32_to_d32_and_d16,2 michael@0: /* 0x0308 */ .size conv_i32_to_d32_and_d16,(.-conv_i32_to_d32_and_d16) michael@0: michael@0: .section ".text",#alloc,#execinstr michael@0: /* 000000 0 */ .align 4 michael@0: ! michael@0: ! SUBROUTINE adjust_montf_result michael@0: ! michael@0: ! OFFSET SOURCE LINE LABEL INSTRUCTION michael@0: michael@0: .global adjust_montf_result michael@0: adjust_montf_result: michael@0: /* 000000 */ or %g0,%o2,%g5 michael@0: michael@0: ! 181 ! } michael@0: ! 182 !} michael@0: ! 185 !void adjust_montf_result(unsigned int *i32, unsigned int *nint, int len) michael@0: ! 186 !{ michael@0: ! 187 !long long acc; michael@0: ! 188 !int i; michael@0: ! 190 ! if(i32[len]>0) i=-1; michael@0: michael@0: /* 0x0004 190 */ or %g0,-1,%g4 michael@0: /* 0x0008 */ sll %o2,2,%g1 michael@0: /* 0x000c */ ld [%o0+%g1],%g1 michael@0: /* 0x0010 */ cmp %g1,0 michael@0: /* 0x0014 */ bleu,pn %icc,.L77000175 michael@0: /* 0x0018 */ or %g0,%o1,%o3 michael@0: /* 0x001c */ ba .L900000511 michael@0: /* 0x0020 */ cmp %g4,0 michael@0: .L77000175: michael@0: michael@0: ! 191 ! else michael@0: ! 192 ! { michael@0: ! 193 ! for(i=len-1; i>=0; i--) michael@0: michael@0: /* 0x0024 193 */ sub %o2,1,%g4 michael@0: /* 0x0028 */ sll %g4,2,%g1 michael@0: /* 0x002c */ cmp %g4,0 michael@0: /* 0x0030 */ bl,pt %icc,.L900000511 michael@0: /* 0x0034 */ cmp %g4,0 michael@0: /* 0x0038 */ add %o1,%g1,%g2 michael@0: michael@0: ! 194 ! { michael@0: ! 195 ! if(i32[i]!=nint[i]) break; michael@0: michael@0: /* 0x003c 195 */ ld [%g2],%o5 michael@0: /* 0x0040 193 */ add %o0,%g1,%g3 michael@0: .L900000510: michael@0: /* 0x0044 195 */ ld [%g3],%o2 michael@0: /* 0x0048 */ sub %g4,1,%g1 michael@0: /* 0x004c */ sub %g2,4,%g2 michael@0: /* 0x0050 */ sub %g3,4,%g3 michael@0: /* 0x0054 */ cmp %o2,%o5 michael@0: /* 0x0058 */ bne,pn %icc,.L77000182 michael@0: /* 0x005c */ nop michael@0: /* 0x0060 0 */ or %g0,%g1,%g4 michael@0: /* 0x0064 195 */ cmp %g1,0 michael@0: /* 0x0068 */ bge,a,pt %icc,.L900000510 michael@0: /* 0x006c */ ld [%g2],%o5 michael@0: .L77000182: michael@0: michael@0: ! 196 ! } michael@0: ! 197 ! } michael@0: ! 198 ! if((i<0)||(i32[i]>nint[i])) michael@0: michael@0: /* 0x0070 198 */ cmp %g4,0 michael@0: .L900000511: michael@0: /* 0x0074 198 */ bl,pn %icc,.L77000198 michael@0: /* 0x0078 */ sll %g4,2,%g2 michael@0: /* 0x007c */ ld [%o1+%g2],%g1 michael@0: /* 0x0080 */ ld [%o0+%g2],%g2 michael@0: /* 0x0084 */ cmp %g2,%g1 michael@0: /* 0x0088 */ bleu,pt %icc,.L77000191 michael@0: /* 0x008c */ nop michael@0: .L77000198: michael@0: michael@0: ! 199 ! { michael@0: ! 200 ! acc=0; michael@0: ! 201 ! for(i=0;i>32; michael@0: michael@0: /* 0x00dc 205 */ or %g0,2,%o5 michael@0: /* 0x00e0 201 */ sub %o2,%o1,%o2 michael@0: /* 0x00e4 */ or %g0,%o2,%g5 michael@0: /* 0x00e8 204 */ and %o2,%g3,%o2 michael@0: /* 0x00ec */ st %o2,[%o0] michael@0: /* 0x00f0 205 */ srax %g5,32,%g5 michael@0: .L900000505: michael@0: /* 0x00f4 203 */ ld [%o3],%o2 michael@0: /* 0x00f8 205 */ add %o5,1,%o5 michael@0: /* 0x00fc */ add %o3,4,%o3 michael@0: /* 0x0100 */ cmp %o5,%g4 michael@0: /* 0x0104 */ add %o4,4,%o4 michael@0: /* 0x0108 201 */ sub %g1,%o2,%g1 michael@0: /* 0x010c */ add %g1,%g5,%g5 michael@0: /* 0x0110 204 */ and %g5,%g3,%o2 michael@0: /* 0x0114 203 */ ld [%o4-4],%g1 michael@0: /* 0x0118 204 */ st %o2,[%o4-8] michael@0: /* 0x011c 205 */ ble,pt %icc,.L900000505 michael@0: /* 0x0120 */ srax %g5,32,%g5 michael@0: .L900000508: michael@0: /* 0x0124 203 */ ld [%o3],%g2 michael@0: /* 0x0128 201 */ sub %g1,%g2,%g1 michael@0: /* 0x012c */ add %g1,%g5,%g1 michael@0: /* 0x0130 204 */ and %g1,%g3,%g2 michael@0: /* 0x0134 */ retl ! Result = michael@0: /* 0x0138 */ st %g2,[%o4-4] michael@0: .L77000199: michael@0: /* 0x013c 203 */ ld [%o4],%g1 michael@0: .L900000509: michael@0: /* 0x0140 203 */ ld [%o3],%g2 michael@0: /* 0x0144 */ add %g5,%g1,%g1 michael@0: /* 0x0148 205 */ add %o5,1,%o5 michael@0: /* 0x014c */ add %o3,4,%o3 michael@0: /* 0x0150 */ cmp %o5,%g4 michael@0: /* 0x0154 203 */ sub %g1,%g2,%g1 michael@0: /* 0x0158 204 */ and %g1,%g3,%g2 michael@0: /* 0x015c */ st %g2,[%o4] michael@0: /* 0x0160 205 */ add %o4,4,%o4 michael@0: /* 0x0164 */ srax %g1,32,%g5 michael@0: /* 0x0168 */ ble,a,pt %icc,.L900000509 michael@0: /* 0x016c */ ld [%o4],%g1 michael@0: .L77000191: michael@0: /* 0x0170 */ retl ! Result = michael@0: /* 0x0174 */ nop michael@0: /* 0x0178 0 */ .type adjust_montf_result,2 michael@0: /* 0x0178 */ .size adjust_montf_result,(.-adjust_montf_result) michael@0: michael@0: .section ".text",#alloc,#execinstr michael@0: /* 000000 0 */ .align 4 michael@0: /* 000000 */ .skip 16 michael@0: ! michael@0: ! SUBROUTINE mont_mulf_noconv michael@0: ! michael@0: ! OFFSET SOURCE LINE LABEL INSTRUCTION michael@0: michael@0: .global mont_mulf_noconv michael@0: mont_mulf_noconv: michael@0: /* 000000 */ save %sp,-144,%sp michael@0: .L900000646: michael@0: /* 0x0004 */ call .+8 michael@0: /* 0x0008 */ sethi /*X*/%hi(_GLOBAL_OFFSET_TABLE_-(.L900000646-.)),%g5 michael@0: michael@0: ! 206 ! } michael@0: ! 207 ! } michael@0: ! 208 !} michael@0: ! 213 !/* michael@0: ! 214 !** the lengths of the input arrays should be at least the following: michael@0: ! 215 !** result[nlen+1], dm1[nlen], dm2[2*nlen+1], dt[4*nlen+2], dn[nlen], nint[nlen] michael@0: ! 216 !** all of them should be different from one another michael@0: ! 217 !** michael@0: ! 218 !*/ michael@0: ! 219 !void mont_mulf_noconv(unsigned int *result, michael@0: ! 220 ! double *dm1, double *dm2, double *dt, michael@0: ! 221 ! double *dn, unsigned int *nint, michael@0: ! 222 ! int nlen, double dn0) michael@0: ! 223 !{ michael@0: ! 224 ! int i, j, jj; michael@0: ! 225 ! int tmp; michael@0: ! 226 ! double digit, m2j, nextm2j, a, b; michael@0: ! 227 ! double *dptmp, *pdm1, *pdm2, *pdn, *pdtj, pdn_0, pdm1_0; michael@0: ! 229 ! pdm1=&(dm1[0]); michael@0: ! 230 ! pdm2=&(dm2[0]); michael@0: ! 231 ! pdn=&(dn[0]); michael@0: ! 232 ! pdm2[2*nlen]=Zero; michael@0: michael@0: /* 0x000c 232 */ ld [%fp+92],%o1 michael@0: /* 0x0010 */ sethi %hi(Zero),%g2 michael@0: /* 0x0014 223 */ ldd [%fp+96],%f2 michael@0: /* 0x0018 */ add %g5,/*X*/%lo(_GLOBAL_OFFSET_TABLE_-(.L900000646-.)),%g5 michael@0: /* 0x001c 232 */ add %g2,%lo(Zero),%g2 michael@0: /* 0x0020 223 */ st %i0,[%fp+68] michael@0: /* 0x0024 */ add %g5,%o7,%o3 michael@0: michael@0: ! 234 ! if (nlen!=16) michael@0: ! 235 ! { michael@0: ! 236 ! for(i=0;i<4*nlen+2;i++) dt[i]=Zero; michael@0: ! 238 ! a=dt[0]=pdm1[0]*pdm2[0]; michael@0: ! 239 ! digit=mod(lower32(a,Zero)*dn0,TwoToMinus16,TwoTo16); michael@0: michael@0: /* 0x0028 239 */ sethi %hi(TwoToMinus16),%g3 michael@0: /* 0x002c 232 */ ld [%o3+%g2],%l0 michael@0: /* 0x0030 239 */ sethi %hi(TwoTo16),%g4 michael@0: /* 0x0034 223 */ or %g0,%i2,%o2 michael@0: /* 0x0038 */ fmovd %f2,%f16 michael@0: /* 0x003c */ st %i5,[%fp+88] michael@0: /* 0x0040 239 */ add %g3,%lo(TwoToMinus16),%g2 michael@0: /* 0x0044 223 */ or %g0,%i1,%i2 michael@0: /* 0x0048 232 */ ldd [%l0],%f0 michael@0: /* 0x004c 239 */ add %g4,%lo(TwoTo16),%g3 michael@0: /* 0x0050 223 */ or %g0,%i3,%o0 michael@0: /* 0x0054 232 */ sll %o1,4,%g4 michael@0: /* 0x0058 239 */ ld [%o3+%g2],%g5 michael@0: /* 0x005c 223 */ or %g0,%i3,%i1 michael@0: /* 0x0060 239 */ ld [%o3+%g3],%g1 michael@0: /* 0x0064 232 */ or %g0,%o1,%i0 michael@0: /* 0x0068 */ or %g0,%o2,%i3 michael@0: /* 0x006c 234 */ cmp %o1,16 michael@0: /* 0x0070 */ be,pn %icc,.L77000279 michael@0: /* 0x0074 */ std %f0,[%o2+%g4] michael@0: /* 0x0078 236 */ sll %o1,2,%g2 michael@0: /* 0x007c */ or %g0,%o0,%o3 michael@0: /* 0x0080 232 */ sll %o1,1,%o1 michael@0: /* 0x0084 236 */ add %g2,2,%o2 michael@0: /* 0x0088 */ cmp %o2,0 michael@0: /* 0x008c */ ble,a,pt %icc,.L900000660 michael@0: /* 0x0090 */ ldd [%i2],%f0 michael@0: michael@0: ! 241 ! pdtj=&(dt[0]); michael@0: ! 242 ! for(j=jj=0;j<2*nlen;j++,jj++,pdtj++) michael@0: ! 243 ! { michael@0: ! 244 ! m2j=pdm2[j]; michael@0: ! 245 ! a=pdtj[0]+pdn[0]*digit; michael@0: ! 246 ! b=pdtj[1]+pdm1[0]*pdm2[j+1]+a*TwoToMinus16; michael@0: ! 247 ! pdtj[1]=b; michael@0: ! 249 !#pragma pipeloop(0) michael@0: ! 250 ! for(i=1;i