Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Windows / 11.1.065 assembly instruction issue

kfsone
New Contributor I
575 Views
Trying to build a 3rd party product which uses the following code segment; it compiles OK under MSVC but it fails under ICC complaining about the "fld Float" instruction, although it appears to be a legal instruction.
[cpp]#if PROCESSOR_X86
inline int32
X86RoundingOp(real32 const Float, uint16 Mode)
{
    rounding_mode OldMode;
    rounding_mode NewMode;

    _asm {
        fstcw OldMode;
    };

    NewMode = OldMode;
    NewMode &= 0xF3FF;
    NewMode |= Mode << 10;

    int32 Int32;
    _asm {
        fldcw NewMode;
        fld Float;
        fistp Int32;
        fldcw OldMode;
    };

    return(Int32);
}
#endif[/cpp]
1>G:\\Dev\\1.31.0.255\\Libraries\\granny2\\source\\granny_controlled_animation.cpp(800) (col. 30): error: unsupported instruction form -- __asm fld
1>G:\\Dev\\1.31.0.255\\Libraries\\granny2\\source\\granny_controlled_animation.cpp(800) (col. 30): error: unsupported instruction form -- __asm fld
0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
575 Views
Oliver,

What happens if you remove "const" from Float? (type issue)
and/or
What happens if you change "Float" to "FloatArg"? (keyword issue)

Jim Dempsey

View solution in original post

0 Kudos
2 Replies
jimdempseyatthecove
Honored Contributor III
576 Views
Oliver,

What happens if you remove "const" from Float? (type issue)
and/or
What happens if you change "Float" to "FloatArg"? (keyword issue)

Jim Dempsey
0 Kudos
kfsone
New Contributor I
575 Views
Renaming it from Float to FloatArg did the trick, thanks :)
- Oliver
0 Kudos
Reply