This is the mail archive of the gcc-patches@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]

Re: Patch: Darwin ppc: -falign-xxx


Dale,

Geoff Keating wrote:
Dale Johannesen <dalej@apple.com> writes:


These options did not work on Darwin since the assembler uses 0's (an
illegal
instruction on ppc) to pad out .align in code sections, rather than
NOPs.
This causes the .align32 directive to be used in code sections instead;
this is not available on other OSs so the patch is Darwin specific.
Bootstrapped and verified that the options now work.

This is OK.
The patch contains a couple of nits see comment below.


Index: darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin.h,v
retrieving revision 1.27
diff -u -d -b -w -c -3 -p -r1.27 darwin.h
*** darwin.h    14 Sep 2002 13:12:53 -0000      1.27
--- darwin.h    31 Oct 2002 01:30:18 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 136,141 ****
--- 136,154 ----
  #define       RESTORE_FP_PREFIX "._restf"
  #define RESTORE_FP_SUFFIX ""

+ /* This is how to output an assembler line that says to advance
+    the location counter to a multiple of 2**LOG bytes using the
+    "nop" instruction as padding.  */
+
+ #define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG)                    \
+   do {                                                         \
+     if ((LOG) < 3) {                                           \
                       ^ this should be on the next line

+       ASM_OUTPUT_ALIGN (FILE,LOG);                             \
+     }                                                          \
+     else /* nop == ori r0,r0,0 */                              \
+       fprintf (FILE, "\t.align32 %d,0x60000000\n", (LOG));     \
+   } while (0);
                 ^^ watchout trainling semicolon!





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]