public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* sid, base_insn vs entire_insn and ambiguity
@ 2008-06-25  7:36 Aurélien Buhrig
       [not found] ` <486114F4.1040309@redhat.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Aurélien Buhrig @ 2008-06-25  7:36 UTC (permalink / raw)
  To: cgen

Hello,

I try to port sid simulator for a new  16bit target. This processor have
multiple word insn. (1 or 2 if there is an immediate value). So insn can
take 16 or 32 bits.

So I have the same problem that the one reported here :
http://sourceware.org/ml/cgen/2006-q3/msg00030.html


Since I do not want to do “some ugly code which examines the base_insn bits
in order to decide how to position entire_insn”, and since it seems there is
no new way to have the insn length before decoding the instruction, I tried
the second solution that consists in setting the base-insn-bitsize to 32.

I have now 2 problems : 
- The disassembly is not correct anymore.
- I have an unresolved ambiguity error.
ERROR: Unable to resolve ambiguity (maybe need some ifield-assertion specs?)

So I tried derived operand with ifield-assertion, the I cannot fix the
ambiguity problem.
Here is the description of the faulty insn:

(define-derived-operand  
  (name unop-pi-pc-imm52)
  (comment "")  
  (attrs)
  (mode UHI) 
  (args (uimm52) (reg))
  (syntax "$uimm52")
  (base-ifield f-1opopc)
  (encoding (+ UNAD_PI REG_PC uimm52 ) )
  (ifield-assertion (eq f-reg 7))
  (getter (nop))
  (setter (nop)))

(define-derived-operand
  (name unop-pi-gr)
  (comment "")
  (attrs)
  (mode UHI)
  (args (reg))
  (syntax "$(reg)+")
  (base-ifield f-1opopc)
  (encoding (+ UNAD_PI reg ) )
  (ifield-assertion (not (eq f-reg 7)))
  (getter (nop))
  (setter (nop)))

(define-anyof-operand
  (name unop-pi)
  (comment "PI addressing modes")
  (mode UHI)
  (base-ifield f-1opopc)
  (choices unop-pi-pc-imm52 unop-pi-gr))

(dni
      moveps                                                ; name
      (.str mnemonic " (rn)+")                                  ; comment
      ()                                                        ; attrs
      ("move.$len $sr,($reg)+")                                      ;
syntax
      ;+ (+ len SEL_1OP ONEOP_MTSR UNAD_PI reg)             ; format
      (+ len SEL_1OP ONEOP_MTSR unop-pi)                ; format
      (nop)
      ())     


How can I do ?
Thanks,
Aurelien

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

end of thread, other threads:[~2008-06-30  8:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-25  7:36 sid, base_insn vs entire_insn and ambiguity Aurélien Buhrig
     [not found] ` <486114F4.1040309@redhat.com>
2008-06-26  9:26   ` Aurélien Buhrig
2008-06-26 15:00     ` Aurélien Buhrig
2008-06-26 16:15       ` Aurélien Buhrig
2008-06-27  8:33         ` Dave Brolley
2008-06-27 16:02           ` Aurélien Buhrig
2008-06-30  8:16             ` Dave Brolley
2008-06-30 13:56               ` Aurélien Buhrig

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