TempleOSCDV4.12.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:47:56 +02:00
1 parent 93ca216483
commit b84bbff6db
381 files changed
+18356 -18798

No files matched your search

+16 -18
View File
@@ -6,8 +6,7 @@ instead of dollars with a float.
Fixed-point used to be much $TX,"faster",HTML="http://en.wikipedia.org/wiki/X87"$,
but modern processors do well with
floats. It also depends on the compiler
and my compiler used to do floats poorly.
It's a little better.
and my compiler is poor with floats.
I often use 64-bit ints with upper 32-bits
as int and lower 32-bits as fraction.
@@ -17,7 +16,6 @@ to access upper or lower 32-bits.
For a complete lst of nonstandard compiler
features, see $LK,"::/Doc/HolyC.DD"$.
*/
U0 Main()
@@ -29,23 +27,23 @@ U0 Main()
t0=tS;
for (i=1000000000;i;i--)
i_sum+=i_val;
"Int Sum:%.9f Time:%7.3fs\n",i_sum/ToF64(0x100000000),tS-t0;
"Int Sum\t\t:%.9f Time:%7.3fs\n",i_sum/ToF64(0x100000000),tS-t0;
f_val= 2.0000002;
t0=tS;
for (i=1000000000;i;i--)
f_sum+=f_val;
"Float Sum:%.9f Time:%7.3fs\n",f_sum,tS-t0;
"Float Sum\t:%.9f Time:%7.3fs\n",f_sum,tS-t0;
'\n';
}
U0 DoIt2()
{
I64 i=0x123456789ABCDEF0;
"i =%X\n",i;
"i\t\t=%X\n",i;
"i&0xFFFFFFFF=%X\n",i&0xFFFFFFFF;
"i>>32 =%X\n",i>>32;
"i&0xFFFFFFFF\t=%X\n",i&0xFFFFFFFF;
"i>>32\t\t=%X\n",i>>32;
/* Standard int types are declared
with a special compiler feature which
@@ -74,8 +72,8 @@ For a complete lst of nonstandard compiler
features, see $LK,"::/Doc/HolyC.DD"$.
*/
"i.u32[0] =%X\n",i.u32[0];
"i.u32[1] =%X\n",i.u32[1];
"i.u32[0]\t=%X\n",i.u32[0];
"i.u32[1]\t=%X\n",i.u32[1];
}
CPURep;
@@ -86,13 +84,13 @@ DoIt2;
/*Program Output$HL,0$$WW+H,1$$FD,1$
8 Cores 2.660GHz
Int Sum:2000000199.768689408 Time: 0.787s
Float Sum:2000000225.656126208 Time: 3.918s
$FG$$BG$16 Cores 3.500GHz
Int Sum :2000000199.768690240 Time: 0.803s
Float Sum :2000000225.656127040 Time: 3.615s
i =123456789ABCDEF0
i&0xFFFFFFFF=9ABCDEF0
i>>32 =12345678
i.u32[0] =9ABCDEF0
i.u32[1] =12345678
i =123456789ABCDEF0
i&0xFFFFFFFF =9ABCDEF0
i>>32 =12345678
i.u32[0] =9ABCDEF0
i.u32[1] =12345678
$HL,1$*/