public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [sparc32] [12/13] gcc-3.3 macro parenthesization fix for memcpy.S
Date: Wed, 4 Aug 2004 22:01:41 -0700	[thread overview]
Message-ID: <20040805050141.GD2334@holomorphy.com> (raw)
In-Reply-To: <20040805045643.GC2334@holomorphy.com>

On Wed, Aug 04, 2004 at 09:56:43PM -0700, William Lee Irwin III wrote:
> SMP support is in need of a great deal of work to port it from 2.2 and
> 2.4. Add a dependency on BROKEN in the Kconfig to warn the unwary.

From: Art Haas <ahaas@airmail.net>

The 1.3->1.4 changes to the arch/sparc/lib/copy_user.S file added
parenthesis to a number of macros within that file. The BK changlog
associated with this change indicate the change was to make the
file work with gcc-3.3.

When looking at the changes made, I see that similar macros exist in
memcpy.S as well, so would a patch adding parens to that file be
worthwhile? Also, just what was the problem with gcc-3.3 that was
resolved by adding the parenthesis? Macro mis-expansion I'm guessing.

Signed-off-by: Art Haas <ahaas@airmail.net>
Signed-off-by: William Irwin <wli@holomorphy.com>


Index: mm2-2.6.8-rc2/arch/sparc/lib/memcpy.S
===================================================================
--- mm2-2.6.8-rc2.orig/arch/sparc/lib/memcpy.S
+++ mm2-2.6.8-rc2/arch/sparc/lib/memcpy.S
@@ -42,124 +42,124 @@
 #endif
 
 /* Both these macros have to start with exactly the same insn */
-#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) 				\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	ldd	[%src + offset + 0x10], %t4; 								\
-	ldd	[%src + offset + 0x18], %t6; 								\
-	st	%t0, [%dst + offset + 0x00]; 								\
-	st	%t1, [%dst + offset + 0x04]; 								\
-	st	%t2, [%dst + offset + 0x08]; 								\
-	st	%t3, [%dst + offset + 0x0c]; 								\
-	st	%t4, [%dst + offset + 0x10]; 								\
-	st	%t5, [%dst + offset + 0x14]; 								\
-	st	%t6, [%dst + offset + 0x18]; 								\
-	st	%t7, [%dst + offset + 0x1c];
-
-#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) 				\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	ldd	[%src + offset + 0x10], %t4; 								\
-	ldd	[%src + offset + 0x18], %t6; 								\
-	std	%t0, [%dst + offset + 0x00]; 								\
-	std	%t2, [%dst + offset + 0x08]; 								\
-	std	%t4, [%dst + offset + 0x10]; 								\
-	std	%t6, [%dst + offset + 0x18];
-
-#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) 						\
-	ldd	[%src - offset - 0x10], %t0; 								\
-	ldd	[%src - offset - 0x08], %t2; 								\
-	st	%t0, [%dst - offset - 0x10]; 								\
-	st	%t1, [%dst - offset - 0x0c]; 								\
-	st	%t2, [%dst - offset - 0x08]; 								\
-	st	%t3, [%dst - offset - 0x04];
-
-#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) 						\
-	ldd	[%src - offset - 0x10], %t0; 								\
-	ldd	[%src - offset - 0x08], %t2; 								\
-	std	%t0, [%dst - offset - 0x10]; 								\
-	std	%t2, [%dst - offset - 0x08];
-
-#define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) 							\
-	ldub	[%src - offset - 0x02], %t0; 								\
-	ldub	[%src - offset - 0x01], %t1; 								\
-	stb	%t0, [%dst - offset - 0x02]; 								\
-	stb	%t1, [%dst - offset - 0x01];
+#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	ldd	[%src + (offset) + 0x10], %t4; \
+	ldd	[%src + (offset) + 0x18], %t6; \
+	st	%t0, [%dst + (offset) + 0x00]; \
+	st	%t1, [%dst + (offset) + 0x04]; \
+	st	%t2, [%dst + (offset) + 0x08]; \
+	st	%t3, [%dst + (offset) + 0x0c]; \
+	st	%t4, [%dst + (offset) + 0x10]; \
+	st	%t5, [%dst + (offset) + 0x14]; \
+	st	%t6, [%dst + (offset) + 0x18]; \
+	st	%t7, [%dst + (offset) + 0x1c];
+
+#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	ldd	[%src + (offset) + 0x10], %t4; \
+	ldd	[%src + (offset) + 0x18], %t6; \
+	std	%t0, [%dst + (offset) + 0x00]; \
+	std	%t2, [%dst + (offset) + 0x08]; \
+	std	%t4, [%dst + (offset) + 0x10]; \
+	std	%t6, [%dst + (offset) + 0x18];
+
+#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
+	ldd	[%src - (offset) - 0x10], %t0; \
+	ldd	[%src - (offset) - 0x08], %t2; \
+	st	%t0, [%dst - (offset) - 0x10]; \
+	st	%t1, [%dst - (offset) - 0x0c]; \
+	st	%t2, [%dst - (offset) - 0x08]; \
+	st	%t3, [%dst - (offset) - 0x04];
+
+#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
+	ldd	[%src - (offset) - 0x10], %t0; \
+	ldd	[%src - (offset) - 0x08], %t2; \
+	std	%t0, [%dst - (offset) - 0x10]; \
+	std	%t2, [%dst - (offset) - 0x08];
+
+#define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
+	ldub	[%src - (offset) - 0x02], %t0; \
+	ldub	[%src - (offset) - 0x01], %t1; \
+	stb	%t0, [%dst - (offset) - 0x02]; \
+	stb	%t1, [%dst - (offset) - 0x01];
 
 /* Both these macros have to start with exactly the same insn */
-#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) 				\
-	ldd	[%src - offset - 0x20], %t0; 								\
-	ldd	[%src - offset - 0x18], %t2; 								\
-	ldd	[%src - offset - 0x10], %t4; 								\
-	ldd	[%src - offset - 0x08], %t6; 								\
-	st	%t0, [%dst - offset - 0x20]; 								\
-	st	%t1, [%dst - offset - 0x1c]; 								\
-	st	%t2, [%dst - offset - 0x18]; 								\
-	st	%t3, [%dst - offset - 0x14]; 								\
-	st	%t4, [%dst - offset - 0x10]; 								\
-	st	%t5, [%dst - offset - 0x0c]; 								\
-	st	%t6, [%dst - offset - 0x08]; 								\
-	st	%t7, [%dst - offset - 0x04];
-
-#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) 				\
-	ldd	[%src - offset - 0x20], %t0; 								\
-	ldd	[%src - offset - 0x18], %t2; 								\
-	ldd	[%src - offset - 0x10], %t4; 								\
-	ldd	[%src - offset - 0x08], %t6; 								\
-	std	%t0, [%dst - offset - 0x20]; 								\
-	std	%t2, [%dst - offset - 0x18]; 								\
-	std	%t4, [%dst - offset - 0x10]; 								\
-	std	%t6, [%dst - offset - 0x08];
-
-#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) 						\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	st	%t0, [%dst + offset + 0x00]; 								\
-	st	%t1, [%dst + offset + 0x04]; 								\
-	st	%t2, [%dst + offset + 0x08]; 								\
-	st	%t3, [%dst + offset + 0x0c];
-
-#define RMOVE_SHORTCHUNK(src, dst, offset, t0, t1) 							\
-	ldub	[%src + offset + 0x00], %t0; 								\
-	ldub	[%src + offset + 0x01], %t1; 								\
-	stb	%t0, [%dst + offset + 0x00]; 								\
-	stb	%t1, [%dst + offset + 0x01];
-
-#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) 		\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	srl	%t0, shir, %t5; 									\
-	srl	%t1, shir, %t6; 									\
-	sll	%t0, shil, %t0; 									\
-	or	%t5, %prev, %t5; 									\
-	sll	%t1, shil, %prev; 									\
-	or	%t6, %t0, %t0; 										\
-	srl	%t2, shir, %t1; 									\
-	srl	%t3, shir, %t6; 									\
-	sll	%t2, shil, %t2; 									\
-	or	%t1, %prev, %t1; 									\
-	std	%t4, [%dst + offset + offset2 - 0x04]; 							\
-	std	%t0, [%dst + offset + offset2 + 0x04];							\
-	sll	%t3, shil, %prev; 									\
+#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
+	ldd	[%src - (offset) - 0x20], %t0; \
+	ldd	[%src - (offset) - 0x18], %t2; \
+	ldd	[%src - (offset) - 0x10], %t4; \
+	ldd	[%src - (offset) - 0x08], %t6; \
+	st	%t0, [%dst - (offset) - 0x20]; \
+	st	%t1, [%dst - (offset) - 0x1c]; \
+	st	%t2, [%dst - (offset) - 0x18]; \
+	st	%t3, [%dst - (offset) - 0x14]; \
+	st	%t4, [%dst - (offset) - 0x10]; \
+	st	%t5, [%dst - (offset) - 0x0c]; \
+	st	%t6, [%dst - (offset) - 0x08]; \
+	st	%t7, [%dst - (offset) - 0x04];
+
+#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
+	ldd	[%src - (offset) - 0x20], %t0; \
+	ldd	[%src - (offset) - 0x18], %t2; \
+	ldd	[%src - (offset) - 0x10], %t4; \
+	ldd	[%src - (offset) - 0x08], %t6; \
+	std	%t0, [%dst - (offset) - 0x20]; \
+	std	%t2, [%dst - (offset) - 0x18]; \
+	std	%t4, [%dst - (offset) - 0x10]; \
+	std	%t6, [%dst - (offset) - 0x08];
+
+#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	st	%t0, [%dst + (offset) + 0x00]; \
+	st	%t1, [%dst + (offset) + 0x04]; \
+	st	%t2, [%dst + (offset) + 0x08]; \
+	st	%t3, [%dst + (offset) + 0x0c];
+
+#define RMOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
+	ldub	[%src + (offset) + 0x00], %t0; \
+	ldub	[%src + (offset) + 0x01], %t1; \
+	stb	%t0, [%dst + (offset) + 0x00]; \
+	stb	%t1, [%dst + (offset) + 0x01];
+
+#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	srl	%t0, shir, %t5; \
+	srl	%t1, shir, %t6; \
+	sll	%t0, shil, %t0; \
+	or	%t5, %prev, %t5; \
+	sll	%t1, shil, %prev; \
+	or	%t6, %t0, %t0; \
+	srl	%t2, shir, %t1; \
+	srl	%t3, shir, %t6; \
+	sll	%t2, shil, %t2; \
+	or	%t1, %prev, %t1; \
+	std	%t4, [%dst + (offset) + (offset2) - 0x04]; \
+	std	%t0, [%dst + (offset) + (offset2) + 0x04]; \
+	sll	%t3, shil, %prev; \
 	or	%t6, %t2, %t4;
 
-#define SMOVE_ALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) 	\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	srl	%t0, shir, %t4; 									\
-	srl	%t1, shir, %t5; 									\
-	sll	%t0, shil, %t6; 									\
-	or	%t4, %prev, %t0; 									\
-	sll	%t1, shil, %prev; 									\
-	or	%t5, %t6, %t1; 										\
-	srl	%t2, shir, %t4; 									\
-	srl	%t3, shir, %t5; 									\
-	sll	%t2, shil, %t6; 									\
-	or	%t4, %prev, %t2; 									\
-	sll	%t3, shil, %prev; 									\
-	or	%t5, %t6, %t3;										\
-	std	%t0, [%dst + offset + offset2 + 0x00]; 							\
-	std	%t2, [%dst + offset + offset2 + 0x08];
+#define SMOVE_ALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	srl	%t0, shir, %t4;	\
+	srl	%t1, shir, %t5;	\
+	sll	%t0, shil, %t6;	\
+	or	%t4, %prev, %t0; \
+	sll	%t1, shil, %prev; \
+	or	%t5, %t6, %t1; \
+	srl	%t2, shir, %t4;	\
+	srl	%t3, shir, %t5;	\
+	sll	%t2, shil, %t6; \
+	or	%t4, %prev, %t2; \
+	sll	%t3, shil, %prev; \
+	or	%t5, %t6, %t3; \
+	std	%t0, [%dst + (offset) + (offset2) + 0x00]; \
+	std	%t2, [%dst + (offset) + (offset2) + 0x08];
 
 	.text
 	.align	4

  reply	other threads:[~2004-08-05  5:04 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-02  8:55 2.6.8-rc2-mm2 Andrew Morton
2004-08-02  9:23 ` 2.6.8-rc2-mm2 Espen Fjellvær Olsen
2004-08-02 12:10 ` 2.6.8-rc2-mm2 Rik van Riel
2004-08-05 10:56   ` 2.6.8-rc2-mm2 Hideo AOKI
2004-08-05 12:55     ` 2.6.8-rc2-mm2 Hideo AOKI
2004-08-02 13:07 ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-03  6:43   ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-03  7:35     ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-03  7:43       ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-03  7:45       ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-04  8:35         ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-04 10:12           ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-04 10:33             ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-04 11:42               ` 2.6.8-rc2-mm2 bert hubert
2004-08-05  1:21                 ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-04 10:31           ` 2.6.8-rc2-mm2 Ingo Molnar
2004-08-04 10:46             ` 2.6.8-rc2-mm2 Nick Piggin
2004-08-04 10:47             ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-04 12:45               ` 2.6.8-rc2-mm2 Ingo Molnar
2004-08-05  2:53                 ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-05  8:34                   ` 2.6.8-rc2-mm2 Helge Hafting
2004-08-05  9:34                     ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-05 10:47                   ` 2.6.8-rc2-mm2 Ingo Molnar
2004-08-02 13:52 ` 2.6.8-rc2-mm2 William Lee Irwin III
2004-08-02 16:12   ` 2.6.8-rc2-mm2 William Lee Irwin III
2004-08-02 14:28 ` 2.6.8-rc2-mm2 William Lee Irwin III
2004-08-02 15:31 ` 2.6.8-rc2-mm2 Mark Watts
2004-08-02 15:33   ` 2.6.8-rc2-mm2 Jesper Juhl
2004-08-02 15:38   ` 2.6.8-rc2-mm2 Dominik Karall
2004-08-02 16:02     ` 2.6.8-rc2-mm2 Mark Watts
2004-08-03  6:55   ` 2.6.8-rc2-mm2 Clemens Schwaighofer
2004-08-02 15:57 ` 2.6.8-rc2-mm2 Martin Zwickel
2004-08-02 17:59 ` 2.6.8-rc2-mm2 (compile stats) John Cherry
2004-08-02 18:15 ` 2.6.8-rc2-mm2 Peter Osterlund
2004-08-02 22:16 ` [patch] 2.6.8-rc2-mm2: compile error with SWAP=n Adrian Bunk
2004-08-03  8:27 ` 2.6.8-rc2-mm2 Mark Watts
2004-08-03 13:05   ` 2.6.8-rc2-mm2 R. J. Wysocki
2004-08-03 13:13 ` 2.6.8-rc2-mm2 Con Kolivas
2004-08-03 19:44 ` 2.6.8-rc2-mm2 Adrian Bunk
2004-08-04 16:32 ` 2.6.8-rc2-mm2 Dominik Karall
2004-08-05  4:38 ` [sparc32] [1/13] turbosparc flush warnings William Lee Irwin III
2004-08-05  4:39   ` [sparc32] [2/13] sparc32 init_idle() William Lee Irwin III
2004-08-05  4:41     ` [sparc32] [3/13] sun4d cpu_present_map is a cpumask_t William Lee Irwin III
2004-08-05  4:44       ` [sparc32] [4/13] smp_processor_id() BITFIXUP fixes William Lee Irwin III
2004-08-05  4:46         ` [sparc32] [5/13] reinstate smp_reschedule_irq() William Lee Irwin III
2004-08-05  4:47           ` [sparc32] [6/13] remove references to start_secondary() William Lee Irwin III
2004-08-05  4:48             ` [sparc32] [7/13] remove references to num_context_patch2 William Lee Irwin III
2004-08-05  4:49               ` [sparc32] [8/13] define cache_decay_ticks William Lee Irwin III
2004-08-05  4:54                 ` [sparc32] [9/13] remove unused variable in dvma.c William Lee Irwin III
2004-08-05  4:55                   ` [sparc32] [10/13] sun4 does not support SMP William Lee Irwin III
2004-08-05  4:56                     ` [sparc32] [11/13] make CONFIG_SMP depend on CONFIG_BROKEN William Lee Irwin III
2004-08-05  5:01                       ` William Lee Irwin III [this message]
2004-08-05  5:31                         ` [sparc32] [13/13] ignore undefined symbols with 3 or more leading underscores William Lee Irwin III
2004-08-05  7:28                         ` [sparc32] [12/13] gcc-3.3 macro parenthesization fix for memcpy.S Jakub Jelinek
2004-08-05  7:38                           ` William Lee Irwin III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040805050141.GD2334@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox