Skip to contentSkip to conversation

m68k: fix macro syntax to make current binutils happy

PATCH In review Al Viro 2 participants 5 messages Jan 3, 2006 – Jan 8, 2006 m68k architecture

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 8/41 m68k: fix macro syntax to make current binutils happy

From: Al Viro <[email protected]>
Date: 1134413482 -0500

recent as(1) doesn't think that . terminates a macro name, so getuser.l is _not_ treated as invoking getuser with .l as the first argument.

---

 arch/m68k/math-emu/fp_cond.S   |    2 +-
 arch/m68k/math-emu/fp_decode.h |    4 ++--
 arch/m68k/math-emu/fp_move.S   |   14 +++++++-------
 arch/m68k/math-emu/fp_movem.S  |   16 ++++++++--------
 arch/m68k/math-emu/fp_scan.S   |   22 +++++++++++-----------
 arch/m68k/math-emu/fp_util.S   |   16 ++++++++--------
 6 files changed, 37 insertions(+), 37 deletions(-)

3c4ab44571b5a46917ad28620995c326e386a909

arch/m68k/math-emu/fp_cond.S +1 -1
index ddae8b1..1cddeb0 100644
@@ -163,7 +163,7 @@ fp_absolute_long:
 
 fp_do_scc:
 	swap	%d1
-	putuser.b %d1,(%a0),fp_err_ua1,%a0
+	putuser .b,%d1,(%a0),fp_err_ua1,%a0
 	printf	PDECODE,"\n"
 	jra	fp_end
 
arch/m68k/math-emu/fp_decode.h +2 -2
index 759679d..a2595d9 100644
@@ -311,7 +311,7 @@ debug	move.l	"(%sp)+,%d1"
 	btst	#2,%d2
 	jne	1f
 	printf	PDECODE,")@("
-	getuser.l (%a1),%a1,fp_err_ua1,%a1
+	getuser .l,(%a1),%a1,fp_err_ua1,%a1
 debug	jra	"2f"
 1:	printf	PDECODE,","
 2:
@@ -322,7 +322,7 @@ debug	jra	"2f"
 	btst	#2,%d2
 	jeq	1f
 	printf	PDECODE,")@("
-	getuser.l (%a1),%a1,fp_err_ua1,%a1
+	getuser .l,(%a1),%a1,fp_err_ua1,%a1
 debug	jra	"2f"
 1:	printf	PDECODE,","
 2:
arch/m68k/math-emu/fp_move.S +7 -7
index 71bdf83..9bd0334 100644
@@ -200,12 +200,12 @@ fp_putdest:
 
 fp_format_long:
 	jsr	fp_conv_ext2long
-	putuser.l %d0,(%a1),fp_err_ua1,%a1
+	putuser .l,%d0,(%a1),fp_err_ua1,%a1
 	jra	fp_finish_move
 
 fp_format_single:
 	jsr	fp_conv_ext2single
-	putuser.l %d0,(%a1),fp_err_ua1,%a1
+	putuser .l,%d0,(%a1),fp_err_ua1,%a1
 	jra	fp_finish_move
 
 fp_format_extended:
@@ -213,11 +213,11 @@ fp_format_extended:
 	lsl.w	#1,%d0
 	lsl.l	#7,%d0
 	lsl.l	#8,%d0
-	putuser.l %d0,(%a1)+,fp_err_ua1,%a1
+	putuser .l,%d0,(%a1)+,fp_err_ua1,%a1
 	move.l	(%a0)+,%d0
-	putuser.l %d0,(%a1)+,fp_err_ua1,%a1
+	putuser .l,%d0,(%a1)+,fp_err_ua1,%a1
 	move.l	(%a0),%d0
-	putuser.l %d0,(%a1),fp_err_ua1,%a1
+	putuser .l,%d0,(%a1),fp_err_ua1,%a1
 	jra	fp_finish_move
 
 fp_format_packed:
@@ -227,7 +227,7 @@ fp_format_packed:
 
 fp_format_word:
 	jsr	fp_conv_ext2short
-	putuser.w %d0,(%a1),fp_err_ua1,%a1
+	putuser .w,%d0,(%a1),fp_err_ua1,%a1
 	jra	fp_finish_move
 
 fp_format_double:
@@ -236,7 +236,7 @@ fp_format_double:
 
 fp_format_byte:
 	jsr	fp_conv_ext2byte
-	putuser.b %d0,(%a1),fp_err_ua1,%a1
+	putuser .b,%d0,(%a1),fp_err_ua1,%a1
 |	jra	fp_finish_move
 
 fp_finish_move:
arch/m68k/math-emu/fp_movem.S +8 -8
index 8354d39..9c74134 100644
@@ -141,14 +141,14 @@ fpr_do_movem:
 	| move register from memory into fpu
 	jra	3f
 1:	printf	PMOVEM,"(%p>%p)",2,%a0,%a1
-	getuser.l (%a0)+,%d2,fp_err_ua1,%a0
+	getuser .l,(%a0)+,%d2,fp_err_ua1,%a0
 	lsr.l	#8,%d2
 	lsr.l	#7,%d2
 	lsr.w	#1,%d2
 	move.l	%d2,(%a1)+
-	getuser.l (%a0)+,%d2,fp_err_ua1,%a0
+	getuser .l,(%a0)+,%d2,fp_err_ua1,%a0
 	move.l	%d2,(%a1)+
-	getuser.l (%a0),%d2,fp_err_ua1,%a0
+	getuser .l,(%a0),%d2,fp_err_ua1,%a0
 	move.l	%d2,(%a1)
 	subq.l	#8,%a0
 	subq.l	#8,%a1
@@ -164,11 +164,11 @@ fpr_do_movem:
 	lsl.w	#1,%d2
 	lsl.l	#7,%d2
 	lsl.l	#8,%d2
-	putuser.l %d2,(%a0)+,fp_err_ua1,%a0
+	putuser .l,%d2,(%a0)+,fp_err_ua1,%a0
 	move.l	(%a1)+,%d2
-	putuser.l %d2,(%a0)+,fp_err_ua1,%a0
+	putuser .l,%d2,(%a0)+,fp_err_ua1,%a0
 	move.l	(%a1),%d2
-	putuser.l %d2,(%a0),fp_err_ua1,%a0
+	putuser .l,%d2,(%a0),fp_err_ua1,%a0
 	subq.l	#8,%a1
 	subq.l	#8,%a0
 	add.l	%d0,%a0
@@ -325,7 +325,7 @@ fpc_do_movem:
 	| move register from memory into fpu
 	jra	3f
 1:	printf	PMOVEM,"(%p>%p)",2,%a0,%a1
-	getuser.l (%a0)+,%d0,fp_err_ua1,%a0
+	getuser .l,(%a0)+,%d0,fp_err_ua1,%a0
 	move.l	%d0,(%a1)
 2:	addq.l	#4,%a1
 3:	lsl.b	#1,%d1
@@ -336,7 +336,7 @@ fpc_do_movem:
 	| move register from fpu into memory
 1:	printf	PMOVEM,"(%p>%p)",2,%a1,%a0
 	move.l	(%a1),%d0
-	putuser.l %d0,(%a0)+,fp_err_ua1,%a0
+	putuser .l,%d0,(%a0)+,fp_err_ua1,%a0
 2:	addq.l	#4,%a1
 4:	lsl.b	#1,%d1
 	jcs	1b
arch/m68k/math-emu/fp_scan.S +11 -11
index e4146ed..5f49b93 100644
@@ -64,7 +64,7 @@ fp_scan:
 | normal fpu instruction? (this excludes fsave/frestore)
 	fp_get_pc %a0
 	printf	PDECODE,"%08x: ",1,%a0
-	getuser.b (%a0),%d0,fp_err_ua1,%a0
+	getuser .b,(%a0),%d0,fp_err_ua1,%a0
 #if 1
 	cmp.b	#0xf2,%d0		| cpid = 1
 #else
@@ -72,7 +72,7 @@ fp_scan:
 #endif
 	jne	fp_nonstd
 | first two instruction words are kept in %d2
-	getuser.l (%a0)+,%d2,fp_err_ua1,%a0
+	getuser .l,(%a0)+,%d2,fp_err_ua1,%a0
 	fp_put_pc %a0
 fp_decode_cond:				| separate conditional instr
 	fp_decode_cond_instr_type
@@ -230,7 +230,7 @@ fp_immediate:
 	movel	%a0,%a1
 	clr.l	%d1
 	jra	2f
-1:	getuser.b (%a1)+,%d1,fp_err_ua1,%a1
+1:	getuser .b,(%a1)+,%d1,fp_err_ua1,%a1
 	printf	PDECODE,"%02x",1,%d1
 2:	dbra	%d0,1b
 	movem.l	(%sp)+,%d0/%d1
@@ -252,24 +252,24 @@ fp_fetchsource:
 	.long	fp_byte, fp_ill
 
 fp_long:
-	getuser.l (%a1),%d0,fp_err_ua1,%a1
+	getuser .l,(%a1),%d0,fp_err_ua1,%a1
 	jsr	fp_conv_long2ext
 	jra	fp_getdest
 
 fp_single:
-	getuser.l (%a1),%d0,fp_err_ua1,%a1
+	getuser .l,(%a1),%d0,fp_err_ua1,%a1
 	jsr	fp_conv_single2ext
 	jra	fp_getdest
 
 fp_ext:
-	getuser.l (%a1)+,%d0,fp_err_ua1,%a1
+	getuser .l,(%a1)+,%d0,fp_err_ua1,%a1
 	lsr.l	#8,%d0
 	lsr.l	#7,%d0
 	lsr.w	#1,%d0
 	move.l	%d0,(%a0)+
-	getuser.l (%a1)+,%d0,fp_err_ua1,%a1
+	getuser .l,(%a1)+,%d0,fp_err_ua1,%a1
 	move.l	%d0,(%a0)+
-	getuser.l (%a1),%d0,fp_err_ua1,%a1
+	getuser .l,(%a1),%d0,fp_err_ua1,%a1
 	move.l	%d0,(%a0)
 	subq.l	#8,%a0
 	jra	fp_getdest
@@ -279,7 +279,7 @@ fp_pack:
 	jra	fp_ill
 
 fp_word:
-	getuser.w (%a1),%d0,fp_err_ua1,%a1
+	getuser .w,(%a1),%d0,fp_err_ua1,%a1
 	ext.l	%d0
 	jsr	fp_conv_long2ext
 	jra	fp_getdest
@@ -289,7 +289,7 @@ fp_double:
 	jra	fp_getdest
 
 fp_byte:
-	getuser.b (%a1),%d0,fp_err_ua1,%a1
+	getuser .b,(%a1),%d0,fp_err_ua1,%a1
 	extb.l	%d0
 	jsr	fp_conv_long2ext
 |	jra	fp_getdest
@@ -465,7 +465,7 @@ fp_fdsub:
 
 fp_nonstd:
 	fp_get_pc %a0
-	getuser.l (%a0),%d0,fp_err_ua1,%a0
+	getuser .l,(%a0),%d0,fp_err_ua1,%a0
 	printf	,"nonstd ((%08x)=%08x)\n",2,%a0,%d0
 	moveq	#-1,%d0
 	rts
arch/m68k/math-emu/fp_util.S +8 -8
index a9f7f01..f9f24d5 100644
@@ -160,11 +160,11 @@ fp_s2e_large:
 
 fp_conv_double2ext:
 #ifdef FPU_EMU_DEBUG
-	getuser.l %a1@(0),%d0,fp_err_ua2,%a1
-	getuser.l %a1@(4),%d1,fp_err_ua2,%a1
+	getuser .l,%a1@(0),%d0,fp_err_ua2,%a1
+	getuser .l,%a1@(4),%d1,fp_err_ua2,%a1
 	printf	PCONV,"d2e: %p%p -> %p(",3,%d0,%d1,%a0
 #endif
-	getuser.l (%a1)+,%d0,fp_err_ua2,%a1
+	getuser .l,(%a1)+,%d0,fp_err_ua2,%a1
 	move.l	%d0,%d1
 	lsl.l	#8,%d0			| shift high mantissa
 	lsl.l	#3,%d0
@@ -178,7 +178,7 @@ fp_conv_double2ext:
 	add.w	#0x3fff-0x3ff,%d1	| re-bias the exponent.
 9:	move.l	%d1,(%a0)+		| fp_ext.sign, fp_ext.exp
 	move.l	%d0,(%a0)+
-	getuser.l (%a1)+,%d0,fp_err_ua2,%a1
+	getuser .l,(%a1)+,%d0,fp_err_ua2,%a1
 	move.l	%d0,%d1
 	lsl.l	#8,%d0
 	lsl.l	#3,%d0
@@ -1287,17 +1287,17 @@ fp_conv_ext2double:
 	lsr.l	#4,%d0
 	lsr.l	#8,%d0
 	or.l	%d2,%d0
-	putuser.l %d0,(%a1)+,fp_err_ua2,%a1
+	putuser .l,%d0,(%a1)+,fp_err_ua2,%a1
 	moveq	#21,%d0
 	lsl.l	%d0,%d1
 	move.l	(%a0),%d0
 	lsr.l	#4,%d0
 	lsr.l	#7,%d0
 	or.l	%d1,%d0
-	putuser.l %d0,(%a1),fp_err_ua2,%a1
+	putuser .l,%d0,(%a1),fp_err_ua2,%a1
 #ifdef FPU_EMU_DEBUG
-	getuser.l %a1@(-4),%d0,fp_err_ua2,%a1
-	getuser.l %a1@(0),%d1,fp_err_ua2,%a1
+	getuser .l,%a1@(-4),%d0,fp_err_ua2,%a1
+	getuser .l,%a1@(0),%d1,fp_err_ua2,%a1
 	printf	PCONV,"%p(%08x%08x)\n",3,%a1,%d0,%d1
 #endif
 	rts
Signature · 1 line
0.99.9.GIT
#1 lore raw

Hi,

Quoted 3 lines · Al Viro

recent as(1) doesn't think that . terminates a macro name, so getuser.l is _not_ treated as invoking getuser with .l as the first argument.

Al, please don't send the binutils patches yet, I simply need more time to figure out how to deal with it and it's not a critical patch. Linus, please don't apply patch 8 and 9.

bye, Roman

author
#2 lore raw
Quoted 11 lines · Roman Zippel

Hi,

Quoted 3 lines · Al Viro

recent as(1) doesn't think that . terminates a macro name, so getuser.l is _not_ treated as invoking getuser with .l as the first argument.

Al, please don't send the binutils patches yet, I simply need more time to figure out how to deal with it and it's not a critical patch. Linus, please don't apply patch 8 and 9.

OK. Nothing else depends on those; however, getuser.l stuff _is_ documented.

Frankly, my preference long-term would be to kill the .macro and just use C preprocessor for expansion. Do you have any objections against such variant?

author
#3 lore raw
Quoted 13 lines · Al Viro
Quoted 11 lines · Roman Zippel

Hi,

Quoted 3 lines · Al Viro

recent as(1) doesn't think that . terminates a macro name, so getuser.l is _not_ treated as invoking getuser with .l as the first argument.

Al, please don't send the binutils patches yet, I simply need more time to figure out how to deal with it and it's not a critical patch. Linus, please don't apply patch 8 and 9.

Quoted 5 lines

OK. Nothing else depends on those; however, getuser.l stuff _is_ documented.

Frankly, my preference long-term would be to kill the .macro and just use C preprocessor for expansion. Do you have any objections against such variant?

Scratch that; too much PITA to implement the horrors you've got there (vararg recursive macros <shudder>).

Al, very tempted to do scripts/m4/ - would far more compact than e.g. kconfig, if we don't bother with GNU extensions; classic m4 is essentially a weekend project...

#4 lore raw

Hi,

Quoted 2 lines · Al Viro
Quoted 2 lines

OK. Nothing else depends on those; however, getuser.l stuff _is_ documented.

It actually was a nice feature and what I have seen so far look like bad regression and makes the gas macros totally useless. Before it was possible to define some pseudo assembly instructions, but if one can't pass some simple address operand without quotes as an argument anymore...

Quoted 6 lines
Quoted 3 lines

Frankly, my preference long-term would be to kill the .macro and just use C preprocessor for expansion. Do you have any objections against such variant?

Scratch that; too much PITA to implement the horrors you've got there (vararg recursive macros <shudder>).

Well, at that the time I wrote it, it very nicely cleaned up the old code (which was even worse) and made additions very simple. The recursive macros avoided a lot of simple typos. I'm not really happy that I have to change that, it worked fine so far.
BTW I'm back in a few days and my online connectivity is rather limited right now, so I hadn't really a good possibility to research the possible options yet.

bye, Roman