From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19543 invoked by alias); 29 Jan 2004 20:50:36 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 19485 invoked from network); 29 Jan 2004 20:50:34 -0000 Received: from unknown (HELO mta6.wss.scd.yahoo.com) (66.218.85.37) by sources.redhat.com with SMTP; 29 Jan 2004 20:50:34 -0000 Received: from specifixinc.com (24.7.123.142) by mta6.wss.scd.yahoo.com (7.0.016) (authenticated as jim@tuliptree.org) id 401574690026969B for gcc@gcc.gnu.org; Thu, 29 Jan 2004 12:50:34 -0800 Message-ID: <40197221.3030708@specifixinc.com> Date: Thu, 29 Jan 2004 20:59:00 -0000 From: Jim Wilson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030716 MIME-Version: 1.0 To: GCC List Subject: Re: preprocessor: % as args to #defines References: <200401291844.i0TIiDT05165@linsvr1.uk.superh.com> <87u12eh9kj.fsf@egil.codesourcery.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-01/txt/msg02210.txt.bz2 inline asms can be replaced with intrinsics (built-in functions) with no significant loss of functionality. We may even gain functionality in some cases, because we may be able to optimize intrinsics better than inline asms. inline asms are a black box, but we know exactly what an intrinsic does. This places a burden on the compiler writer, since we need an intrinsic for every instruction that the end user might want to use, which means we may need hundreds of intrisics. However, this makes things easier for users, since intrinsics are much easier to use than inline asms. The Intel IA-64 compiler does not support inline asm, but it is able to compile the linux kernel, because it defines an intrinsic for almost every instruction. The IA-64 linux kernel calls the intrinsics directly, and then if compiled by gcc, it uses inline asm to implement the intrinsics. The main disadvantage I see of intrinsics is that it makes it easier for other compilers to replace gcc. Currently, anyone using gcc inline asm is captive to gcc, because no other compiler can reasonably implement it. This isn't a very good argument for it though. And we have already lost one major captive, the linux kernel. Also, another disadvantage is that people who insist on embedding assembly code in C, despite compiler experts telling them not to, will not be happy with intrinsics. You can't get your hands dirty writing intrinsics, like you can when you write inline asm. -- Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com