Community
cancel
Showing results for 
Search instead for 
Did you mean: 
kfsone
New Contributor I
78 Views

Windows / 11.1.065 assembly instruction issue

Jump to solution
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
Black Belt
78 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

2 Replies
jimdempseyatthecove
Black Belt
79 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

kfsone
New Contributor I
78 Views
Renaming it from Float to FloatArg did the trick, thanks :)
- Oliver
Reply