public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* x86-like target
@ 2004-10-25 15:58 Stan Cox
  2004-10-25 16:02 ` Frank Ch. Eigler
  0 siblings, 1 reply; 2+ messages in thread
From: Stan Cox @ 2004-10-25 15:58 UTC (permalink / raw)
  To: cgen


What is the best way to handle an x86 like target wrt endianness?  By
x86 like I mean: 
1. instructions are variable length "big endian" bytestreams
2. immediate and address fields within instructions are little endian
3. the processor is little endian

Defining as:
  (default-insn-bitsize 32)
  (base-insn-bitsize 32)
  (default-insn-word-bitsize 32)
  derived/anyof operands
  big endian bfd
  pass CGEN_ENDIAN_BIG to m16c_cgen_cpu_open  
assembles instructions correctly except immediates and displacements
are, of course, big endian.  Changing:
  little endian bfd
  pass CGEN_ENDIAN_BIG to m16c_cgen_cpu_open  
  set BFD_ENDIAN_BIG in disassemble.c
assembles instructions correctly except immediates and displacements
are still not correct and relocations cannot be handled by
the generic relocation handler since instruction bytes are now fetched
in little endian order. 

What is the best way to support this so that immediates from cgen,
addresses from gas, and addresses and relocations from ld are all handled
correctly? 


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

* Re: x86-like target
  2004-10-25 15:58 x86-like target Stan Cox
@ 2004-10-25 16:02 ` Frank Ch. Eigler
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Ch. Eigler @ 2004-10-25 16:02 UTC (permalink / raw)
  To: Stan Cox; +Cc: cgen

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

Hi -

> [...one configuration...]
> assembles instructions correctly except immediates and displacements
> are, of course, big endian.
> [...another configuration...]
> assembles instructions correctly except immediates and displacements
> are still not correct and relocations cannot be handled by
> the generic relocation handler since instruction bytes are now fetched
> in little endian order. 
> [...]

Have you tried custom ifield inserters/extractors?
Probably the first configuration is a better fit.

- FChE

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2004-10-25 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-25 15:58 x86-like target Stan Cox
2004-10-25 16:02 ` Frank Ch. Eigler

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).