cybercore

New Member
Joined
Jul 7, 2009
Messages
15,641
3D Now! Instructions are being Deprecated



AMD introduced the 3DNow! ™ instruction set back in the K6-2 days to do Single Instruction Multiple Data (SIMD) instructions, otherwise known as vectorized instructions. These were mainly used for graphics intensive applications and even audio processing. Since then, we have added many SIMD instruction sets to our processors, such as the widely used Streaming SIMD Extensions (SSE) instruction set and its successive versions.

3DNow! instructions are being deprecated and will not be supported in certain upcoming AMD processors. In those processors, the 3DNow! Instructions feature flag bit will not be set. This is indicated by EDX bit 31 of CPUID function 8000_0001h. This is a good time to remind developers just how important it is to check for features supported at runtime before using them. We have always recommended this feature check at runtime as a best practice, but it becomes very important now to help prevent your program from failing if it tries to execute this instruction without first checking if the feature is supported. Around the same time as 3DNow! instructions were developed, programmers were accustomed to using a model of ‘try and catch’ to check if a processor supported an instruction or instruction set. This is when the application ‘tries’ to execute an instruction to see if it’s available. If the application receives an Undefined Exception (#UD) from the processor, it believes the instruction set isn’t available. These types of applications may not do well under newer virtual machines. That’s subject for another blog though.

There is one exception. The 3DNow! versions of the PREFETCH and PREFETCHW instructions are now in a class of their own and AMD plans to continue to support them. This can be checked by testing bit 8 of register ECX following a CPUID function 8000_0001 instruction. This feature flag bit is named 3DNowPrefetch in the CPUID Specification.

What does this mean for you?

If your software used 3DNow! instructions at any point in time you should confirm that you only take that code path after checking to see if the feature is supported during runtime, using CPUID.

Most likely, your code already has another code path to take, such as an SSE path, if 3DNow! instructions are not supported. To reiterate, make sure that the code uses feature bits to determine when the code should take this path. If the code uses the vendorID string rather than a feature bit to make the path determination, AMD processors that support SSE may end up taking a slower path as a result.

If you are interested in changing your 3DNow! code to SSE, you can reference Appendix A of the AMD64 Architecture Programmer’s Manual, Volume 5. It lists the recommended SSE substitutions for those considering porting 3DNow! code to SSE.

Also, note that deprecating 3DNow! instructions or any other instruction set can have an impact on migrating virtual machines between dissimilar hardware.
 


Last edited:
Solution
The information provided about the deprecation of 3DNow! instructions by AMD is crucial for developers and software engineers who have built applications utilizing these instructions. Here's a breakdown of the key points and what it means for developers:
### Key Points:
1. Deprecation of 3DNow! Instructions:
- AMD is deprecating the 3DNow! instruction set in certain upcoming processors.
- Check for the absence of support for 3DNow! Instructions by examining the EDX bit 31 of CPUID function 8000_0001h.
- Developers are advised to check for features supported at runtime before utilizing them.
- The 3DNow! versions of PREFETCH and PREFETCHW instructions are exceptions and will continue to be supported.
2. Runtime...
The information provided about the deprecation of 3DNow! instructions by AMD is crucial for developers and software engineers who have built applications utilizing these instructions. Here's a breakdown of the key points and what it means for developers:
### Key Points:
1. Deprecation of 3DNow! Instructions:
- AMD is deprecating the 3DNow! instruction set in certain upcoming processors.
- Check for the absence of support for 3DNow! Instructions by examining the EDX bit 31 of CPUID function 8000_0001h.
- Developers are advised to check for features supported at runtime before utilizing them.
- The 3DNow! versions of PREFETCH and PREFETCHW instructions are exceptions and will continue to be supported.
2. Runtime Feature Check:
- It is essential to incorporate runtime feature checks to avoid program failures due to unsupported instructions.
- The 'try and catch' model of checking for instruction support by attempting to execute them can lead to issues under newer virtual machines.
3. Transition to SSE:
- Developers should ensure that code paths that previously used 3DNow! instructions now check for support and have alternative paths, such as for SSE instructions.
- Using feature bits for path determination is recommended over relying on the vendorID string to prevent slower execution paths on AMD processors supporting SSE instructions.
4. Porting to SSE:
- For those considering migrating 3DNow! code to SSE, the AMD64 Architecture Programmer’s Manual, Volume 5, Appendix A provides recommended SSE substitutions.
5. Implications on Virtual Machines:
- Deprecating 3DNow! instructions (or any other instruction set) can affect the migration of virtual machines between different hardware configurations.
### Recommendations:
  • Ensure Runtime Feature Checks: Verify feature support at runtime before utilizing instructions.
  • Transition to SSE: Update code paths to accommodate the deprecation of 3DNow! instructions, opting for SSE instructions where necessary.
  • Referencing Documentation: Consult AMD's Programmer’s Manual for guidance on migrating from 3DNow! to SSE.
  • Consider Virtual Machine Migration: Be aware of the impact on migrating virtual machines when dealing with deprecated instruction sets.
This information underscores the importance of proactive measures for developers to adapt to changes in hardware support, ensuring the continued smooth operation of their applications.
 


Solution
Back
Top