Path: chuka.playstation.co.uk!news From: "Jon Prestidge (Jon@surfed.to)" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Daft Question [long] Date: Thu, 30 Aug 2001 21:16:45 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 243 Message-ID: <9mm6uc$h6i10@www.netyaroze-europe.com> References: <01c1297e$8cb6e8a0$LocalHost@pal-s-omnibook> <9lrqqf$3j63@www.netyaroze-europe.com> <01c129ca$a5a6f700$d81fe4d5@pal-s-omnibook> <9m1d9c$b2i7@www.netyaroze-europe.com> <01c12ceb$fba64880$9709e4d5@pal-s-omnibook> <9m9c88$ioj5@www.netyaroze-europe.com> <01c12edc$cc2bf440$991fe4d5@pal-s-omnibook> <9me1g1$1sb13@www.netyaroze-europe.com> <9meajl$1sb17@www.netyaroze-europe.com> <9med8s$1sb18@www.netyaroze-europe.com> <9mekaq$1sb20@www.netyaroze-europe.com> <3b915bb2.83462112@www.netyaroze-europe.com> NNTP-Posting-Host: host213-122-162-62.btinternet.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Hello Steven > I'm sure that many of us won't be > using assembly anyway, so whether or > not the MIPS cpu is capable of more > powerful instructions is > irrelevant > the ultimate question is > "What code does the C compiler > generate?" for a lot of us. ...well yes I agree that's what I'm interested in too .... when your C code consists of simple operations like + - >> etc. your C code is quite representative of assembler anyway (assuming you're using integer math) and each translates to one CPU instruction. So you can get a pretty good idea of how much work the CPU has to do and it could help you write a faster bit of C code. I don't use assembler either, there's no need to when you're using C, I don't think. Now knowing that a divide and multiply is a lot slower than the other operations then... if say you had a bit of code that divided by a thousand to convert millimetres to metres then you may want to sacrifice a bit of accuracy and divide by 1024 instead (the compiler will convert it to >>10 for you... unless it's a very crap compiler). The work that you don't see in your C code that the CPU has to do is mainly loading-in the variables from memory and then writing them back after the opperation is done. You can reduce this loading and unloading if you group together opperations on the same variable where convenient. If I've got a small perfomance critical routine to write I develop it in a separate source file and then dissassemble it and keep experimenting and dissassembling it until I reduce the number of CPU instructions (and now I'll also be trying to recuce the number of divides and multiplys too) , but I didn't mean that I kept it in assembler --- I just discard the assemly code and use the tuned-up C code instead. Doing the dissassembly is easy in CW -- you just right click on the file... I dunno how you do it in GNU off hand though. I've attached a list of instructions for the R3000, I'm not sure if that's exactly the CPU that the PSX uses, or if it's just in the same seris, perhaps someone could confirm that? Anyway it's something I should have looked at before blerting-out all that guff in that earlier message I posted! I think I had a load of different info about different CPUs in my head and had got it jumbled-up...doh!....many appologies. Jon begin 666 R3000.htm M/&AT;6P^#0H\:&5A9#X-"CQT:71L93Y-25!3(%(S,# P($EN&%M<&QE(#PO M=&@^#0H)/'1H/B!#;VUM96YT2!W;W)D5LT72PN+BXL(#QB2!H;VQD2(^($U)4%,@07-S96UB;&5R($EN&%M<&QE(#PO=&@^#0H)/'1H/B!-96%N:6YG(#PO=&@^#0H)/'1H M/B!#;VUM96YT&-E<'1I;VX@<&]S&-E<'1I;VX@<&]S2!C;VYS=&%N=" \+W1D M/@T*"3QT2!T;R!R96=I5LD,BLQ,#!=(#T@ M)#$@/"]T9#X-"@D\=&0^($1A=&$@9G)O;2!M96UO&%M<&QE(#PO=&@^#0H)/'1H/B!# M;VUM96YT5LP72P@/&)R/B!-96UO5LT,CDS.38W,CDR72 \+W1D/@T*"3QT9#X@06-C97-S960@ M;VYL>2!B>2!D871A('1R86YS9F5R(&EN2 T+B!-96UO&%M<&QE(#PO M=&@^#0H)/'1H/B!-96%N:6YG(#PO=&@^#0H)/'1H/B!#;VUM96YT2!S:6YG;&4@/"]T9#X-"@D\=&0^(&UU;"YS("1F,BPD M9C0L)&8V(#PO=&0^#0H)/'1D/B D9C(@/2 D9C0@*B D9C8@/"]T9#X-"@D\ M=&0^($9L;V%T:6YG+5!O:6YT(&UU;'1I<&QY("AS:6YG;&4@<')E8VES:6]N M*2 \+W1D/@T*"3QT2 H M9&]U8FQE('!R96-I5LD,BLQ,#!=(#PO=&0^#0H)/'1D/B S,BUB:70@9&%T82!T;R!& M4"!R96=I