fix Issue 24181 - reading double parameter from RCX rather than XMM1 (#15707)

This commit is contained in:
Walter Bright 2023-10-18 23:29:42 -07:00 committed by GitHub
parent ba98090885
commit 8f5764ecbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -1402,7 +1402,7 @@ void getlvalue(ref CodeBuilder cdb,code *pcs,elem *e,regm_t keepmsk)
if (preg != NOREG && regcon.params & mask(preg))
{
//printf("sz %d, preg %s, Voffset %d\n", cast(int)sz, regm_str(mask(preg)), cast(int)voffset);
if (mask(preg) & XMMREGS && sz != REGSIZE)
if (mask(preg) & XMMREGS)
{
/* The following fails with this from std.math on Linux64:
void main()

View file

@ -0,0 +1,15 @@
// https://issues.dlang.org/show_bug.cgi?id=24181
#include <assert.h>
unsigned equ(double x, double y)
{
return *(long long *)&x == *(long long *)&y;
}
int main()
{
assert(equ(1.0, 2.0) == 0);
assert(equ(527, 527) != 0);
return 0;
}