diff options
author | Felix Willgerodt <felix.willgerodt@intel.com> | 2021-07-09 15:39:41 +0200 |
---|---|---|
committer | Felix Willgerodt <felix.willgerodt@intel.com> | 2021-09-03 15:18:31 +0200 |
commit | 0b99a66053fa1e93a984f75a7a3d5343c74882fb (patch) | |
tree | 733a5a9872601efd6f30ca10ca26f37b9db5a97a /gdb/i386-tdep.c | |
parent | 8661f70c499e9a6f2d8b12241d663881452178ae (diff) | |
download | fsf-binutils-gdb-0b99a66053fa1e93a984f75a7a3d5343c74882fb.zip fsf-binutils-gdb-0b99a66053fa1e93a984f75a7a3d5343c74882fb.tar.gz fsf-binutils-gdb-0b99a66053fa1e93a984f75a7a3d5343c74882fb.tar.bz2 |
gdb: Enable finish command and inferior calls for _Float16 on amd64 and i386.
Values of type _Float16 and _Float16 _Complex can now be used on CPUs with
AVX512-FP16 support. Return values of those types are located in XMM0.
Compiler support for gcc and clang is in progress, see e.g.:
https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574117.html
gdb/ChangeLog:
2021-07-21 Felix Willgerodt <Felix.Willgerodt@intel.com>
* amd64-tdep.c (amd64_classify): Classify _Float16 and
_Float16 _Complex as AMD64_SSE.
* i386-tdep.c (i386_extract_return_value): Read _Float16 and
_Float16 _Complex from xmm0.
gdb/testsuite/ChangeLog:
2021-07-21 Felix Willgerodt <Felix.Willgerodt@intel.com>
* gdb.arch/x86-avx512fp16-abi.c: New file.
* gdb.arch/x86-avx512fp16-abi.exp: New file.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index c2835a2..a9c4292 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -2818,7 +2818,14 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, int len = TYPE_LENGTH (type); gdb_byte buf[I386_MAX_REGISTER_SIZE]; - if (type->code () == TYPE_CODE_FLT) + /* _Float16 and _Float16 _Complex values are returned via xmm0. */ + if (((type->code () == TYPE_CODE_FLT) && len == 2) + || ((type->code () == TYPE_CODE_COMPLEX) && len == 4)) + { + regcache->raw_read (I387_XMM0_REGNUM (tdep), valbuf); + return; + } + else if (type->code () == TYPE_CODE_FLT) { if (tdep->st0_regnum < 0) { |