public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* ALIAS instructions are messed up?
@ 2009-06-18 17:27 Doug Evans
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Evans @ 2009-06-18 17:27 UTC (permalink / raw)
  To: cgen

Blech.  Handling of ALIAS instructions is messed up.

 From insn.scm:-insn-parse:

        (let ((ifield-assertion (if (not (null? ifield-assertion))
                                    ifield-assertion
                                    #f))
              (semantics (if (not (null? semantics))
                             semantics
                             #f))
              (format (-parse-insn-format (string-append errtxt " format")
                                          fmt))
              (comment (parse-comment comment errtxt))
              ; If there are no semantics, mark this as an alias.
              ; ??? Not sure this makes sense for multi-insns.
              (atlist-obj (if semantics
                              atlist-obj
                              (atlist-cons (bool-attr-make 'ALIAS #t)
                                           atlist-obj)))
              (syntax (parse-syntax syntax errtxt))
              (timing (parse-insn-timing errtxt timing))
              )

If this were a `let*', then things would be a bit clearer, but not 
completely.
[the checking for alias insns won't work if it's expecting the previous 
assignment of semantics to change () to #f]

This comes up because generating the html doc for xc16x.cpu crashes 
because its "nop" instruction has () for semantics.

I can't remember if there's any usefulness to ALIAS insns that isn't 
provided by macro-insns.
Can anyone?

I don't have too strong a preference on what to do here (though I 
reserve the right to change my mind :-)).
Since, e.g., simulators rightly ignore ALIAS insns it seems like we want 
to flag insns in .cpu files with missing/empty semantics as an error and 
not silently convert them to aliases.
Nop insns would be required to specify (nop) for their semantics.
It'd be interesting to see if making this change causes any changes to 
the generated code.

Whether to disallow alias insns entirely is a separate question.  Dunno.
[We could still keep it for macro-insns.
And I realize there are a few ports that currently use it, or at least 
specify it.]

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: ALIAS instructions are messed up?
@ 2009-10-03 20:33 Joern Rennecke
  2009-10-05 18:22 ` Doug Evans
  0 siblings, 1 reply; 4+ messages in thread
From: Joern Rennecke @ 2009-10-03 20:33 UTC (permalink / raw)
  To: Doug Evans; +Cc: cgen

> Whether to disallow alias insns entirely is a separate question. Dunno.
> [We could still keep it for macro-insns.
> And I realize there are a few ports that currently use it, or at  
> least specify > it.]

Currently, macro-instructions can't be used in all instances where
it should be natural to use them.
When you want to set a multi-ifield to a constant, you end up with
the entire costant being added in in the bit position of each of
constituent simple bitfields.

By adding an ALIAS instruction by hand, you can at least work around
the problem by setting only simple bitfields to constants.

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

end of thread, other threads:[~2009-10-05 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-18 17:27 ALIAS instructions are messed up? Doug Evans
2009-10-03 20:33 Joern Rennecke
2009-10-05 18:22 ` Doug Evans
2009-10-05 21:42   ` Joern Rennecke

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