This is the mail archive of the cgen@sources.redhat.com 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]

emiting insn with changed value



Hi!

Is is possible to change a value in a macro insn?  See the example
below:

  (dni addi "addi" ()
       "addi $rd,$ra,$simm"
       (+ OP_1 rd rr simm)
       (set rd (add ra simm))
       ()
  )            

  (dnmi subi "subi" ()
       "subi $rd,$ra,$simm"
       (emit addi rd ra (simm -simm))
  )                           ^^^^^

Note: I have "tested" this and CGEN doesn't complain about it, but
      I have not yet hade the chans to try to assemble such an insn.
      Looking at the generated code I see nothing that indicates
      that "simm" will switch sign. 

(maybe it's more suitable to use the "minus" RTX instead of "-simm")

Regards,
Johan.

-- 
Johan Rydberg, Net Insight AB, Sweden, +46-8-685 04 00

$ ON F$ERROR("LANGUAGE","ENGLISH","IN_MESSAGE").GT.F$ERROR("NORMAL") -
             THEN EXCUSE/OBJECT=ME

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