From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97847 invoked by alias); 7 Jan 2020 13:16:47 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 97839 invoked by uid 89); 7 Jan 2020 13:16:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*RU:209.85.208.193, HX-Spam-Relays-External:209.85.208.193 X-HELO: mail-lj1-f193.google.com Received: from mail-lj1-f193.google.com (HELO mail-lj1-f193.google.com) (209.85.208.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Jan 2020 13:16:46 +0000 Received: by mail-lj1-f193.google.com with SMTP id a13so54671102ljm.10 for ; Tue, 07 Jan 2020 05:16:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yvIUjzyqe1O6qfns6TLM2x3BVUPEgm7jK+FDn1apmVc=; b=GUnA72vLG9OMfhzWSjJEPdE0cEfoAIYTW1CAgSdOkCfhBOp3KesMMYCF1iMF1ODDu4 5FixRYblFTxV0ep2XmupqGnmJLxuDNQ01WFY0FJsFOfje1Gq1ulJS2SzqAUWGQWx4Q0/ CV8dy8wn/m1hpEqMSZFxOSXc6YmYLQu2uCm/+7DS5d3VIwTzV7q+4iuVLusIRAYZm2DW KdJhshUYfpsuVYQWtVyB3FaNGb7sPyVtY8BKcz4IX9Yc8chWu4IEkEgLC4xUE5a/xC5q l//fhwvCdSCMBuHXTMgaSIIqvljQ537CH0EzgZQ8yusuSSqCPY+xnmYn5YA6APIvx6O/ H0IA== MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Tue, 07 Jan 2020 13:16:00 -0000 Message-ID: Subject: Re: Frontend access to target-related options To: Nathan Sidwell Cc: The Other , GCC Development Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00056.txt.bz2 On Thu, Jan 2, 2020 at 5:54 PM Nathan Sidwell wrote: > > On 1/1/20 4:31 AM, The Other wrote: > > Hi, > > I'm currently working on a Rust frontend for GCC. Rust has some > > language-level conditional compilation features based on the presence or > > lack of features in the target architecture (e.g. SSE, AVX, a static C > > runtime) as well as the target CPU architecture itself, target OS, and > > various other target-related information (such as pointer width and > > endianness). > > > > As such, the frontend parser requires this target-related option > > information to be available to it. I was wondering if there was an > > architecture-neutral way of accessing this data (if it is even stored). > > I've looked into options.h but I cannot figure out how to use it in an > > architecture-neutral way. > > Um, AVX and such are arch-specific. It sounds like you need some kind > of (new?) langhook that targets can register? You mean target hook. Depending on the actual piece of info such hook might already exist though. Richard. > nathan > > -- > Nathan Sidwell