[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lousy code generation (Re: MoriaGS 5.3.1 coming...)
nathan@cco.caltech.edu (Nathan Mates) writes:
> Ok, so the compiler's trying a signed comparison? Hm. Basically, since
>we`re comparing the value to #3, any negative value will be less than 3. Well,
>at the expense of one more line, let's see what sort of assembly we can
>devise that doesn't have eor's and all running around. As this is getting more
>abstract, I don't think that more abstract code would probably be better.
>Here's try #2 from me for a signed-word comparison with #3.
> lda value
> bmi LessThan
> cmp #3
> bge GreaterThan
>LessThan ...
>GreaterThan ...
Very good! I don't think that one's made it into ORCA/C 2.0 yet, though
you can be sure I will test it and let Mike know. You are now on your
way to becoming a Compiler Stud(tm) like myself and Todd Whitesel :)
> Yes, it would take some logic to use this type of code; namely seeing that
>it is a signed comparison with an always positive number; for comparisons
>with other variables, I the long form would probably still have to be used,
>but for this case (and there are lots of them in standard programs that I've
>poked at in the monitor), some improvement is called for...
The other thing to realize is that MPW C (well APW C, at least; there is
evidently an experimental MPW C at Apple) has not been updated in any way
in over two years.
SUPPORT THE BYTEWORKS!
C 2.0 has problems, but they're getting worked out and it is by far
the best C compiler we've got. Or rather, the only C compiler we've got.
So support it :)
--
Jawaid Bazyar | Ask me about the GNO Multitasking Environment
Procyon, Inc. | for the Apple IIgs!
bazyar@cs.uiuc.edu | P.O Box 620334
--Apple II Forever!-- | Littleton, CO 80162-0334 (303) 781-3273