Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Anton Blanchard <anton@samba.org>
Cc: gdb-patches@sourceware.org, emachado@linux.vnet.ibm.com,
	luis_gustavo@mentor.com, ulrich.weigand@de.ibm.com
Subject: Re: [PATCH 3/4] Add multiple branches to ppc64 single step through atomic sequence testcase
Date: Fri, 28 Mar 2014 13:14:00 -0000	[thread overview]
Message-ID: <20140328131455.GF4030@adacore.com> (raw)
In-Reply-To: <1395978111-30706-3-git-send-email-anton@samba.org>

> Test 3 conditional branches in an atomic sequence, 2 to the same
> destination.
> 
> gdb/testsuite/
> 2014-03-28  Anton Blanchard  <anton@samba.org>
> 
> 	* gdb.arch/ppc64-atomic-inst.s: Add second and third branch
> 	inside atomic sequence.

Just a thought - is there no value in keeping the old assembly code
and creating an additional testcase? It would be very similar to
the one you already have, but then you'd be covering most cases...
Otherwise, the patch seems fine.

> ---
>  gdb/testsuite/gdb.arch/ppc64-atomic-inst.s | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s b/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s
> index 15ccfd9..0521170 100644
> --- a/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s
> +++ b/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s
> @@ -39,18 +39,30 @@ main:
>  1:	lwarx	5,0,4
>  	cmpwi	5,0
>  	bne	2f
> +	cmpwi	5,1
> +	beq	3f
> +	cmpwi	5,2
> +	beq	3f	/* branch to same destination */
>  	addi	5,5,1
>  	stwcx.	5,0,4
>  	bne	1b
>  
> -	std	0,0(4)
> -2:	ldarx	5,0,4
> +2:	nop
> +
> +3:	std	0,0(4)
> +1:	ldarx	5,0,4
>  	cmpdi	5,0
> -	bne	3f
> +	bne	2f
> +	cmpdi	5,1
> +	beq	3f
> +	cmpwi	5,2
> +	beq	3f	/* branch to same destination */
>  	addi	5,5,1
>  	stdcx.	5,0,4
>  	bne	1b
>  
> +2:	nop
> +
>  3:	li	3,0
>  	blr
>  
> -- 
> 1.8.3.2

-- 
Joel


  reply	other threads:[~2014-03-28 13:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28  3:41 [PATCH 1/4] Fix ppc64 single step over " Anton Blanchard
2014-03-28  3:42 ` [PATCH 2/4] Support up to 3 conditional branches in an atomic sequence Anton Blanchard
2014-03-28 13:12   ` Joel Brobecker
2014-03-28 17:13     ` Pedro Alves
2014-03-28 17:22       ` Pedro Alves
2014-03-28 17:32       ` Joel Brobecker
2014-03-28 17:58         ` Pedro Alves
2014-03-28 18:10           ` Joel Brobecker
2014-03-28  3:42 ` [PATCH 3/4] Add multiple branches to ppc64 single step through atomic sequence testcase Anton Blanchard
2014-03-28 13:14   ` Joel Brobecker [this message]
2014-03-28  3:42 ` [PATCH 4/4] Add lbarx/stbcx., lharx/sthcx. and lqarx/stqcx. single stepping Anton Blanchard
2014-03-28 13:17   ` Joel Brobecker
2014-03-28 13:05 ` [PATCH 1/4] Fix ppc64 single step over atomic sequence testcase Joel Brobecker
2014-03-31  2:55   ` Anton Blanchard
2014-03-28 13:13 ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140328131455.GF4030@adacore.com \
    --to=brobecker@adacore.com \
    --cc=anton@samba.org \
    --cc=emachado@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=luis_gustavo@mentor.com \
    --cc=ulrich.weigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox