Fw: Mistake in GNU AS of IA-32 for the result about half-precision floating-point value

anix via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Dear:

&nbsp;&nbsp; &nbsp; &nbsp; I found one mistake in GNU AS of IA-32 for the result about half-precision floating-point value.
&nbsp;&nbsp; &nbsp; &nbsp; 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:&nbsp; &nbsp; .float 142,&nbsp; &nbsp; 580,&nbsp; &nbsp; 36832,&nbsp; 65504
half:&nbsp; &nbsp; .short 0x5870, 0x6080, 0x787f, 0x7bff
h1:&nbsp; &nbsp; .short 0, 0 ,0, 0
m1:&nbsp; &nbsp; .float 0, 0, 0, 0
.section .text
.globl _start
_start:
&nbsp; &nbsp; nop
&nbsp; &nbsp; movaps m32fp, %xmm0
&nbsp; &nbsp; vcvtps2ph $0, %xmm0, h1&nbsp; &nbsp; &nbsp; &nbsp; #imm8=$0; h1 {m64}

&nbsp; &nbsp; vcvtph2ps h1, %xmm1
&nbsp; &nbsp; movups %xmm1, m1
&nbsp; &nbsp; 
next:&nbsp; &nbsp; movl $1, %eax
&nbsp; &nbsp; movl $0, %ebx
&nbsp; &nbsp; int $0x80
# the source code end here.



# results under GNU Debugger (gdb)
(gdb) x/4fw &amp;m32fp 
0x804a000:&nbsp; &nbsp; 142&nbsp; &nbsp; 580&nbsp; &nbsp; 36832&nbsp; &nbsp; 65504
(gdb) x/4fw &amp;m1 
0x804a020:&nbsp; &nbsp; 142&nbsp; &nbsp; 580&nbsp; &nbsp; 36832&nbsp; &nbsp; 65504
(gdb) x/4fh &amp;half 
0x804a010:&nbsp; &nbsp; 22640&nbsp; &nbsp; 24704&nbsp; &nbsp; 30847&nbsp; &nbsp; 31743
(gdb) x/4fh &amp;h1
0x804a018:&nbsp; &nbsp; 22640&nbsp; &nbsp; 24712&nbsp; &nbsp; 30847&nbsp; &nbsp; 31743
(gdb) x/4xw &amp;m32fp 
0x804a000:&nbsp; &nbsp; 0x430e0000&nbsp; &nbsp; 0x44110000&nbsp; &nbsp; 0x470fe000&nbsp; &nbsp; 0x477fe000
(gdb) x/4xw &amp;m1
0x804a020:&nbsp; &nbsp; 0x430e0000&nbsp; &nbsp; 0x44110000&nbsp; &nbsp; 0x470fe000&nbsp; &nbsp; 0x477fe000
(gdb) x/4xh &amp;half 
0x804a010:&nbsp; &nbsp; 0x5870&nbsp; &nbsp; 0x6080&nbsp; &nbsp; 0x787f&nbsp; &nbsp; 0x7bff
(gdb) x/4xh &amp;h1
0x804a018:&nbsp; &nbsp; 0x5870&nbsp; &nbsp; 0x6088&nbsp; &nbsp; 0x787f&nbsp; &nbsp; 0x7bff
# the results of half-precision data (half, h1) by gdb&nbsp; are mistakes, or instruct me 

# All above under IA-32 , OS is centos (32-bit), GNU as and gdb are&nbsp; also 32-bit.


hope your return.
thank you very much!
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Niu wensheng
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2023.02.12
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.