[PATCH, rs6000] power8 patches, patch #7, quad/byte/half-word atomic instructions

David Edelsohn dje.gcc@gmail.com
Wed May 29 20:29:00 GMT 2013


-  if (mode == QImode || mode == HImode)
+  /* On power8, we want to use SImode for the operation.  On previoius systems,
+     use the operation in a subword and shift/mask to get the proper byte or
+     halfword.  */
+  if (TARGET_SYNC_HI_QI && (mode == QImode || mode == HImode))
+    {
+      val = convert_modes (SImode, mode, val, 1);
+
+      /* Prepare to adjust the return value.  */
+      before = gen_reg_rtx (SImode);
+      if (after)
+    after = gen_reg_rtx (SImode);
+      mode = SImode;
+    }
+  else if (mode == QImode || mode == HImode)

Spelling: previoius.

This logic is redundant. Why not

if (mode == QImode || mode == HImode)
  {
    if (TARGET_SYNC_HI_QI)
      {
         new code
      }
    else
      {
         original code
      }

The rest of this patch is okay.

Thanks, David



More information about the Gcc-patches mailing list