This is the mail archive of the cgen@sourceware.org mailing list for the CGEN 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]

ALIAS instructions are messed up?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]