On Wed, Aug 25, 2010 at 7:29 AM, Mingjie Xing <mingjie.x...@gmail.com> wrote: > Hello, > > I have a problem about the definition of SHIFT_COUNT_TRUNCATED. MIPS > is a SHIFT_COUNT_TRUNCATED target, and has it defined as 1. While > loongson-specific vector insns are not SHIFT_COUNT_TRUNCATED. That > means that the macro depends on the machine mode. One simple > resolution may be, > > #define SHIFT_COUNT_TRUNCATED (TARGET_LOONGSON_2EF ? 0 : 1) > > but this will disable the common optimization for loongson target. > Another way is to use a target hook to handle this problem, but this > requires many changes. > > I'd like to ask suggestions for this.
SHIFT_COUNT_TRUNCATED isn't really about optimization but about matching constant folding behavior with machine behavior in the cases the C standard says invoke undefined behavior (IIRC). On x86_64 and i?86 for example the macro doesn't match machine behavior because machine behavior depends on the instructions being used. So I wouldn't worry about this. Richard. > Thanks, > Mingjie >