Doug Evans wrote: > I _think_ the problem centers around the implicit widening > in the original code. The subtraction is done in QImode > and a QImode value is subsequently added to a DImode value. Well, it's more due to a missed explicit widening. > [Digression: > In a world in which Umodes don't exist, implicit widening operations > should probably be disallowed, though part of me will loathe the extra > amount of typing required.] It would be unlogical to have to write zero-extensions different from sign-extensions. So, since the mode doesn't have signedness information, implicit widening would be missing that information. > I don't know the architecture, so I don't know what the desired effect > of (abs DI (some-QI-value)) is. Making a wild guess, what about > something like: > > - (set acc (abs DI (sub (subword QI rm 0) (subword QI rn 0)))) > + (set acc (zext DI (abs QI (sub (subword QI rm 0) (subword QI rn 0))))) > > Or maybe it's > - (set acc (abs DI (sub (subword QI rm 0) (subword QI rn 0)))) > + (set acc (zext DI (sub (subword QI rm 0) (subword QI rn 0)))) > > [and so on for the rest of the bytes] No, the zero-extension should happen before the subtraction. -- -------------------------- SuperH (UK) Ltd. 2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX T:+44 1454 465658