Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Alan Hayward <alan.hayward@arm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 5/8] AARCH64 SVE: Add SVE feature
Date: Tue, 13 Dec 2016 17:52:00 -0000	[thread overview]
Message-ID: <20161213175130.GG25542@E107787-LIN> (raw)
In-Reply-To: <D46B0DFD.154F7%alan.hayward@arm.com>

On 16-12-05 12:28:45, Alan Hayward wrote:
> This is part of a series adding AARCH64 SVE support to gdb and gdbserver.
> 
> This patch adds the SVE feature.
> 
> This code sets size of the variable registers to 64bits for the Z registers
> and 8bits for the P registers. It will be the job of the aarch64 target
> code

What is the reason to set Z registers 64-bit and P registers 8-bit?
According to reference in the cover letter, Z register is 128 bit in
minimum and P register is 16-bit in minimum.

> (in a later patch in the series) to scale the Z and P registers to the
> correct size using the integer scalar VG.

> diff --git a/gdb/features/aarch64-sve-core.xml
> b/gdb/features/aarch64-sve-core.xml
> new file mode 100644
> index 
> 0000000000000000000000000000000000000000..d990aebfa1d8d17cc53a70a6c7517533f
> 8e369b9
> --- /dev/null
> +++ b/gdb/features/aarch64-sve-core.xml
> @@ -0,0 +1,105 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2009-2015 Free Software Foundation count="Inc.
> +     Contributed by ARM Ltd.
> +
> +     Copying and distribution of this file count="with or without
> modification,
> +     are permitted in any medium without royalty provided the copyright
> +     notice and this notice are preserved.  -->
> +
> +<!DOCTYPE feature SYSTEM "gdb-target.dtd">
> +<feature name="org.gnu.gdb.aarch64.sve">
> +
> +  <vector id="svevdf" type="ieee_double" count="1"/>
> +  <vector id="svevdu" type="uint64" count="1"/>
> +  <vector id="svevds" type="int64" count="1"/>
> +  <vector id="svevsf" type="ieee_single" count="2"/>
> +  <vector id="svevsu" type="uint32" count="2"/>
> +  <vector id="svevss" type="int32" count="2"/>
> +  <vector id="svevhu" type="uint16" count="4"/>
> +  <vector id="svevhs" type="int16" count="4"/>
> +  <vector id="svevbu" type="uint8" count="8"/>
> +  <vector id="svevbs" type="int8" count="8"/>
> +  <union id="svevnd">
> +    <field name="f" type="svevdf"/>
> +    <field name="u" type="svevdu"/>
> +    <field name="s" type="svevds"/>
> +  </union>
> +  <union id="svevns">
> +    <field name="f" type="svevsf"/>
> +    <field name="u" type="svevsu"/>
> +    <field name="s" type="svevss"/>
> +  </union>
> +  <union id="svevnh">
> +    <field name="u" type="svevhu"/>
> +    <field name="s" type="svevhs"/>
> +  </union>
> +  <union id="svevnb">
> +    <field name="u" type="svevbu"/>
> +    <field name="s" type="svevbs"/>
> +  </union>
> +  <union id="svev">
> +    <field name="d" type="svevnd"/>
> +    <field name="s" type="svevns"/>
> +    <field name="h" type="svevnh"/>
> +    <field name="b" type="svevnb"/>
> +  </union>
> +
> +  <vector id="svep" type="uint8" count="1"/>
> +
> +  <reg name="z0" bitsize="64" type="svev" regnum="34"/>

It should describe the right size of register"z0".  According to the
reference, the minimum is 128-bits and max is 2048-bits.  There are
16 possibilities.  We can either generate all of them (16) ahead of
time or we can create a template, like this,

  <vector id="svevdf" type="ieee_double" count="2 * UNIT"/>
  ...
  <reg name="z0" bitsize="128 * UNIT" type="svev" regnum="34"/>

and reply the right one back to GDB with the UNIT replaced by a
proper value.

We still have feature "org.gnu.gdb.aarch64.sve", but the size of
Z and P registers may be different.

I still need some time to think about the best way to get
target description dynamically.

> diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
> index 
> 5316c95b67f04591c448a8a14b4ed3cac0092666..3b175caeb0807fd315baa35dbb8e34065
> 32a335e 100644
> --- a/gdb/gdbserver/Makefile.in
> +++ b/gdb/gdbserver/Makefile.in
> @@ -418,7 +418,7 @@ clean:
>  	rm -f version.c
>  	rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
>  	rm -f $(IPA_LIB)
> -	rm -f aarch64.c
> +	rm -f aarch64.c aarch64-sve.c
>  	rm -f reg-arm.c reg-bfin.c i386.c reg-ia64.c reg-m32r.c reg-m68k.c
>  	rm -f reg-sh.c reg-sparc.c reg-spu.c amd64.c i386-linux.c
>  	rm -f reg-cris.c reg-crisv32.c amd64-linux.c reg-xtensa.c
> @@ -607,6 +607,9 @@ linux-aarch64-ipa.o: linux-aarch64-ipa.c
>  aarch64-ipa.o: aarch64.c
>  	$(IPAGENT_COMPILE) $<
>  	$(POSTCOMPILE)
> +aarch64-sve-ipa.o: aarch64-sve.c
> +	$(IPAGENT_COMPILE) $<
> +	$(POSTCOMPILE)

We don't support tracepoint for SVE, so no need to build
aarch64-sve-ipa.o.

-- 
Yao (齐尧)


  reply	other threads:[~2016-12-13 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 12:29 Alan Hayward
2016-12-13 17:52 ` Yao Qi [this message]
2016-12-14  9:28   ` Alan Hayward

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=20161213175130.GG25542@E107787-LIN \
    --to=qiyaoltc@gmail.com \
    --cc=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    /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