TempleOSCD_140715.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:09 +02:00
1 parent 7ef616a20e
commit 64f679eeb9
1095 files changed
+24814 -221011

No files matched your search

+6 -7
View File
@@ -1,4 +1,4 @@
//This uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
@@ -14,8 +14,7 @@
$SP,"<1>",BI=1,BP="::/Demo/Graphics/Camp.CPP.Z,Mountain"$ //Pointer to sprite in Camp.CPP.Z file
$SP,"<1>",BI=1,BP="::/Demo/Graphics/Mountain.CPP.Z,Mountain"$ //Pointer to sprite in $LK,"Mountain.CPP",A="FI:::/Demo/Graphics/Mountain.CPP"$ file
#define NUM_CLOUDS 16
#define SKY_LINES 30
@@ -43,7 +42,7 @@ I64 mp_not_done_flags;
U0 MPDrawClouds(CTask *task)
{
Cloud *c;
CDC *dc=DCAlias(gr_dc2,task);
CDC *dc=DCAlias(gr.dc2,task);
I64 i,j,k,xx,yy,lo=Gs->num*CLOUD_PTS/mp_cnt,hi=(Gs->num+1)*CLOUD_PTS/mp_cnt;
for (j=0,c=clouds;j<NUM_CLOUDS;j++,c++)
@@ -161,7 +160,7 @@ U0 CleanUp()
}
U0 SongTask(I64)
{ //Song by the Holy Spirit
{//Song by the Holy Spirit
//This specifies a callback routine
//to be called when the task dies.
Fs->task_end_cb=&SndTaskEndCB;
@@ -188,8 +187,8 @@ U0 CloudScene()
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
DocClear;
"$$BG,LTCYAN$$"; NewLine(SKY_LINES);
"$$BG,YELLOW$$"; NewLine(5);
"$$BG,LTCYAN$$%h*c",SKY_LINES,'\n';
"$$BG,YELLOW$$%h5c",'\n';
BibleVerse(,"Exodus,14:19",7);
Preempt(OFF);
+2 -3
View File
@@ -11,11 +11,10 @@ interrupt U0 BeepOff()
}
U0 IntTest()
{
//Modify interrupt descriptor table
//for CPU #1.
{//Modify interrupt descriptor table use by all cores.
IntEntrySet(I_USER,&BeepOn,IDTET_TRAP);
IntEntrySet(I_USER+1,&BeepOff,IDTET_TRAP);
//Issue interupt to core#1
MPInt(I_USER,1);
Sleep(1000);
MPInt(I_USER+1,1);
+3 -3
View File
@@ -2,7 +2,7 @@ Bool app_done;
I64 app_done_ack;
U0 Job1(I64)
{ //Compile Compiler
{//Compile Compiler
Preempt(ON); //Off by default
Silent(ON);
while (!app_done) {
@@ -13,7 +13,7 @@ U0 Job1(I64)
}
U0 Job2(I64)
{ //Log a file
{//Log a file
Preempt(ON); //Off by default
while (!app_done) {
AdamLog("%F","::/Demo/MultiCore/LoadTest.CPP");
@@ -23,7 +23,7 @@ U0 Job2(I64)
}
U0 Job3(I64)
{ //Log a file
{//Log a file
Preempt(ON); //Off by default
while (!app_done) {
Cd("::/Compiler");
+7 -11
View File
@@ -1,18 +1,16 @@
/*
lock{} is a compiler statement
which places asm LOCK instruction
prefixes on code. Only use it on
read-modify-write statements.
It will generate invalid instructions
if you misuse it and it will crash.
$LK,"U",A="MN:U"$() to see what code was generated.
/*lock{} is a compiler statement
which places asm LOCK instruction
prefixes on code. Only use it on
read-modify-write statements.
It will generate invalid instructions
if you misuse it and it will crash.
$LK,"U",A="MN:U"$() to see what code was generated.
*/
#define CNT 0x1000000
I64 glbl;
U0 MPUnlockedInc(I64)
{
I64 i;
@@ -31,8 +29,6 @@ U0 UnlockedInc()
"Correct Cnt:%X Actual Cnt:%X\n",CNT*2,glbl;
}
U0 MPLockedInc(I64)
{
I64 i;
+1 -2
View File
@@ -1,7 +1,7 @@
I64 mp_n;
I64 MPSum(I64 my_mp_cnt)
{ //We could use the formula n*(n+1)/2
{//We could use the formula n*(n+1)/2
I64 lo=mp_n*Gs->num/my_mp_cnt,
hi=mp_n*(Gs->num+1)/my_mp_cnt,
result=0,i;
@@ -22,7 +22,6 @@ I64 Sum(I64 n,I64 my_mp_cnt)
return result;
}
#define SAMPLE_SIZE 100
F64 Test(I64 n,I64 my_mp_cnt)
-1
View File
@@ -5,7 +5,6 @@ U0 Job(CDoc *doc)
DocPrint(doc,"$$FG,%d$$CPU%d ",Gs->num,Gs->num);
}
U0 MPPrintDemo()
{
I64 i;
-1
View File
@@ -23,7 +23,6 @@ U0 PDNormalize()
size=dst-r-2*BORDER_CHARS;
}
U0 PDAnswer(U8 *a,I64 len)
{
DocLock(doc);
+14 -36
View File
@@ -1,3 +1,9 @@
/*
On an 8-core machine, this takes the top 3-bits
of random numbers and distributes them to the 8 cores
for sorting. Then, it merge sorts them.
*/
#define NUM 1000000
I64 my_mp_cnt=1<<Bsr(mp_cnt);//Power of 2
@@ -11,11 +17,9 @@ I64 Compare(I32 *e1,I32 *e2)
return *e1-*e2;
}
U0 QSortU32(I32 *base,I64 num)
{
// By customizing, we dramatically improve it!
// Cut and paste from $LK,"QSortI64",A="MN:QSortI64"$().
{//By customizing, we dramatically improve it!
//Cut and paste from $LK,"QSortI64",A="MN:QSortI64"$().
I64 i;
I32 *less,*greater,pivot;
if (num>1) {
@@ -32,7 +36,7 @@ U0 QSortU32(I32 *base,I64 num)
}
}
i=less-base;
if (i==num) { //All less or equal to pivot
if (i==num) {//All less or equal to pivot
//Point greater to first less
do greater--;
@@ -73,7 +77,6 @@ U0 MPRadixSortDemo(I64 dummy=0)
for (i=0;i<NUM;i++)
a1[i]=RandI32;
a2=MAlloc(NUM*sizeof(I32));
"$$GREEN$$QSort$$FG$$\n";
@@ -83,7 +86,6 @@ U0 MPRadixSortDemo(I64 dummy=0)
"Time:%9.6f\n",tS-t0;
D(a2+NUM/4);
"$$GREEN$$QSortU32$$FG$$\n";
t0=tS;
MemCpy(a2,a1,sizeof(I32)*NUM);
@@ -130,35 +132,11 @@ U0 MPRadixSortDemo(I64 dummy=0)
MPRadixSortDemo;
/*$HL,0$ Results on 8 Cores 2.660GHz Core i7:
/*$HL,0$ Results on 8 Cores 3.397GHz Core i7:
$FG,2$QSort$FG$
Time: 1.535474
00000000 EA 1D F6 BF 16 2E F6 BF 0B 3C F6 BF CD 44 F6 BF ê.ö¿..ö¿.<ö¿ÍDö¿
00000010 B1 45 F6 BF 52 4A F6 BF 96 71 F6 BF 9F 78 F6 BF ±Eö¿RJö¿–qö¿Ÿxö¿
00000020 52 87 F6 BF 23 9F F6 BF EF AD F6 BF 2D B4 F6 BF R‡ö¿#Ÿö¿ï­ö¿-´ö¿
00000030 4B EE F6 BF 60 FA F6 BF 31 08 F7 BF 1A 0E F7 BF Kîö¿`úö¿1.÷¿..÷¿
00000040 5C 39 F7 BF 26 3B F7 BF C7 3D F7 BF CF 3D F7 BF \9÷¿&;÷¿Ç=÷¿Ï=÷¿
00000050 7D 51 F7 BF 2F 79 F7 BF 7B 7A F7 BF CF 8C F7 BF }Q÷¿/y÷¿{z÷¿ÏŒ÷¿
00000060 09 95 F7 BF 04 A3 F7 BF D2 A8 F7 BF 61 EA F7 BF .•÷¿.£÷¿Ò¨÷¿aê÷¿
00000070 2D ED F7 BF F2 03 F8 BF 4C 09 F8 BF BB 09 F8 BF -í÷¿ò.ø¿L.ø¿».ø¿
Time: 0.759998
$FG,2$QSortU32$FG$
Time: 0.132599
00000000 EA 1D F6 BF 16 2E F6 BF 0B 3C F6 BF CD 44 F6 BF ê.ö¿..ö¿.<ö¿ÍDö¿
00000010 B1 45 F6 BF 52 4A F6 BF 96 71 F6 BF 9F 78 F6 BF ±Eö¿RJö¿–qö¿Ÿxö¿
00000020 52 87 F6 BF 23 9F F6 BF EF AD F6 BF 2D B4 F6 BF R‡ö¿#Ÿö¿ï­ö¿-´ö¿
00000030 4B EE F6 BF 60 FA F6 BF 31 08 F7 BF 1A 0E F7 BF Kîö¿`úö¿1.÷¿..÷¿
00000040 5C 39 F7 BF 26 3B F7 BF C7 3D F7 BF CF 3D F7 BF \9÷¿&;÷¿Ç=÷¿Ï=÷¿
00000050 7D 51 F7 BF 2F 79 F7 BF 7B 7A F7 BF CF 8C F7 BF }Q÷¿/y÷¿{z÷¿ÏŒ÷¿
00000060 09 95 F7 BF 04 A3 F7 BF D2 A8 F7 BF 61 EA F7 BF .•÷¿.£÷¿Ò¨÷¿aê÷¿
00000070 2D ED F7 BF F2 03 F8 BF 4C 09 F8 BF BB 09 F8 BF -í÷¿ò.ø¿L.ø¿».ø¿
Time: 0.093684
$FG,2$MP Radix QSortU32$FG$
Time: 0.024471
00000000 EA 1D F6 BF 16 2E F6 BF 0B 3C F6 BF CD 44 F6 BF ê.ö¿..ö¿.<ö¿ÍDö¿
00000010 B1 45 F6 BF 52 4A F6 BF 96 71 F6 BF 9F 78 F6 BF ±Eö¿RJö¿–qö¿Ÿxö¿
00000020 52 87 F6 BF 23 9F F6 BF EF AD F6 BF 2D B4 F6 BF R‡ö¿#Ÿö¿ï­ö¿-´ö¿
00000030 4B EE F6 BF 60 FA F6 BF 31 08 F7 BF 1A 0E F7 BF Kîö¿`úö¿1.÷¿..÷¿
00000040 5C 39 F7 BF 26 3B F7 BF C7 3D F7 BF CF 3D F7 BF \9÷¿&;÷¿Ç=÷¿Ï=÷¿
00000050 7D 51 F7 BF 2F 79 F7 BF 7B 7A F7 BF CF 8C F7 BF }Q÷¿/y÷¿{z÷¿ÏŒ÷¿
00000060 09 95 F7 BF 04 A3 F7 BF D2 A8 F7 BF 61 EA F7 BF .•÷¿.£÷¿Ò¨÷¿aê÷¿
00000070 2D ED F7 BF F2 03 F8 BF 4C 09 F8 BF BB 09 F8 BF -í÷¿ò.ø¿L.ø¿».ø¿
$HL,1$*/
Time: 0.045450
$HL,1$*/