This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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] |
On Mon, 2005-02-28 at 20:25, Alan Modra wrote: > When building with a 64-bit bfd, sleb128 and quad tests fail on m68k > targets, because something like > .sleb128 0x80000000 > has the constant sign extendend due to a peculiarity of m68k gas (grep > for TARGET_WORD_SIZE) as if you'd written > .sleb128 0xffffffff80000000 That reminds me of something I recently noticed in the h8300 port. I was investigating a compiler problem, and tried building the h8300 port on a lark to see if it could reproduce it. Unfortunately, I discovered that the port does not work on a 64-bit host. One of the problems is that the h8300 gas port uses internal masks like 0xffffff00 which is intended to be -256. That works fine on a 32-bit host, but not on a 64-bit host, where this is a large positive number instead of a small negative one. The other related problem is that the testsuite contains similar numbers. See for instance the file h8sx_mov_insn.s in the gas/testsuite/gas/h8300 directory. It contains mov.b #foo,@0xffff8000 which is supposed to be assembled into a 16-bit immediate field, but on a 64-bit host that is a large positive number which requires a 32-bit immediate field. This causes the test to fail. Perhaps something similar happened with the m68k port. The problem isn't obvious, since the code will still assemble, it just gets assembled into larger less efficient code. You can't tell there is a problem unless you look at the binary instruction encodings to see that the wrong immediate form was used. In fact, this does seem to be the case. It was easy to generate an example. Follows is two typescripts, one generated from before updating binutils, one generated from after updating binutils. Note that the first one assembles into a 32-bit instruction, but the second one assembles into a 48-bit instruction. This is on an x86-64 linux machine. -- Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
Attachment:
orig-typescript
Description: Text document
Attachment:
typescript
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |