Simplify i386, amd64 and x32 expedite registers

Message ID 1475577647-29054-1-git-send-email-yao.qi@linaro.org
State New, archived
Headers

Commit Message

Yao Qi Oct. 4, 2016, 10:40 a.m. UTC
  Nowadays, there are a lot of duplication about
i386/{i386, amd64, x32}*-expedite in features/Makefile.  However,
in features/Makefile, we have

 echo "expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \
	  >> $(outdir)/$*.tmp

which means for a given bar/foo-baz.xml, we'll look for either
bar/foo-baz-expedite or foo-expedite.  In x86 expedite registers, we
use the former now, but it will be much simpler if we use the latter.
This is what this patch does.  This patch removes them, and defines
three generic expedite.  Re-run 'make GDB=/path/build/gdb all' to
regenerate regformats/*.dat files, and they are not changed.

gdb:

2016-10-04  Yao Qi  <yao.qi@linaro.org>

	* features/Makefile: Remove i386/*-expedite. Add i386-expedite,
	amd64-expedite, and x32-expedite.
---
 gdb/features/Makefile | 31 +++----------------------------
 1 file changed, 3 insertions(+), 28 deletions(-)
  

Comments

Pedro Alves Oct. 4, 2016, 6:43 p.m. UTC | #1
On 10/04/2016 11:40 AM, Yao Qi wrote:
> Nowadays, there are a lot of duplication about
> i386/{i386, amd64, x32}*-expedite in features/Makefile.  However,
> in features/Makefile, we have
> 
>  echo "expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \
> 	  >> $(outdir)/$*.tmp
> 
> which means for a given bar/foo-baz.xml, we'll look for either
> bar/foo-baz-expedite or foo-expedite.  In x86 expedite registers, we
> use the former now, but it will be much simpler if we use the latter.
> This is what this patch does.  This patch removes them, and defines
> three generic expedite.  Re-run 'make GDB=/path/build/gdb all' to
> regenerate regformats/*.dat files, and they are not changed.
> 
> gdb:
> 
> 2016-10-04  Yao Qi  <yao.qi@linaro.org>
> 
> 	* features/Makefile: Remove i386/*-expedite. Add i386-expedite,
> 	amd64-expedite, and x32-expedite.

Wow, nice!  I had no idea.

Thanks,
Pedro Alves
  
Yao Qi Oct. 5, 2016, 8:37 a.m. UTC | #2
On Tue, Oct 4, 2016 at 7:43 PM, Pedro Alves <palves@redhat.com> wrote:
>
> Wow, nice!  I had no idea.
>

Patch is pushed in.
  

Patch

diff --git a/gdb/features/Makefile b/gdb/features/Makefile
index f24b13e..6282adf 100644
--- a/gdb/features/Makefile
+++ b/gdb/features/Makefile
@@ -79,34 +79,9 @@  WHICH = aarch64 \
 # Record which registers should be sent to GDB by default after stop.
 aarch64-expedite = x29,sp,pc
 arm-expedite = r11,sp,pc
-i386/i386-expedite = ebp,esp,eip
-i386/i386-linux-expedite = ebp,esp,eip
-i386/amd64-expedite = rbp,rsp,rip
-i386/amd64-linux-expedite = rbp,rsp,rip
-i386/i386-avx-expedite = ebp,esp,eip
-i386/i386-avx-linux-expedite = ebp,esp,eip
-i386/i386-mpx-expedite = ebp,esp,eip
-i386/i386-avx-mpx-expedite = ebp,esp,eip
-i386/i386-mpx-linux-expedite = ebp,esp,eip
-i386/i386-avx-mpx-linux-expedite = ebp,esp,eip
-i386/i386-avx512-expedite = ebp,esp,eip
-i386/i386-avx512-linux-expedite = ebp,esp,eip
-i386/i386-mmx-expedite = ebp,esp,eip
-i386/i386-mmx-linux-expedite = ebp,esp,eip
-i386/amd64-avx-expedite = rbp,rsp,rip
-i386/amd64-avx-linux-expedite = rbp,rsp,rip
-i386/amd64-mpx-expedite = rbp,rsp,rip
-i386/amd64-avx-mpx-expedite = rbp,rsp,rip
-i386/amd64-mpx-linux-expedite = rbp,rsp,rip
-i386/amd64-avx-mpx-linux-expedite = rbp,rsp,rip
-i386/amd64-avx512-expedite = rbp,rsp,rip
-i386/amd64-avx512-linux-expedite = rbp,rsp,rip
-i386/x32-expedite = rbp,rsp,rip
-i386/x32-linux-expedite = rbp,rsp,rip
-i386/x32-avx-expedite = rbp,rsp,rip
-i386/x32-avx-linux-expedite = rbp,rsp,rip
-i386/x32-avx512-expedite = rbp,rsp,rip
-i386/x32-avx512-linux-expedite = rbp,rsp,rip
+i386-expedite = ebp,esp,eip
+amd64-expedite = rbp,rsp,rip
+x32-expedite = rbp,rsp,rip
 mips-expedite = r29,pc
 mips-dsp-expedite = r29,pc
 mips64-expedite = r29,pc