+; (BDAP.D [PC+],PC [ 1111 | 11010110 | 1111 ]
+; This [PC+I] prefix is used for DSO-local jumps in PIC code, together with
+; move-m-pcplus-p0: "move [pc=pc+N],p0"
+(dni-c-SI-attr
+ bdap-32-pc "bdap.d [PC+],PC"
+ (MACH-PC)
+ "bdap ${sconst32},PC"
+ (+ (f-dest 15) MODE_AUTOINCREMENT INDIR_BDAP_M SIZE_DWORD (f-source 15) const32)
+ (sequence
+ ((SI newpc) (SI oldpc) (SI offs))
+ (set offs const32)
+ (set oldpc (add SI pc 6))
+ (set newpc (add SI oldpc offs))
+ (set prefixreg newpc)
+ (set prefix-set 1))
+)
+
+; (MOVE [PC+],P0 [ 0000 | 11100011 | 1111 ])
+; This insn is used for DSO-local jumps in PIC code. See bdap-32-pc.
+(dni ; Must not use dni-cmt-* because we force MODE_AUTOINCREMENT.
+ move-m-pcplus-p0 "move [PC+],P0"
+ (MACH-PC)
+ "move [PC+],P0"
+ (+ (f-dest 0) MODE_AUTOINCREMENT INFIX_MOVE_M_S SIZE_FIXED (f-source 15))
+ (if prefix-set
+ (sequence
+ ((QI dummy))
+ ; We model the memory read, but throw the result away, as the
+ ; destination register is read-only. We need to assign the result of
+ ; cris-get-mem though, as CGEN-FIXME: invalid C code will otherwise
+ ; be generated.
+ (set dummy (cris-get-mem QI pc))
+ (reset-x-p))
+ (error "move [PC+],P0 without prefix is not implemented"))
+ (cris-mem-timing)
+)
+
+; This insn is used in Linux in the form "move [$sp=$sp+16],$p8"; it's
+; similar to move-m-pcplus-p0 above. The same comments apply here.
+(dni
+ move-m-spplus-p8 "move [SP+],P8"
+ (MACH-PC)
+ "move [SP+],P8"
+ (+ (f-dest 8) MODE_AUTOINCREMENT INFIX_MOVE_M_S SIZE_FIXED (f-source 14))
+ (if prefix-set
+ (sequence
+ ((SI dummy))
+ (set dummy (cris-get-mem SI sp))
+ (reset-x-p))
+ (error "move [SP+],P8 without prefix is not implemented"))
+ (cris-mem-timing)
+)
+