This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] Add multiple branches to single step through atomic sequence testcase


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

I won't pretend I understand PowerPC code all that well, I only know
the basics. My only concern with this change is whether you might have
reduced the number of conditions being tested. I would have expected
this  patch to *add* more code, and associated changes in the .exp
file.  But apparently, the code update is sufficient. How does the
change work? I see two labels used twice, for instance?

Thanks.

> 
> Index: gdb/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s
> ===================================================================
> --- gdb.orig/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s	2012-06-06 12:59:56.697580862 +1000
> +++ gdb/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s	2012-06-06 13:46:08.258410718 +1000
> @@ -10,17 +10,29 @@ gdbasm_declare 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

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]