This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Add MIPS32 "SYNC stype" instruction
- From: Thiemo Seufer <ths at networkno dot de>
- To: "Fu, Chao-Ying" <fu at mips dot com>
- Cc: binutils at sourceware dot org, "Robinson, James" <jrob at mips dot com>, "Lau, David" <davidlau at mips dot com>
- Date: Fri, 25 Jul 2008 10:14:04 +0100
- Subject: Re: Add MIPS32 "SYNC stype" instruction
- References: <94BD67F8AF3ED34FA362C662BA1F12C501007E1C@MTVEXCHANGE.mips.com>
Fu, Chao-Ying wrote:
[snip]
> --- include/opcode/mips.h 12 Jun 2008 21:44:53 -0000 1.59
> +++ include/opcode/mips.h 24 Jul 2008 23:31:37 -0000
> @@ -262,6 +262,7 @@ struct mips_opcode
>
> Each of these characters corresponds to a mask field defined above.
>
> + "1" 5 bit sync type amount (OP_*_SHAMT)
It think you meant "... sync type shift amount ..."
> "<" 5 bit shift amount (OP_*_SHAMT)
> ">" shift amount between 32 and 63, stored after subtracting 32 (OP_*_SHAMT)
> "a" 26 bit target address (OP_*_TARGET)
> @@ -401,7 +402,7 @@ struct mips_opcode
> "+" Start of extension sequence.
>
> Characters used so far, for quick reference when adding more:
> - "234567890"
> + "1234567890"
> "%[]<>(),+:'@!$*&"
> "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> "abcdefghijklopqrstuvwxz"
> Index: gas/config/tc-mips.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-mips.c,v
> retrieving revision 1.391
> diff -u -p -r1.391 tc-mips.c
> --- gas/config/tc-mips.c 22 Jul 2008 10:44:50 -0000 1.391
> +++ gas/config/tc-mips.c 24 Jul 2008 23:31:43 -0000
> @@ -8412,6 +8412,7 @@ validate_mips_insn (const struct mips_op
> case '%': USE_BITS (OP_MASK_VECALIGN, OP_SH_VECALIGN); break;
> case '[': break;
> case ']': break;
> + case '1': USE_BITS (OP_MASK_SHAMT, OP_SH_SHAMT); break;
Formatting.
> case '2': USE_BITS (OP_MASK_BP, OP_SH_BP); break;
> case '3': USE_BITS (OP_MASK_SA3, OP_SH_SA3); break;
> case '4': USE_BITS (OP_MASK_SA4, OP_SH_SA4); break;
> @@ -9198,6 +9199,7 @@ do_msbd:
>
> case 'k': /* cache code */
> case 'h': /* prefx code */
> + case '1': /* sync type */
> my_getExpression (&imm_expr, s);
> check_absolute_expr (ip, &imm_expr);
> if ((unsigned long) imm_expr.X_add_number > 31)
> @@ -9206,8 +9208,10 @@ do_msbd:
> (unsigned long) imm_expr.X_add_number);
> if (*args == 'k')
> INSERT_OPERAND (CACHE, *ip, imm_expr.X_add_number);
> - else
> + else if (*args == 'h')
> INSERT_OPERAND (PREFX, *ip, imm_expr.X_add_number);
> + else
> + INSERT_OPERAND (SHAMT, *ip, imm_expr.X_add_number);
> imm_expr.X_op = O_absent;
> s = expr_end;
> continue;
> Index: gas/testsuite/gas/mips/mips.exp
> ===================================================================
> RCS file: /cvs/src/src/gas/testsuite/gas/mips/mips.exp,v
> retrieving revision 1.142
> diff -u -p -r1.142 mips.exp
> --- gas/testsuite/gas/mips/mips.exp 10 Jul 2008 19:05:29 -0000 1.142
> +++ gas/testsuite/gas/mips/mips.exp 24 Jul 2008 23:31:43 -0000
> @@ -829,4 +829,5 @@ if { [istarget mips*-*-vxworks*] } {
> [mips_arch_list_matching mips1]
>
> run_dump_test "mips16-vis-1"
> + run_dump_test "mips32-sync"
> }
> Index: gas/testsuite/gas/mips/mips32-sync.s
> ===================================================================
> RCS file: gas/testsuite/gas/mips/mips32-sync.s
> diff -N gas/testsuite/gas/mips/mips32-sync.s
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ gas/testsuite/gas/mips/mips32-sync.s 24 Jul 2008 23:31:43 -0000
> @@ -0,0 +1,10 @@
> + .text
> +foo:
> + .ent foo
> + sync
> + sync 0
> + sync 1
> + sync 2
> + sync 30
> + sync 31
Is the semantic of those values documented anywhere?
Thiemo