From: DJ Delorie Date: Tue, 14 Mar 2006 04:20:53 +0000 (+0000) Subject: * m32c.cpu (Bit3-S): New. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43aa3bb1d43045f9a60a2a91be8766582a4aab42;p=binutils-gdb.git * m32c.cpu (Bit3-S): New. (btst:s): New. * m32c.opc (parse_bit3_S): New. --- diff --git a/cpu/ChangeLog b/cpu/ChangeLog index 39739d5c53a..2a888e0cf4e 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 538d25c9eab..a645a48b59b 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 62353267f47..f664e9a2cdd 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,