rif_xu@eds.ericsson.se (07/18/89)
I have compiled the standard Byte benchmark Savage using Think's LSC 3.01p4 on a MacII. I used the Math881lib and the std881lib and had the flags for '881 and '020 code generation set. It ran in 6 s. A version compiled in MPW C 2.02 ran in 3.3 s. Can anyone tell me why LSC generates so slow (MPW C is nearly twice as fast) code ? S Ruschkowski
siegel@endor.harvard.edu (Rich Siegel) (07/19/89)
In article <1629@eds.ericsson.se> rif_xu@eds.ericsson.se writes: > > I have compiled the standard Byte benchmark Savage using > Think's LSC 3.01p4 on a MacII. I used the Math881lib and > the std881lib and had the flags for '881 and '020 code > generation set. It ran in 6 s. A version compiled in > MPW C 2.02 ran in 3.3 s. > Can anyone tell me why LSC generates so slow (MPW C is nearly > twice as fast) code ? > Because when '881 is turned on, MPW C generates inline FPU calls for the functions, and TLSC generates calls to the library routines. R. ~~~~~~~~~~~~~~~ Rich Siegel Staff Software Developer Symantec Corporation, Language Products Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel "When it comes to my health, I think of my body as a temple - or at least a moderately well-managed Presbyterian youth center." - Emo Phillips ~~~~~~~~~~~~~~~
d88-jwa@nada.kth.se (Jon W{tte) (08/15/89)
In article <2236@husc6.harvard.edu> siegel@endor.UUCP (Rich Siegel) writes: >In article <1629@eds.ericsson.se> rif_xu@eds.ericsson.se writes: >> Can anyone tell me why LSC generates so slow (MPW C is nearly >> twice as fast) code ? > Because when '881 is turned on, MPW C generates inline FPU >calls for the functions, and TLSC generates calls to the library routines. One funny thing, though. LSC isn't what I'd call an "optimizing" compiler. I don't know if MPW C is, even though we have it here, because I haven't checked, but here's a piece of code from the LSC compiler: (...) MOVE.L (A7)+, D0 MOVE.L D0, $0010(A5) MOVE.L $0010(A5), -(A7) (...) It was after calling GetNewWindow and then calling SetPort. I understand why it does it that way, the two first instructions were part of the GetNewWindow and the third a preface to SetPort, but a reasonably smart compiler would have generated: MOVE (A7), $0010(A5) (If this is possible on the 68k, otherwise TWO instructions would sufficed) Do anyone know of an optimizer for the Macintosh, as I would not like to have to part with the user IO of LSC (which is why I use it - it's great !) -- __ Jon W{tte (The dread Smiley Shark) email:h+@nada.kth.se / \ (+46 (0) 8 258 268) /--- (c) 1989 Yessbox Allright Professional Products Inc. - Y.A.P.P.I. / -- No More --