aboutsummaryrefslogtreecommitdiff
path: root/cpu/xc16x.cpu
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2010-02-12 04:38:21 +0000
committerDoug Evans <dje@google.com>2010-02-12 04:38:21 +0000
commit5ff58fb071f5d3d4ee7572af1221cdf80d10f4e8 (patch)
tree4567802d74329b8f4627486d88507faedf4d9ed3 /cpu/xc16x.cpu
parent93ceb76464b573cae4b2f94d3dd36665b3174628 (diff)
downloadgdb-5ff58fb071f5d3d4ee7572af1221cdf80d10f4e8.zip
gdb-5ff58fb071f5d3d4ee7572af1221cdf80d10f4e8.tar.gz
gdb-5ff58fb071f5d3d4ee7572af1221cdf80d10f4e8.tar.bz2
* m32r.cpu (HASH-PREFIX): Delete.
(duhpo, dshpo): New pmacros. (simm8, simm16): Delete HASH-PREFIX attribute, define with dshpo. (uimm3, uimm4, uimm5, uimm8, uimm16, imm1): Delete HASH-PREFIX attribute, define with dshpo. (uimm24): Delete HASH-PREFIX attribute. * m32r.opc (CGEN_PRINT_NORMAL): Delete. (print_signed_with_hash_prefix): New function. (print_unsigned_with_hash_prefix): New function. * xc16x.cpu (dowh): New pmacro. (upof16): Define with dowh, specify print handler. (qbit, qlobit, qhibit): Ditto. (upag16): Ditto. * xc16x.opc (CGEN_PRINT_NORMAL): Delete. (print_with_dot_prefix): New functions. (print_with_pof_prefix, print_with_pag_prefix): New functions.
Diffstat (limited to 'cpu/xc16x.cpu')
-rw-r--r--cpu/xc16x.cpu19
1 files changed, 14 insertions, 5 deletions
diff --git a/cpu/xc16x.cpu b/cpu/xc16x.cpu
index 1d2057a..4903b81 100644
--- a/cpu/xc16x.cpu
+++ b/cpu/xc16x.cpu
@@ -528,6 +528,15 @@
(comment "segment")
)
+;; Define an operand that takes a set of handlers.
+;; dowh: define-operand-with-handlers
+(define-pmacro (dowh x-name x-comment x-attrs x-type x-index x-handlers)
+ (define-operand (name x-name) (comment x-comment)
+ (.splice attrs (.unsplice x-attrs))
+ (type x-type) (index x-index)
+ (.splice handlers (.unsplice x-handlers)))
+)
+
(dnop sr "source register" () h-gr f-r2)
(dnop dr "destination register" () h-gr f-r1)
(dnop dri "destination register" () h-gr f-r4)
@@ -544,7 +553,7 @@
(dnop uimm7 "7 bit trap number" (HASH-PREFIX) h-uint f-uimm7)
(dnop uimm8 "8 bit unsigned immediate" (HASH-PREFIX) h-uint f-uimm8)
(dnop uimm16 "16 bit unsigned immediate" (HASH-PREFIX) h-uint f-uimm16)
-(dnop upof16 "16 bit unsigned immediate" (POF-PREFIX) h-addr f-memory)
+(dowh upof16 "16 bit unsigned immediate" (POF-PREFIX) h-addr f-memory ((print "with_pof_prefix")))
(dnop reg8 "8 bit word register number" () h-r8 f-reg8)
(dnop regmem8 "8 bit word register number" () h-regmem8 f-regmem8)
(dnop regbmem8 "8 bit byte register number" () h-regbmem8 f-regmem8)
@@ -573,16 +582,16 @@
(dnop memory "16 bit memory" () h-addr f-memory)
(dnop memgr8 "16 bit memory" () h-memgr8 f-memgr8)
(dnop cbit "carry bit" (SEM-ONLY) h-cbit f-nil)
-(dnop qbit "bit addr" (DOT-PREFIX) h-uint f-qbit)
-(dnop qlobit "bit addr" (DOT-PREFIX) h-uint f-qlobit)
-(dnop qhibit "bit addr" (DOT-PREFIX) h-uint f-qhibit)
+(dowh qbit "bit addr" (DOT-PREFIX) h-uint f-qbit ((print "with_dot_prefix")))
+(dowh qlobit "bit addr" (DOT-PREFIX) h-uint f-qlobit ((print "with_dot_prefix")))
+(dowh qhibit "bit addr" (DOT-PREFIX) h-uint f-qhibit ((print "with_dot_prefix")))
(dnop mask8 "8 bit mask" (HASH-PREFIX) h-uint f-mask8)
(dnop masklo8 "8 bit mask" (HASH-PREFIX) h-uint f-datahi8)
(dnop pagenum "10 bit page number" (HASH-PREFIX) h-uint f-pagenum)
(dnop data8 "8 bit data" (HASH-PREFIX) h-uint f-data8)
(dnop datahi8 "8 bit data" (HASH-PREFIX) h-uint f-datahi8)
(dnop sgtdisbit "segmentation enable bit" (SEM-ONLY) h-sgtdis f-nil)
-(dnop upag16 "16 bit unsigned immediate" (PAG-PREFIX) h-uint f-uimm16)
+(dowh upag16 "16 bit unsigned immediate" (PAG-PREFIX) h-uint f-uimm16 ((print "with_pag_prefix")))
(dnop useg8 "8 bit segment " (SEG-PREFIX) h-uint f-seg8)
(dnop useg16 "16 bit address offset" (SEG-PREFIX) h-uint f-offset16)
(dnop usof16 "16 bit address offset" (SOF-PREFIX) h-uint f-offset16)