Results 1 to 12 of 12

Thread: What is the oldest version of Microsoft VC++ that supports intrinsic math functions?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,181

    What is the oldest version of Microsoft VC++ that supports intrinsic math functions?

    I'm using the earliest known free version of Microsoft Visual C++ called Microsoft Visual C++ Toolkit 2003. It has only the command line compiler/linker. No IDE or GUI interface of any kind. In its help documentation (which you can get by typing the command line "cl.exe /help") it indicates that the command line switch /Oi should enable intrinsic functions. That is, for example when trying to use the sin function, instead of looking in the static library LIBC.lib (or dynamic library MSVCRT.dll) for the _sin function, it is supposed to insert the x87 fsin instruction directly into the compiled code. This way it supposedly prevents dependency on any C library file, by directly inserting any available machine code instructions directly into the compiled code, in order to accomplish the same task. However, what I'm finding is that it instead is giving me the runarround, by refusing to use actual intrinsics. Instead it inserts a call to the function _CIsin in the code. And guess what, _CIsin is just another library function that simulates the use of the intrinsic fsin assembly instruction. I would like to do as much as possible to use intrinsics to separate my compiled program from the C library. And it seems MSVC++2003 isn't letting me do that.

    What is the earliest known version of MSVC++ that truly inserts intrinsic CPU/FPU instructions into the compiled code when use of intrinsic instructions is requested by the command line /Oi switch?

  2. #2
    Fanatic Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    996

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    Why do you want to use an extremely ancient versions of MS VC? The current community version of Visual Studio (2022) is free.
    https://visualstudio.microsoft.com/downloads/

    There has been massive changes to C++ over the intervening years (and also changes to c). I strongly suggest you consider using this latest version.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #3
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    Quote Originally Posted by 2kaud View Post
    Why do you want to use an extremely ancient versions of MS VC? The current community version of Visual Studio (2022) is free.
    https://visualstudio.microsoft.com/downloads/

    There has been massive changes to C++ over the intervening years (and also changes to c). I strongly suggest you consider using this latest version.
    That's a good point, but there are still many people who, for a variety of reasons, are running older versions of Windows that aren't capable of running the latest versions of Visual Studio (or many previous versions, for that matter).

    To the OP - from the brief research I did, I didn't come up with anything helpful, other than documentation that indicates that the "/Oi" switch is, for lack of a better word, a "request" to the compiler, and it has the ability to "line-item veto" that request when it determines it is appropriate to do so.

    Good luck.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,181

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    Quote Originally Posted by 2kaud View Post
    Why do you want to use an extremely ancient versions of MS VC? The current community version of Visual Studio (2022) is free.
    https://visualstudio.microsoft.com/downloads/

    There has been massive changes to C++ over the intervening years (and also changes to c). I strongly suggest you consider using this latest version.

    I'm using it as a command-line compiler, so I don't need the rest of the IDE for most of what I'm using it for. That old version of MSVC++ is command-line only, so it doesn't require the large amount of harddrive space that newer versions of MSVC++ require.

    Still your comment doesn't answer my question. My question is simply this:
    What is the earliest known version of MSVC++ that truly inserts intrinsic CPU/FPU instructions into the compiled code when use of intrinsic instructions is requested by the command line /Oi switch?

  5. #5
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    Quote Originally Posted by Ben321 View Post
    I'm using it as a command-line compiler, so I don't need the rest of the IDE for most of what I'm using it for. That old version of MSVC++ is command-line only, so it doesn't require the large amount of harddrive space that newer versions of MSVC++ require.

    Still your comment doesn't answer my question. My question is simply this:
    What is the earliest known version of MSVC++ that truly inserts intrinsic CPU/FPU instructions into the compiled code when use of intrinsic instructions is requested by the command line /Oi switch?
    I don't have access to anything earlier than Visual C++ 6.0. Visual C++ 6.0 does, and here is a snippet of documentation that may also be relevant to VC++ 2003 and your issue:

    "The floating-point functions listed below have true intrinsic forms when you specify both /Oi and /Og (or any option that includes /Og: /Ox, /O1, and /O2):

    atan exp sin
    atan2 log sqrt
    cos log10 tan"

    That's as much information I can offer. Good luck.

  6. #6
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio


  7. #7
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    One more note, the documentation for Visual C++ 6.0 states that, for the /Oi parameter, "Feature Only in Professional and Enterprise Editions Code optimization is supported only in Visual C++ Professional and Enterprise Editions."

    So, it might be the case that the freebie VC++ 2003 compiler that you are currently using doesn't include the optimization capabilities you are wanting, but perhaps the full Visual C++ 2003 edition does.

    If you have some simple code and some simple steps on how to check if it "worked" or not, I would be willing to test it out on the various versions of VC++ that I have access to.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,181

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    Quote Originally Posted by OptionBase1 View Post
    One more note, the documentation for Visual C++ 6.0 states that, for the /Oi parameter, "Feature Only in Professional and Enterprise Editions Code optimization is supported only in Visual C++ Professional and Enterprise Editions."

    So, it might be the case that the freebie VC++ 2003 compiler that you are currently using doesn't include the optimization capabilities you are wanting, but perhaps the full Visual C++ 2003 edition does.

    If you have some simple code and some simple steps on how to check if it "worked" or not, I would be willing to test it out on the various versions of VC++ that I have access to.


    I just tried combining /Oi with /Og and it does work. I'm using VC++ 2003 which actually comes after VC++ 6.0 and so it's newer and has more features in the free version. I don't think there even was an "Express" or "Community" free version of Visual Studio stuff as far back as VC++ 6.0 (or VB 6.0 either). Back then, I think all the Microsoft compilers cost money.

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,181

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    Quote Originally Posted by OptionBase1 View Post
    I don't have access to anything earlier than Visual C++ 6.0. Visual C++ 6.0 does, and here is a snippet of documentation that may also be relevant to VC++ 2003 and your issue:

    "The floating-point functions listed below have true intrinsic forms when you specify both /Oi and /Og (or any option that includes /Og: /Ox, /O1, and /O2):

    atan exp sin
    atan2 log sqrt
    cos log10 tan"

    That's as much information I can offer. Good luck.


    Where did you find the quote about specifying both /Oi and /Og? I'd been looking for that for a while because I remember seeing it before. Not sure where that is from. If you have a link to it, that would be great.

  10. #10
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    Quote Originally Posted by Ben321 View Post
    Where did you find the quote about specifying both /Oi and /Og? I'd been looking for that for a while because I remember seeing it before. Not sure where that is from. If you have a link to it, that would be great.
    It is in the C++ section of the MSDN help files that I have installed from Visual Studio 6.0.

  11. #11
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    Quote Originally Posted by Ben321 View Post
    I just tried combining /Oi with /Og and it does work. I'm using VC++ 2003 which actually comes after VC++ 6.0 and so it's newer and has more features in the free version. I don't think there even was an "Express" or "Community" free version of Visual Studio stuff as far back as VC++ 6.0 (or VB 6.0 either). Back then, I think all the Microsoft compilers cost money.
    You are correct, but your earlier inquiries never mentioned a requirement of being free, just that it be the "earliest known version".

  12. #12
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: What is the oldest version of Microsoft VC++ that supports intrinsic math functio

    Just for the sake of anyone who might come upon this thread in the future that is looking for a place to still download the Microsoft Visual C++ Toolkit 2003, here is what I could find.

    It used to have a presence on Microsoft websites at the following URL's:

    Product main page: http://msdn.microsoft.com/visualc/vctoolkit2003/
    Download page: http://www.microsoft.com/downloads/d...displaylang=en
    Direct download URL: http://download.microsoft.com/downlo...olkitSetup.exe

    Of course, none of those URL's work any longer. For the first two, I was able to locate archived copies of them on the Wayback machine, but the direct download URL appears to have never been archived on the Wayback machine until after the download was pulled, so all of the archived instances of that URL are simply a 404 error page.

    That being said, I was able to track down a seemingly legitimate copy (use at your own risk, of course) of the original installation file on a Swedish University site, and it can be found here:

    Code:
    https://www.lysator.liu.se/~andro/exjobb/extras-win32/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width