Hello!

I was playing a bit with TARGET_SHIFT_TRUNCATION_MASK on x86 in the
hope that redundant masking would get eliminated from:

int test (int a, int c)
{
        return a << (c & 0x1f);
}

The macro was defined as:

+/* Implement TARGET_SHIFT_TRUNCATION_MASK.  */
+static unsigned HOST_WIDE_INT
+ix86_shift_truncation_mask (enum machine_mode mode)
+{
+  switch (mode)
+    {
+    case QImode:
+    case HImode:
+    case SImode:
+      return 31;
+
+    case DImode:
+      if (TARGET_64BIT)
+       return 63;
+
+    default:
+      return 0;
+    }
+}

However, I was not able to get rid of the masking "and".

Uros.

Reply via email to