Abstract
There is little exploitation of the SIMD instructions described in the previous chapter because of relatively poor compiler support. When the MMX and SSE instructions became available, Intel supplied a C compiler that had low-level extensions allowing the extended instructions to be used. Intel terms these extensions ‘assembler intrinsics’. Syntactically these look like C functions but they are translated one for one into equivalent assembler instructions. The use of assembler intrinsics simplifies the process of developing MMX code, in that programmers use a single tool — the C compiler, and do not need to concern themselves with low-level linkage issues. However, the other disadvantages of assembler coding remain. The Intel C compiler comes with a set of C++ classes that correspond to the fundamental types supported by the MMX and SIMD instruction sets. The SIMD classes do a good job of presenting the underlying capabilities of the architecture within the context of the C language. The code produced is also efficient. However, although the C++ code has a higher level of expression than assembler intrinsics, it is not portable to other processors. The same approach of essentially allowing assembler inserts into a high-level language was adopted by other compilers: TMT-Pascal, Free-Pascal and a release of gcc for the G4 processor used in the iMac.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag London
About this chapter
Cite this chapter
Cockshott, P., Renfrew, K. (2004). SIMD Programming in Assembler and C. In: SIMD Programming Manual for Linux and Windows. Springer Professional Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3862-4_3
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3862-4_3
Publisher Name: Springer, London
Print ISBN: 978-1-84996-920-8
Online ISBN: 978-1-4471-3862-4
eBook Packages: Springer Book Archive