From: anix <2362292778@qq.com>
To: gdb <gdb@sourceware.org>
Subject: Fw: Mistake in GNU AS of IA-32 for the result about half-precision floating-point value
Date: Tue, 14 Feb 2023 17:25:19 +0800 [thread overview]
Message-ID: <tencent_48DDA029AA0021AE776EAF1CE64226F92406@qq.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2499 bytes --]
Dear:
I found one mistake in GNU AS of IA-32 for the result about half-precision floating-point value.
as the following, including source code and gdb result:
# The source code convert between single-precision floating-point(32-bit) and half-precision floating-point (16-bit).
.section .data
m32fp: .float 142, 580, 36832, 65504
half: .short 0x5870, 0x6080, 0x787f, 0x7bff
h1: .short 0, 0 ,0, 0
m1: .float 0, 0, 0, 0
.section .text
.globl _start
_start:
nop
movaps m32fp, %xmm0
vcvtps2ph $0, %xmm0, h1 #imm8=$0; h1 {m64}
vcvtph2ps h1, %xmm1
movups %xmm1, m1
next: movl $1, %eax
movl $0, %ebx
int $0x80
# the source code end here.
# results under GNU Debugger (gdb)
(gdb) x/4fw &m32fp
0x804a000: 142 580 36832 65504
(gdb) x/4fw &m1
0x804a020: 142 580 36832 65504
(gdb) x/4fh &half
0x804a010: 22640 24704 30847 31743
(gdb) x/4fh &h1
0x804a018: 22640 24712 30847 31743
(gdb) x/4xw &m32fp
0x804a000: 0x430e0000 0x44110000 0x470fe000 0x477fe000
(gdb) x/4xw &m1
0x804a020: 0x430e0000 0x44110000 0x470fe000 0x477fe000
(gdb) x/4xh &half
0x804a010: 0x5870 0x6080 0x787f 0x7bff
(gdb) x/4xh &h1
0x804a018: 0x5870 0x6088 0x787f 0x7bff
# the results of half-precision data (half, h1) by gdb are mistakes, or instruct me
# All above under IA-32 , OS is centos (32-bit), GNU as and gdb are also 32-bit.
hope your return.
thank you very much!
Niu wensheng
2023.02.12
next reply other threads:[~2023-02-14 9:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 9:25 anix [this message]
2023-02-14 22:33 ` Tom Tromey
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=tencent_48DDA029AA0021AE776EAF1CE64226F92406@qq.com \
--to=2362292778@qq.com \
--cc=gdb@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).