From 8a3108a3dec3ab8a40fee56ad2749fc2ac10c9b9 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Tue, 14 Mar 2006 04:20:53 +0000 Subject: * m32c.cpu (Bit3-S): New. (btst:s): New. * m32c.opc (parse_bit3_S): New. --- cpu/ChangeLog | 4 ++++ cpu/m32c.cpu | 9 ++++++++- cpu/m32c.opc | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'cpu') diff --git a/cpu/ChangeLog b/cpu/ChangeLog index 39739d5c53..2a888e0cf4 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,5 +1,9 @@ 2006-03-13 DJ Delorie + * m32c.cpu (Bit3-S): New. + (btst:s): New. + * m32c.opc (parse_bit3_S): New. + * m32c.cpu (decimal-subtraction16-insn): Add second operand. (btst): Add optional :G suffix for MACH32. (or.b:S): New. diff --git a/cpu/m32c.cpu b/cpu/m32c.cpu index 538d25c9ea..a645a48b59 100644 --- a/cpu/m32c.cpu +++ b/cpu/m32c.cpu @@ -2026,6 +2026,10 @@ h-sint DFLT f-imm3-S ((parse "imm3_S")) () () ) +(define-full-operand Bit3-S "3 bit bit number" (m32c-isa) + h-sint DFLT f-imm3-S + ((parse "bit3_S")) () () +) ;------------------------------------------------------------- ; Bit numbers @@ -7568,7 +7572,10 @@ (+ (f-0-4 #xD) bit32-16-Unprefixed (f-7-1 #x0) (f-10-3 #x0)) btst-sem) -; fixme: add btst.s +(dni btst.s "btst:s" ((machine 32)) + "btst:s ${Bit3-S},${Dsp-8-u16}" + (+ (f-0-2 #x0) (f-4-3 #x5) Bit3-S Dsp-8-u16) + () ()) ;------------------------------------------------------------- ; btstc diff --git a/cpu/m32c.opc b/cpu/m32c.opc index 62353267f4..f664e9a2cd 100644 --- a/cpu/m32c.opc +++ b/cpu/m32c.opc @@ -533,6 +533,24 @@ parse_imm3_S (CGEN_CPU_DESC cd, const char **strp, return 0; } +static const char * +parse_bit3_S (CGEN_CPU_DESC cd, const char **strp, + int opindex, signed long *valuep) +{ + const char *errmsg = 0; + signed long value; + + errmsg = cgen_parse_signed_integer (cd, strp, opindex, & value); + if (errmsg) + return errmsg; + + if (value < 0 || value > 7) + return _("immediate is out of range 0-7"); + + *valuep = value; + return 0; +} + static const char * parse_lab_5_3 (CGEN_CPU_DESC cd, const char **strp, -- cgit v1.2.1