This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Wondering if someone could explain why I'm seeing the following difference
when doing a mod by 2. The final generated code ends up with the 'xor/and'
sequence for mod by 2 but the simpler 'and' for mod by 4 (or 8, or 16,
...). This is from mainline, powerpc64-unknown-linux-gnu.
int i; void test1(unsigned int u, unsigned int u2) { if ((u % 2) == 0) i = 1;
if ((u2 % 4) == 0) i = 2;
}
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |