/* Generated with C2C (Cedar To C)*/ /* Copyright (C) 1992 by Xerox Corporation. All rights reserved. */ /* time: February 21, 1992 9:06:08 pm PST */ /* C2C version: October 16, 1990 (native) */ /* ref-counting: off */ /* file: RealSupportImpl, module: RealSupportImpl */ /* switches: bcfhklnouw */ #include #include static char versionStamp[] = "@(#)mob_version [1972848211,830939493] RealSupportImpl"; typedef unsigned word, *ptr; typedef unsigned char byte, *bPt; typedef unsigned short half, *hPt; typedef word (*fPt)(); static float fc1 = 2147483647.0; #define SOURCE(p, l) /* source p, l */ #define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR_RaiseBoundsFault()) : (idx) ) static float fc8 = 0.0; static float fc11 = 256.0; #define INEG(x) ( (word) ( - ((int) (word) (x)) ) ) static float fc18 = 2.0; #define FMIN(x, y, tx, ty) ( (tx=((float) x)) <= (ty=((float) y)) ? tx : ty ) #define FMAX(x, y, tx, ty) ( (tx=((float) x)) >= (ty=((float) y)) ? tx : ty ) static void NoName_Q1800(); static void RealSupportImpl_P0(); static word Classify_P60(); static word Example_P120(); static word IntToReal_P180(); static word CardToReal_P240(); static word Fix_P300(); static word Round_P360(); static word FScale_P420(); static word Neg_P480(); static word Abs_P600(); static word Add_P660(); static word Sub_P720(); static word Mul_P780(); static word Div_P840(); static word Gt_P900(); static word Ge_P960(); static word Lt_P1020(); static word Le_P1080(); static word Eq_P1140(); static word Ne_P1200(); static word Min_P1260(); static word Max_P1320(); static word Pwr_P1380(); static word Floor_P1440(); static word Ceiling_P1500(); static void OtherError_P1740(); static struct {unsigned f; char r[16];} string2 = {851984, "\257\300u\227FS\3001\207!e@t\000\000"}; static struct {unsigned f; char r[16];} string3 = {851984, "\257\300\150\261\123\070\300\276\161\220\062\100\150\000\000"}; static struct {unsigned f; char r[16];} string4 = {851984, "\257\300\321\335\027\212\300\103\063\273\041\100\150\000\000"}; static struct { word f0[59]; } globalframe = { {0} }; static void NoName_Q1800() { register ptr gf_c0105 = (ptr) &globalframe; word var_c9384; (* (( (ptr) gf_c0105)+4)/* floatLastInt_v3504 */ ) = (* (ptr) &fc1 ); (* (( (ptr) gf_c0105)+55) ) = ( ((word) (fPt) RealSupportImpl_P0) ); (* (( (ptr) gf_c0105)+53) ) = ( ((word) (fPt) Classify_P60) ); (* (( (ptr) gf_c0105)+51) ) = ( ((word) (fPt) Example_P120) ); (* (( (ptr) gf_c0105)+49) ) = ( ((word) (fPt) IntToReal_P180) ); (* (( (ptr) gf_c0105)+47) ) = ( ((word) (fPt) CardToReal_P240) ); (* (( (ptr) gf_c0105)+45) ) = ( ((word) (fPt) Fix_P300) ); (* (( (ptr) gf_c0105)+43) ) = ( ((word) (fPt) Round_P360) ); (* (( (ptr) gf_c0105)+41) ) = ( ((word) (fPt) FScale_P420) ); (* (( (ptr) gf_c0105)+39) ) = ( ((word) (fPt) Neg_P480) ); (* (( (ptr) gf_c0105)+37) ) = ( ((word) (fPt) Abs_P600) ); (* (( (ptr) gf_c0105)+35) ) = ( ((word) (fPt) Add_P660) ); (* (( (ptr) gf_c0105)+33) ) = ( ((word) (fPt) Sub_P720) ); (* (( (ptr) gf_c0105)+31) ) = ( ((word) (fPt) Mul_P780) ); (* (( (ptr) gf_c0105)+29) ) = ( ((word) (fPt) Div_P840) ); (* (( (ptr) gf_c0105)+27) ) = ( ((word) (fPt) Gt_P900) ); (* (( (ptr) gf_c0105)+25) ) = ( ((word) (fPt) Ge_P960) ); (* (( (ptr) gf_c0105)+23) ) = ( ((word) (fPt) Lt_P1020) ); (* (( (ptr) gf_c0105)+21) ) = ( ((word) (fPt) Le_P1080) ); (* (( (ptr) gf_c0105)+19) ) = ( ((word) (fPt) Eq_P1140) ); (* (( (ptr) gf_c0105)+17) ) = ( ((word) (fPt) Ne_P1200) ); (* (( (ptr) gf_c0105)+15) ) = ( ((word) (fPt) Min_P1260) ); (* (( (ptr) gf_c0105)+13) ) = ( ((word) (fPt) Max_P1320) ); (* (( (ptr) gf_c0105)+11) ) = ( ((word) (fPt) Pwr_P1380) ); (* (( (ptr) gf_c0105)+9) ) = ( ((word) (fPt) Floor_P1440) ); (* (( (ptr) gf_c0105)+7) ) = ( ((word) (fPt) Ceiling_P1500) ); (* (( (ptr) gf_c0105)+5) ) = ( ((word) (fPt) OtherError_P1740) ); (void) XR_DeclareGlobalFrame((word) "RealSupportImpl", &globalframe, (word) XR_GetTypeIndexS((word) (&string2)), (word) ( ( (bPt) gf_c0105)+220)/* var_c9096 */ ); var_c9384 = (word) XR_ImportInterface((word) "FloatingPointCommon", (word) XR_GetTypeIndexS((word) (&string3)), 5); (* (( (ptr) gf_c0105)+57)/* var_c9352 */ ) = var_c9384; var_c9384 = (word) XR_ExportInterface((word) "RealSupport", (word) XR_GetTypeIndexS((word) (&string4)), 24); (* (( (ptr) gf_c0105)+58)/* var_c9416 */ ) = var_c9384; (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+212)/* var_c9064 */ , 67371009); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+204)/* var_c9032 */ , 67633410); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+196)/* var_c9000 */ , 67371521); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+188)/* var_c8968 */ , 67371777); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+180)/* var_c8936 */ , 67372033); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+172)/* var_c8904 */ , 67372289); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+164)/* var_c8872 */ , 67634690); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+156)/* var_c8840 */ , 67372801); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+148)/* var_c8808 */ , 67373057); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+140)/* var_c8776 */ , 67635458); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+132)/* var_c8744 */ , 67635714); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+124)/* var_c8712 */ , 67635970); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+116)/* var_c8680 */ , 67636226); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+108)/* var_c8648 */ , 67636482); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+100)/* var_c8616 */ , 67636738); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+92)/* var_c8584 */ , 67636994); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+84)/* var_c8552 */ , 67637250); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+76)/* var_c8520 */ , 67637506); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+68)/* var_c8488 */ , 67637762); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+60)/* var_c8456 */ , 67638018); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+52)/* var_c8424 */ , 67638274); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+44)/* var_c8392 */ , 67638530); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+28)/* var_c8328 */ , 67376641); (void) XR_ExportProcS(var_c9384, (word) (( (bPt) gf_c0105)+36)/* var_c8360 */ , 67376897); } static void RealSupportImpl_P0(formal_c032, formal_c031) word formal_c032; word formal_c031; { /* RealSupportImpl: */ /* moved to installation proc */ } static word Classify_P60(d_v3848) word d_v3848; { word var_c3892; word f_v7636; /* Classify: */ SOURCE(531, 300) SOURCE(596, 27) f_v7636 = d_v3848; SOURCE(625, 206) { word var_c9128; var_c9128 = (((unsigned)f_v7636 << 1) >> 24); if ((var_c9128 == 0)) { SOURCE(648, 53) if ((( (((unsigned)f_v7636 << 9) >> 9) ) == 0)) { SOURCE(664, 19) return(0); } else { SOURCE(683, 18) return(1); }; } else { if ((var_c9128 == 255)) { SOURCE(713, 90) { word var_c9160; var_c9160 = ( (((unsigned)f_v7636 << 9) >> 9) ); if ((var_c9160 == 0)) { SOURCE(734, 17) return(3); } else { if ((var_c9160 == 1)) { SOURCE(758, 14) return(4); } else { SOURCE(785, 18) return(5); }; }; }; } else { SOURCE(816, 15) return(2); }; }; }; } static word Example_P120(c_v3952, min_v3980) word c_v3952; word min_v3980; { word var_c4024; word f_v7680 = 0; /* Example: */ SOURCE(837, 410) SOURCE(951, 264) { word var_c9192; var_c9192 = c_v3952; switch (var_c9192) { case 0: break; case 1: SOURCE(990, 42) if ((0 != min_v3980)) { SOURCE(1002, 13) f_v7680 = (f_v7680 & 4286578688) | ((1)); } else { SOURCE(1015, 17) f_v7680 = (f_v7680 & 4286578688) | ((8388607)); }; break; case 2: SOURCE(1044, 67) if ((0 != min_v3980)) { SOURCE(1056, 15) f_v7680 = (f_v7680 & 2155872255) | (((1)) << 23); } else { SOURCE(1072, 20) f_v7680 = (f_v7680 & 2155872255) | (((254)) << 23); SOURCE(1094, 17) f_v7680 = (f_v7680 & 4286578688) | ((8388607)); }; break; case 3: SOURCE(1126, 14) f_v7680 = (f_v7680 & 2155872255) | (((255)) << 23); break; case 4: SOURCE(1152, 14) f_v7680 = (f_v7680 & 2155872255) | (((255)) << 23); SOURCE(1168, 7) f_v7680 = (f_v7680 & 4286578688) | ((1)); break; case 5: SOURCE(1192, 14) f_v7680 = (f_v7680 & 2155872255) | (((255)) << 23); SOURCE(1208, 7) f_v7680 = (f_v7680 & 4286578688) | ((2)); break; }; }; SOURCE(1227, 20) return(f_v7680); } static word IntToReal_P180(i_v4084) word i_v4084; { word ret_v4128; /* IntToReal: */ SOURCE(1253, 71) SOURCE(1317, 7) { float tf5; ret_v4128 = ( tf5 = (float)(int)i_v4084, *(word*)&tf5 ); }; SOURCE(1253, 71) return(ret_v4128); } static word CardToReal_P240(c_v4188) word c_v4188; { word ret_v4232; /* CardToReal: */ SOURCE(1329, 73) SOURCE(1395, 7) { float tf6; ret_v4232 = ( tf6 = (float)(unsigned)c_v4188, *(word*)&tf6 ); }; SOURCE(1329, 73) return(ret_v4232); } static word Fix_P300(x_v4292) word x_v4292; { register ptr gf_c9448 = (ptr) &globalframe; word var_c4336; /* Fix: */ SOURCE(1407, 100) SOURCE(1452, 35) if ((((x_v4292 << 1) >> 1) > (* (( (ptr) gf_c9448)+4)/* floatLastInt_v3504 */ ))) { SOURCE(1475, 12) (void) OtherError_P1740(); }; SOURCE(1489, 18) return((word) XR_REAL32_Fix(x_v4292)); } static word Round_P360(x_v4396) word x_v4396; { register ptr gf_c9480 = (ptr) &globalframe; word var_c4440; /* Round: */ SOURCE(1510, 104) SOURCE(1557, 35) if ((((x_v4396 << 1) >> 1) > (* (( (ptr) gf_c9480)+4)/* floatLastInt_v3504 */ ))) { SOURCE(1580, 12) (void) OtherError_P1740(); }; SOURCE(1594, 20) return((word) XR_REAL32_Round(x_v4396)); } static word FScale_P420(a_v4500, scale_v4528) word a_v4500; word scale_v4528; { word var_c4572; word r_v7724; word exp_v7752; /* FScale: */ SOURCE(1618, 494) SOURCE(1683, 27) r_v7724 = a_v4500; SOURCE(1712, 28) exp_v7752 = ((((unsigned)r_v7724 << 1) >> 24) + scale_v4528); SOURCE(1742, 370) if ( ( ( ( (int)exp_v7752 > (int)0) ? ( (int)exp_v7752 < (int)255) : 0 ) ? (((((unsigned)r_v7724 << 1) >> 24) - 1) <= 253) : 0 ) ) { SOURCE(1792, 11) r_v7724 = (r_v7724 & 2155872255) | (((BCK(exp_v7752, 256))) << 23); SOURCE(1805, 21) return(r_v7724); } else { SOURCE(1835, 26) { word x7; word x9; if ((( x7 = a_v4500, *(float*)&x7 ) == ( x9 = (* (ptr) &fc8 ), *(float*)&x9 ))) { SOURCE(1851, 10) return(a_v4500); }; }; SOURCE(1863, 60) lab_L100002: ; if (( (int)scale_v4528 >= (int)8)) { } else { goto lab_L100000; }; SOURCE(1883, 17) scale_v4528 = (scale_v4528 - 8); SOURCE(1902, 21) { word x10; word x12; *(float*)&a_v4500 = ( x10 = a_v4500, *(float*)&x10 ) * ( x12 = (* (ptr) &fc11 ), *(float*)&x12 ); }; goto lab_L100002; lab_L100000: ; SOURCE(1925, 53) lab_L100005: ; if (( (int)scale_v4528 > (int)0)) { } else { goto lab_L100003; }; SOURCE(1944, 17) scale_v4528 = (scale_v4528 - 1); SOURCE(1963, 15) { word x13; word x14; *(float*)&a_v4500 = ( x13 = a_v4500, *(float*)&x13 ) + ( x14 = a_v4500, *(float*)&x14 ); }; goto lab_L100005; lab_L100003: ; SOURCE(1980, 61) lab_L100008: ; if (( (int)INEG(scale_v4528) >= (int)8)) { } else { goto lab_L100006; }; SOURCE(2001, 17) scale_v4528 = (scale_v4528 + 8); SOURCE(2020, 21) { word x15; word x16; *(float*)&a_v4500 = ( x15 = a_v4500, *(float*)&x15 ) / ( x16 = (* (ptr) &fc11 ), *(float*)&x16 ); }; goto lab_L100008; lab_L100006: ; SOURCE(2043, 56) lab_L100011: ; if (( (int)INEG(scale_v4528) > (int)0)) { } else { goto lab_L100009; }; SOURCE(2063, 17) scale_v4528 = (scale_v4528 + 1); SOURCE(2082, 17) { word x17; word x19; *(float*)&a_v4500 = ( x17 = a_v4500, *(float*)&x17 ) / ( x19 = (* (ptr) &fc18 ), *(float*)&x19 ); }; goto lab_L100011; lab_L100009: ; SOURCE(2101, 11) return(a_v4500); }; } static word Neg_P480(d_v4632) word d_v4632; { word ret_v4676; word f_v7796; /* Neg: */ SOURCE(2118, 126) SOURCE(2177, 27) f_v7796 = d_v4632; SOURCE(2206, 19) f_v7796 = (f_v7796 & 2147483647) | ((( ! ((int)f_v7796<0))) << 31); SOURCE(2227, 17) ret_v4676 = f_v7796; SOURCE(2118, 126) return(ret_v4676); } static word Abs_P600(d_v4840) word d_v4840; { word ret_v4884; /* Abs: */ SOURCE(2354, 77) SOURCE(2413, 18) ret_v4884 = ((d_v4840 << 1) >> 1); SOURCE(2354, 77) return(ret_v4884); } static word Add_P660(x_v4944, y_v4972) word x_v4944; word y_v4972; { word ret_v5016; /* Add: */ SOURCE(2436, 73) SOURCE(2498, 11) { word x20; word x21; *(float*)&ret_v5016 = ( x20 = x_v4944, *(float*)&x20 ) + ( x21 = y_v4972, *(float*)&x21 ); }; SOURCE(2436, 73) return(ret_v5016); } static word Sub_P720(x_v5076, y_v5104) word x_v5076; word y_v5104; { word ret_v5148; /* Sub: */ SOURCE(2514, 73) SOURCE(2576, 11) { word x22; word x23; *(float*)&ret_v5148 = ( x22 = x_v5076, *(float*)&x22 ) - ( x23 = y_v5104, *(float*)&x23 ); }; SOURCE(2514, 73) return(ret_v5148); } static word Mul_P780(x_v5208, y_v5236) word x_v5208; word y_v5236; { word ret_v5280; /* Mul: */ SOURCE(2592, 73) SOURCE(2654, 11) { word x24; word x25; *(float*)&ret_v5280 = ( x24 = x_v5208, *(float*)&x24 ) * ( x25 = y_v5236, *(float*)&x25 ); }; SOURCE(2592, 73) return(ret_v5280); } static word Div_P840(x_v5340, y_v5368) word x_v5340; word y_v5368; { word ret_v5412; /* Div: */ SOURCE(2670, 73) SOURCE(2732, 11) { word x26; word x27; *(float*)&ret_v5412 = ( x26 = x_v5340, *(float*)&x26 ) / ( x27 = y_v5368, *(float*)&x27 ); }; SOURCE(2670, 73) return(ret_v5412); } static word Gt_P900(x_v5472, y_v5500) word x_v5472; word y_v5500; { word var_c5544; /* Gt: */ SOURCE(2748, 70) SOURCE(2804, 14) { word x28; word x29; return((( x28 = x_v5472, *(float*)&x28 ) > ( x29 = y_v5500, *(float*)&x29 ))); }; } static word Ge_P960(x_v5604, y_v5632) word x_v5604; word y_v5632; { word var_c5676; /* Ge: */ SOURCE(2823, 71) SOURCE(2879, 15) { word x30; word x31; return((( x30 = x_v5604, *(float*)&x30 ) >= ( x31 = y_v5632, *(float*)&x31 ))); }; } static word Lt_P1020(x_v5736, y_v5764) word x_v5736; word y_v5764; { word var_c5808; /* Lt: */ SOURCE(2899, 70) SOURCE(2955, 14) { word x32; word x33; return((( x32 = x_v5736, *(float*)&x32 ) < ( x33 = y_v5764, *(float*)&x33 ))); }; } static word Le_P1080(x_v5868, y_v5896) word x_v5868; word y_v5896; { word var_c5940; /* Le: */ SOURCE(2974, 71) SOURCE(3030, 15) { word x34; word x35; return((( x34 = x_v5868, *(float*)&x34 ) <= ( x35 = y_v5896, *(float*)&x35 ))); }; } static word Eq_P1140(x_v6000, y_v6028) word x_v6000; word y_v6028; { word var_c6072; /* Eq: */ SOURCE(3050, 70) SOURCE(3106, 14) { word x36; word x37; return((( x36 = x_v6000, *(float*)&x36 ) == ( x37 = y_v6028, *(float*)&x37 ))); }; } static word Ne_P1200(x_v6132, y_v6160) word x_v6132; word y_v6160; { word var_c6204; /* Ne: */ SOURCE(3125, 70) SOURCE(3181, 14) { word x38; word x39; return((( x38 = x_v6132, *(float*)&x38 ) != ( x39 = y_v6160, *(float*)&x39 ))); }; } static word Min_P1260(x_v6264, y_v6292) word x_v6264; word y_v6292; { word ret_v6336; /* Min: */ SOURCE(3200, 77) SOURCE(3262, 15) { word x40; float tf41; float tf42; word x43; float tf44; ret_v6336 = ( tf44 = FMIN(( x40 = x_v6264, *(float*)&x40 ), ( x43 = y_v6292, *(float*)&x43 ), tf41, tf42), *(word*)&tf44 ); }; SOURCE(3200, 77) return(ret_v6336); } static word Max_P1320(x_v6396, y_v6424) word x_v6396; word y_v6424; { word ret_v6468; /* Max: */ SOURCE(3282, 77) SOURCE(3344, 15) { word x45; float tf46; float tf47; word x48; float tf49; ret_v6468 = ( tf49 = FMAX(( x45 = x_v6396, *(float*)&x45 ), ( x48 = y_v6424, *(float*)&x48 ), tf46, tf47), *(word*)&tf49 ); }; SOURCE(3282, 77) return(ret_v6468); } static word Pwr_P1380(x_v6528, y_v6556) word x_v6528; word y_v6556; { word ret_v6600; /* Pwr: */ SOURCE(3364, 74) SOURCE(3426, 12) ret_v6600 = XR_RealPwr(x_v6528, y_v6556); SOURCE(3364, 74) return(ret_v6600); } static word Floor_P1440(x_v6660) word x_v6660; { register ptr gf_c9512 = (ptr) &globalframe; word ret_v6704; /* Floor: */ SOURCE(3443, 118) SOURCE(3504, 35) if ((((x_v6660 << 1) >> 1) > (* (( (ptr) gf_c9512)+4)/* floatLastInt_v3504 */ ))) { SOURCE(3527, 12) (void) OtherError_P1740(); }; SOURCE(3541, 20) { float tf50; return(( tf50 = (float)(int)(word) XR_REAL32_Floor(x_v6660), *(word*)&tf50 )); }; } static word Ceiling_P1500(x_v6764) word x_v6764; { register ptr gf_c9544 = (ptr) &globalframe; word ret_v6808; /* Ceiling: */ SOURCE(3564, 122) SOURCE(3627, 35) if ((((x_v6764 << 1) >> 1) > (* (( (ptr) gf_c9544)+4)/* floatLastInt_v3504 */ ))) { SOURCE(3650, 12) (void) OtherError_P1740(); }; SOURCE(3664, 22) { float tf51; return(( tf51 = (float)(int)(word) XR_REAL32_Ceiling(x_v6764), *(word*)&tf51 )); }; } static void OtherError_P1740() { register ptr gf_c9576 = (ptr) &globalframe; /* OtherError: */ SOURCE(4383, 59) SOURCE(4404, 38) { word var_c0104 = 5; (void) XR_RaiseError((* (( (ptr) (* (( (ptr) gf_c9576)+57)/* var_c9352 */ ))+4) ), (word) &var_c0104); }; } /* file: RealSupportImpl, module: RealSupportImpl, compiled at: February 21, 1992 9:06:07 pm PST */ extern void XR_install_RealSupportImpl() { NoName_Q1800(); } extern void XR_run_RealSupportImpl() { XR_Start(&globalframe); }