From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7848 invoked by alias); 5 Apr 2003 09:08:30 -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 7841 invoked from network); 5 Apr 2003 09:08:29 -0000 Received: from unknown (HELO mail.ut.caldera.com) (216.250.130.2) by sources.redhat.com with SMTP; 5 Apr 2003 09:08:29 -0000 Received: (qmail 27748 invoked from network); 5 Apr 2003 09:08:29 -0000 Received: from vms.caldera.com (216.250.130.31) by mail.ut.caldera.com with SMTP; 5 Apr 2003 09:08:29 -0000 Received: from vms.caldera.com (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id 860E0A005; Sat, 5 Apr 2003 02:08:28 -0700 (MST) Received: from shrike (shrike.pdev.ca.caldera.com [132.147.65.3]) by vms.caldera.com (Postfix) with ESMTP id B8899A006; Sat, 5 Apr 2003 02:08:27 -0700 (MST) From: "Kean Johnston" To: "'Falk Hueffner'" Cc: Subject: RE: __builtin_generic Date: Sat, 05 Apr 2003 12:22:00 -0000 Organization: The SCO Group Message-ID: <005601c2fb51$d20dd5c0$03419384@shrike> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: <87fzoyfc8f.fsf@student.uni-tuebingen.de> Importance: Normal X-SW-Source: 2003-04/txt/msg00216.txt.bz2 > Thhis should be doable with __builtin_types_compatible_p, which > already exists in recent gccs. Sort of, in an indirect, implement-it-yourself way. The whole idea of __builtin_generic is that it really replaces the actual function call based on the type. So if I call cos((long double)x), it will actually emit a call to cosld(). This handles, at the *COMPILER* level, the equivalent of that macro the manual lists. So yes, I agree that types_compat is at least part of the solution, __builtin_generic is considerably cleaner (in my opinion). The types_compatibile mechanism relies on the fact that the optimizer will recognize a constant condition and hopefully (I do mean hopefully, its not like the optimizer doesn't have bugs, or like its even always active) call the desired function. __builtin_generic is pretty much a guarantee that it will do the right thing. Doesn't seem like theres a lot of enthusiasm for this though, so I guess if I want to see it implemented I'll have to do it myself. I hope the lack of enthusiasm isnt because of my FQDN, as has happened on other lists. Kean