public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: Gas is broken for x86-64
@ 2004-11-08  8:20 Jan Beulich
  2004-11-08  8:38 ` Alan Modra
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2004-11-08  8:20 UTC (permalink / raw)
  To: hjl; +Cc: binutils

>>> "H. J. Lu" <hjl@lucon.org> 06.11.04 00:17:59 >>>
>On Fri, Nov 05, 2004 at 03:04:29PM -0800, H. J. Lu wrote:
>> On Fri, Nov 05, 2004 at 03:00:27PM -0800, H. J. Lu wrote:
>> > On Fri, Nov 05, 2004 at 02:47:58PM -0800, H. J. Lu wrote:
>> > > Hi Jan,
>> > > 
>> > > Your i386 opcode change breaks x86-64. I got
>> > > 
>> > > [hjl@gnu-64 gas]$ cat /tmp/x.s
>> > > movzb (%rax),%edx
>> > > [hjl@gnu-64 gas]$ ./as-new -o x.o /tmp/x.s
>> > > /tmp/x.s: Assembler messages:
>> > > /tmp/x.s:1: Error: no such instruction: `movzb (%rax),%edx'
>> > > 
>> > > 
>> > 
>> > Your patch
>> > 
>> >
http://sources.redhat.com/ml/binutils/2004-11/msg00033/binutils-mainline-x86-intel-syntax.patch

>> > 
>> > removed movzb. It is wrong.

This change was for consistency reasons, as indicated also by an added
comment. If inconsistencies are intentional, then these should be very
clearly marked in my opinion. In this case, since there's no support
for

movsb (%eax), %eax

I can't see why you'd want

movzb (%eax), %eax

>> BTW, do you know what other instructions you have removed? We can't
>> remove any of them unless we have a very good reason.

None.

>I checked in a patch to restore "movzb":
>
>http://sources.redhat.com/ml/binutils-cvs/2004-11/msg00045.html 

I would think your patch should have added both suffix-less movsb and
movzb, or neither.

Jan


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Gas is broken for x86-64
  2004-11-08  8:20 Gas is broken for x86-64 Jan Beulich
@ 2004-11-08  8:38 ` Alan Modra
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Modra @ 2004-11-08  8:38 UTC (permalink / raw)
  To: Jan Beulich; +Cc: hjl, binutils

On Mon, Nov 08, 2004 at 09:20:22AM +0100, Jan Beulich wrote:
> I would think your patch should have added both suffix-less movsb and
> movzb, or neither.

No.  movsb is a string move instruction.  movzb is an abbreviation of
movzbl or movzbw depending on data size.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Gas is broken for x86-64
  2004-11-08  8:55 Jan Beulich
@ 2004-11-08  9:31 ` Alan Modra
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Modra @ 2004-11-08  9:31 UTC (permalink / raw)
  To: Jan Beulich; +Cc: hjl, binutils

On Mon, Nov 08, 2004 at 09:56:13AM +0100, Jan Beulich wrote:
> >>> Alan Modra <amodra@bigpond.net.au> 08.11.04 09:38:07 >>>
> >On Mon, Nov 08, 2004 at 09:20:22AM +0100, Jan Beulich wrote:
> >> I would think your patch should have added both suffix-less movsb
> and
> >> movzb, or neither.
> >
> >No.  movsb is a string move instruction.  movzb is an abbreviation of
> >movzbl or movzbw depending on data size.
> 
> Certainly. But movsb is also a suffix-less variant of movsb[wlq], and

Huh?  Of course it isn't.  We can't allow that precisely because movsb
is a string move.

> since movz and movs are fully in sync with one another, allowing
> abbreviation of one should also allow the same for the other.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Gas is broken for x86-64
@ 2004-11-08  8:55 Jan Beulich
  2004-11-08  9:31 ` Alan Modra
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2004-11-08  8:55 UTC (permalink / raw)
  To: amodra; +Cc: hjl, binutils

>>> Alan Modra <amodra@bigpond.net.au> 08.11.04 09:38:07 >>>
>On Mon, Nov 08, 2004 at 09:20:22AM +0100, Jan Beulich wrote:
>> I would think your patch should have added both suffix-less movsb
and
>> movzb, or neither.
>
>No.  movsb is a string move instruction.  movzb is an abbreviation of
>movzbl or movzbw depending on data size.

Certainly. But movsb is also a suffix-less variant of movsb[wlq], and
since movz and movs are fully in sync with one another, allowing
abbreviation of one should also allow the same for the other.
One of the points here is that the abbreviation (or suffix) guessing
depends on only the mnemonic, not the operands, thus making things like
movsb (movs[bwlq] vs. movsb[wlq]), movsd (movs[bwdq] vs. movs[sd]), or
cmpsd (cmps[bwdq] vs. cmps[sd]) conflict. But there are more such issues
(like AT&T/Intel syntax insns being visible in the opposite mode). I
think some signficiant amount of cleanup work is necessary here, and
I'll try to get to this hopefully not too far in the future.

Jan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Gas is broken for x86-64
  2004-11-06  0:41       ` Daniel Jacobowitz
@ 2004-11-06  1:18         ` H. J. Lu
  0 siblings, 0 replies; 10+ messages in thread
From: H. J. Lu @ 2004-11-06  1:18 UTC (permalink / raw)
  To: jbeulich, binutils

On Fri, Nov 05, 2004 at 07:41:36PM -0500, Daniel Jacobowitz wrote:
> On Fri, Nov 05, 2004 at 03:17:59PM -0800, H. J. Lu wrote:
> > On Fri, Nov 05, 2004 at 03:04:29PM -0800, H. J. Lu wrote:
> > > On Fri, Nov 05, 2004 at 03:00:27PM -0800, H. J. Lu wrote:
> > > > On Fri, Nov 05, 2004 at 02:47:58PM -0800, H. J. Lu wrote:
> > > > > Hi Jan,
> > > > > 
> > > > > Your i386 opcode change breaks x86-64. I got
> > > > > 
> > > > > [hjl@gnu-64 gas]$ cat /tmp/x.s
> > > > > movzb (%rax),%edx
> > > > > [hjl@gnu-64 gas]$ ./as-new -o x.o /tmp/x.s
> > > > > /tmp/x.s: Assembler messages:
> > > > > /tmp/x.s:1: Error: no such instruction: `movzb (%rax),%edx'
> > > > > 
> > > > > 
> > > > 
> > > > Your patch
> > > > 
> > > > http://sources.redhat.com/ml/binutils/2004-11/msg00033/binutils-mainline-x86-intel-syntax.patch
> > > > 
> > > > removed movzb. It is wrong.
> > > 
> > > BTW, do you know what other instructions you have removed? We can't
> > > remove any of them unless we have a very good reason.
> > > 
> > 
> > I checked in a patch to restore "movzb":
> > 
> > http://sources.redhat.com/ml/binutils-cvs/2004-11/msg00045.html
> 
> Then please add this to the testsuite.
> 

Good idea. I will check in this patch shortly.


H.J.
---
2004-11-05  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/i386/general.s: Add movzb.
	* gas/i386/general.l: Updated.

--- gas/i386/general.l.movzb	2000-05-02 10:23:27.000000000 -0700
+++ gas/i386/general.l	2004-11-05 17:14:27.350938946 -0800
@@ -285,6 +285,10 @@
  212 021d 67668984 248C0000 		movl	%eax,140\(%esp\)
  212      00
  213                       	
- 214                       		# Force a good alignment.
- 215 0226 00000000 00000000 		.p2align	4,0
- 215      0000
+ 214                       	.code32
+ 215                       	# Make sure that we won't remove movzb by accident.
+ 216 0226 660FB6F8          		movzb	%al,%di
+ 217 022a 0FB6C8            		movzb	%al,%ecx
+ 218                       	
+ 219                       		# Force a good alignment.
+ 220 022d 000000            		.p2align	4,0
--- gas/i386/general.s.movzb	2000-04-03 09:46:40.000000000 -0700
+++ gas/i386/general.s	2004-11-05 17:14:32.479276317 -0800
@@ -211,5 +211,10 @@
 	leal	-1760(%ebp),%ebx
 	movl	%eax,140(%esp)
 
+.code32
+# Make sure that we won't remove movzb by accident.
+	movzb	%al,%di
+	movzb	%al,%ecx
+
 	# Force a good alignment.
 	.p2align	4,0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Gas is broken for x86-64
  2004-11-05 23:18     ` H. J. Lu
@ 2004-11-06  0:41       ` Daniel Jacobowitz
  2004-11-06  1:18         ` H. J. Lu
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-11-06  0:41 UTC (permalink / raw)
  To: H. J. Lu; +Cc: jbeulich, binutils

On Fri, Nov 05, 2004 at 03:17:59PM -0800, H. J. Lu wrote:
> On Fri, Nov 05, 2004 at 03:04:29PM -0800, H. J. Lu wrote:
> > On Fri, Nov 05, 2004 at 03:00:27PM -0800, H. J. Lu wrote:
> > > On Fri, Nov 05, 2004 at 02:47:58PM -0800, H. J. Lu wrote:
> > > > Hi Jan,
> > > > 
> > > > Your i386 opcode change breaks x86-64. I got
> > > > 
> > > > [hjl@gnu-64 gas]$ cat /tmp/x.s
> > > > movzb (%rax),%edx
> > > > [hjl@gnu-64 gas]$ ./as-new -o x.o /tmp/x.s
> > > > /tmp/x.s: Assembler messages:
> > > > /tmp/x.s:1: Error: no such instruction: `movzb (%rax),%edx'
> > > > 
> > > > 
> > > 
> > > Your patch
> > > 
> > > http://sources.redhat.com/ml/binutils/2004-11/msg00033/binutils-mainline-x86-intel-syntax.patch
> > > 
> > > removed movzb. It is wrong.
> > 
> > BTW, do you know what other instructions you have removed? We can't
> > remove any of them unless we have a very good reason.
> > 
> 
> I checked in a patch to restore "movzb":
> 
> http://sources.redhat.com/ml/binutils-cvs/2004-11/msg00045.html

Then please add this to the testsuite.

-- 
Daniel Jacobowitz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Gas is broken for x86-64
  2004-11-05 23:04   ` H. J. Lu
@ 2004-11-05 23:18     ` H. J. Lu
  2004-11-06  0:41       ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: H. J. Lu @ 2004-11-05 23:18 UTC (permalink / raw)
  To: jbeulich; +Cc: binutils

On Fri, Nov 05, 2004 at 03:04:29PM -0800, H. J. Lu wrote:
> On Fri, Nov 05, 2004 at 03:00:27PM -0800, H. J. Lu wrote:
> > On Fri, Nov 05, 2004 at 02:47:58PM -0800, H. J. Lu wrote:
> > > Hi Jan,
> > > 
> > > Your i386 opcode change breaks x86-64. I got
> > > 
> > > [hjl@gnu-64 gas]$ cat /tmp/x.s
> > > movzb (%rax),%edx
> > > [hjl@gnu-64 gas]$ ./as-new -o x.o /tmp/x.s
> > > /tmp/x.s: Assembler messages:
> > > /tmp/x.s:1: Error: no such instruction: `movzb (%rax),%edx'
> > > 
> > > 
> > 
> > Your patch
> > 
> > http://sources.redhat.com/ml/binutils/2004-11/msg00033/binutils-mainline-x86-intel-syntax.patch
> > 
> > removed movzb. It is wrong.
> 
> BTW, do you know what other instructions you have removed? We can't
> remove any of them unless we have a very good reason.
> 

I checked in a patch to restore "movzb":

http://sources.redhat.com/ml/binutils-cvs/2004-11/msg00045.html


H.J.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Gas is broken for x86-64
  2004-11-05 23:00 ` H. J. Lu
@ 2004-11-05 23:04   ` H. J. Lu
  2004-11-05 23:18     ` H. J. Lu
  0 siblings, 1 reply; 10+ messages in thread
From: H. J. Lu @ 2004-11-05 23:04 UTC (permalink / raw)
  To: jbeulich; +Cc: binutils

On Fri, Nov 05, 2004 at 03:00:27PM -0800, H. J. Lu wrote:
> On Fri, Nov 05, 2004 at 02:47:58PM -0800, H. J. Lu wrote:
> > Hi Jan,
> > 
> > Your i386 opcode change breaks x86-64. I got
> > 
> > [hjl@gnu-64 gas]$ cat /tmp/x.s
> > movzb (%rax),%edx
> > [hjl@gnu-64 gas]$ ./as-new -o x.o /tmp/x.s
> > /tmp/x.s: Assembler messages:
> > /tmp/x.s:1: Error: no such instruction: `movzb (%rax),%edx'
> > 
> > 
> 
> Your patch
> 
> http://sources.redhat.com/ml/binutils/2004-11/msg00033/binutils-mainline-x86-intel-syntax.patch
> 
> removed movzb. It is wrong.

BTW, do you know what other instructions you have removed? We can't
remove any of them unless we have a very good reason.


H.J.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Gas is broken for x86-64
  2004-11-05 22:48 H. J. Lu
@ 2004-11-05 23:00 ` H. J. Lu
  2004-11-05 23:04   ` H. J. Lu
  0 siblings, 1 reply; 10+ messages in thread
From: H. J. Lu @ 2004-11-05 23:00 UTC (permalink / raw)
  To: jbeulich; +Cc: binutils

On Fri, Nov 05, 2004 at 02:47:58PM -0800, H. J. Lu wrote:
> Hi Jan,
> 
> Your i386 opcode change breaks x86-64. I got
> 
> [hjl@gnu-64 gas]$ cat /tmp/x.s
> movzb (%rax),%edx
> [hjl@gnu-64 gas]$ ./as-new -o x.o /tmp/x.s
> /tmp/x.s: Assembler messages:
> /tmp/x.s:1: Error: no such instruction: `movzb (%rax),%edx'
> 
> 

Your patch

http://sources.redhat.com/ml/binutils/2004-11/msg00033/binutils-mainline-x86-intel-syntax.patch

removed movzb. It is wrong.

H.J.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Gas is broken for x86-64
@ 2004-11-05 22:48 H. J. Lu
  2004-11-05 23:00 ` H. J. Lu
  0 siblings, 1 reply; 10+ messages in thread
From: H. J. Lu @ 2004-11-05 22:48 UTC (permalink / raw)
  To: jbeulich; +Cc: binutils

Hi Jan,

Your i386 opcode change breaks x86-64. I got

[hjl@gnu-64 gas]$ cat /tmp/x.s
movzb (%rax),%edx
[hjl@gnu-64 gas]$ ./as-new -o x.o /tmp/x.s
/tmp/x.s: Assembler messages:
/tmp/x.s:1: Error: no such instruction: `movzb (%rax),%edx'


H.J.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-11-08  9:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-08  8:20 Gas is broken for x86-64 Jan Beulich
2004-11-08  8:38 ` Alan Modra
  -- strict thread matches above, loose matches on Subject: below --
2004-11-08  8:55 Jan Beulich
2004-11-08  9:31 ` Alan Modra
2004-11-05 22:48 H. J. Lu
2004-11-05 23:00 ` H. J. Lu
2004-11-05 23:04   ` H. J. Lu
2004-11-05 23:18     ` H. J. Lu
2004-11-06  0:41       ` Daniel Jacobowitz
2004-11-06  1:18         ` H. J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).