Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SSE4 support in Xcode and CHUD - when?




On Jan 8, 2008, at 10:31 PM, Rustam Muginov wrote:

Hello all.
Apple showed SSE4-based mac pros.
When could we expect SSE4 support for gcc/intrinsics and in Shark/ CHUD Tools?

There will be a header called smmintrin.h that contains the intrinsics.

	#include <smmintrin.h>

The intrinsics themselves are described here:

	http://softwarecommunity.intel.com/isn/Downloads/Intel%20SSE4%20Programming%20Reference.pdf

The kernel support for detecting SSE4.1 is already in Leopard. Use sysctlbyname() with the "hw.optional.sse4_1" selector.

Based on SSE4.1 support in FSF GCC 4.3 <http://gcc.gnu.org/ml/gcc-patches/2007-04/msg01167.html > (Apple usually does the same thing) the CPP symbol used to bracket SSE 4.1 code looks to be __SSE4_1__.

This should be sufficient to allow you to write the SSE4.1 code at least. When the right compiler arrives, then you can try turning on - msse4.1, and see if it compiles. In the mean time, it shouldn't cause any trouble (missing symbols aside) because it is hiding behind __SSE4_1__.

As always, move code that uses optional vector extensions to its own file. For example, if you have a function that just uses SSSE3 and another function that uses SSSE3 and SSE4.1, they should be in different files. Code intended to run on any MacOS X Intel machine should not appear in those files. Pass -mssse3, -msse4.1, etc. to only those files that need it.

	Xcode User Guide: Per-File Compiler Flags:
	http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_04_bs_build_settings/chapter_33_section_6.html

I haven't checked the status of the assembler, but it seems reasonable to expect that any GCC 4.1 compiler will be accompanied by a GCC 4.1 aware assembler. It may already know about it. If it doesn't, truly desperate individuals can use .byte to insert the byte sequence for the opcode into assembly with the existing assembler, but you'll have to do your own register assignment, which probably rules out asms in C. (I haven't really looked into that thoroughly, though, so maybe there is a way to do that.)

	http://developer.apple.com/documentation/DeveloperTools/Reference/Assembler/ASMDirectives/chapter_5_section_4.html

I don't know the CHUD story.

Ian

_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden
References: 
 >SSE4 support in Xcode and CHUD - when? (From: Rustam Muginov <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.