Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/BASM    [ Add a report in this area ]  
Report #:  87610   Status: Open
BASM DD and DQ do not handle floating point values correctly
Project:  Delphi Build #:  14.0.3539.24502
Version:    14.0 Submitted By:   Philipp S
Report Type:  Basic functionality failure Date Reported:  8/28/2010 2:19:42 PM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   280216
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 5
Description
DD and DQ are used to declare 32-bit/DWORD and 64-bit/QWORD-sized data, respectively. BASM allows (u)int32 and (u)int64 data to be declared correctly: However, DD and DQ do not handle the declaration of 32-bit SINGLE-precision floating-point and 64-bit DOUBLE-precision floating-point values correctly.
Steps to Reproduce:
Inspect the code generated for the following instructions.
Expected: 0.5 and 1/2 should be treated as single values after DD and double values after DQ
Observed: 0.5 and 1/2 are treated as (different!) integer values

asm
      jmp @x
      @OneHalfDW1:
         dd 0.5   // actually, the compiler treats this as 05h integer
      @OneHalfDW2:
         dd 1/2   // actually, the compiler treats this as 00h integer
      @OneHalfDQ1:
         dq 0.5   // actually, the compiler treats this as 05h integer
      @OneHalfDQ2:
         dq 1/2   // actually, the compiler treats this as 00h integer
      @x:
        movss xmm0, dword ptr @OneHalfDW1
        movss xmm1, dword ptr @OneHalfDW2
        movsd xmm2, qword ptr @OneHalfDQ1
        movsd xmm3, qword ptr @OneHalfDQ2
        int 3 // inspect values in xmm0 - xmm3 in FPU view, and also the data inserted for the DDs and DQs
end;
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01