Search

SSE2 instructions generated when /arch:SSE is specified by David York

Closed
as Fixed Help for as Fixed

4
0
Sign in
to vote
Type: Bug
ID: 565959
Opened: 6/8/2010 4:32:28 PM
Access Restriction: Public
1
Workaround(s)
1
User(s) can reproduce this bug
Visual Studio 2010 incorporates a common technique for converting a memory based 32 bit signed integer to a 32 bit floating point xmm register using a movd and cvtdq2ps instruction pairing.

The problem for us is that cvtdq2ps is an SSE2 instruction and might give the ol' PIII's and Athlon XP's pause when running programs compiled for SSE targets.

Example of incorrect code generation for SSE-only machines:

void test(float *v, int alpha) {

    float f = v[1] * alpha;
    ...

00000    66 0f 6e 44 24 04     movd     xmm0, DWORD PTR _alpha$[esp-4]
00006    f3 0f 10 48 04         movss     xmm1, DWORD PTR [eax+4]
0000b    0f 5b c0             cvtdq2ps xmm0, xmm0
0000e    f3 0f 59 c8         mulss     xmm1, xmm0

Using these compiler options:

D:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I"D:\Program Files\Microsoft DirectX SDK (February 2010)\Include"
/D WIN32 /D NDEBUG /D _WINDOWS /D UNICODE /D _WIN32_WINNT=0x0500 /D_VC80_UPGRADE=0x0600 /D _UNICODE /D UNICODE
/Zi /nologo /W2 /WX- /Ox /Ob1 /Oi /Ot /Oy /GL /GF /Gm- /MT /GS- /Gy
/arch:SSE /fp:fast /fp:except- /Zc:wchar_t /Zc:forScope /GR- /FAcs /Gr /TP /analyze- /errorReport:queue
/Fd".\Release/jack.pdb"

Details (expand)

Product Language

English

Visual Studio Version

Visual Studio 2010

Operating System

Windows 7

Operating System Language

English

Steps to Reproduce

1. Compile a program using VS2010 with /arch:SSE that converts from a memory integer operand to an xmm register
2. Run the program on an SSE only machine

Actual Results

3. Watch it crash

Expected Results

3. Profit!!!
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey.

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by chrispy81 on 2/4/2011 at 8:08 AM
Supposedly VS2010 SP1 Beta has the fix:
http://blogs.msdn.com/b/jasonz/archive/2010/12/20/visual-studio-2010-service-pack-1-beta-feedback.aspx
Posted by JamesWebb on 9/17/2010 at 5:37 PM
Have microsoft made any progress fixing this bug yet ?
My team really need this issue resolved
Posted by Microsoft on 8/23/2010 at 10:16 AM
Thank you for reporting this issue.
The fix will be provided during dev11 release cycle.
Posted by Microsoft on 6/11/2010 at 1:25 AM
Thank you for reporting the issue.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.These specialized experts will follow-up with your issue.
Posted by Microsoft on 6/9/2010 at 2:47 AM
Thank you for your feedback. We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com).
Sign in to post a workaround.
Posted by David York on 6/22/2010 at 10:08 PM
Haaa haa, just kidding.

About the workaround, not the bug.