From owner-svn-src-projects@freebsd.org Sun Oct 7 09:06:22 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2069C10B9426 for ; Sun, 7 Oct 2018 09:06:22 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it1-f194.google.com (mail-it1-f194.google.com [209.85.166.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB15B7B422; Sun, 7 Oct 2018 09:06:21 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it1-f194.google.com with SMTP id w200-v6so8181335itc.4; Sun, 07 Oct 2018 02:06:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qRhpRfs3Gi88X7LGBe3mP6utf8vD+EA/7AK5C60vNXY=; b=CWqfPeuxcFZmHrc1rBaHnpATRVMPPcwzxpvATYh4KEHa00+R4na7mnoCq7qwnkB8pN VnCRhGM2/dDpCkqmwoTXQ+WfSrDatCShLzJ7iA4bpGUldpLmXExHFfnbi60Wsu50/nBV 4GVizMz4liJBoyUp1FEovRjU4mMGSk52ahbmZaPqIjeFgK5tbM6PBMA+dw45+1wTZckO rkysu5RPEJJL7WvUxS+kGaptihNCZxDyJegITElcxBAAJ+NJFHAqRUhJgkBeVKgvK6Uu U3BEIH5q7zOw21XgDeehnsBMyMVGqjdpmliscQtlRyKU36HXK7qvKFiqVwhO6uhre8wF em6w== X-Gm-Message-State: ABuFfohAGXYczqnaOppw9EfnLLLtPny+I+WVY3izcYIhSAjGU1T8H9TY i2TpRwCyEWk9C/8PEgm3209YjK630pQ5cXrcysBd0A== X-Google-Smtp-Source: ACcGV60XS1wmiFSC6Ut754KtD5rCmkXAXtffTtwrx1ed0y650IxjvM/fhBlept9Lf+655mdw8AG5PnEI/UBMK5Zh4MU= X-Received: by 2002:a24:5f15:: with SMTP id r21-v6mr13117438itb.6.1538902689057; Sun, 07 Oct 2018 01:58:09 -0700 (PDT) MIME-Version: 1.0 References: <201808171626.w7HGQ0Sp020544@repo.freebsd.org> In-Reply-To: <201808171626.w7HGQ0Sp020544@repo.freebsd.org> From: Antoine Brodin Date: Sun, 7 Oct 2018 10:57:57 +0200 Message-ID: Subject: Re: svn commit: r337979 - projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets To: Dimitry Andric Cc: src-committers , svn-src-projects@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2018 09:06:22 -0000 On Fri, Aug 17, 2018 at 6:26 PM Dimitry Andric wrote: > Author: dim > Date: Fri Aug 17 16:25:59 2018 > New Revision: 337979 > URL: https://svnweb.freebsd.org/changeset/base/337979 > > Log: > For now, revert upstream clang r323281 (by Wei Mi): > > Adjust MaxAtomicInlineWidth for i386/i486 targets. > > This is to fix the bug reported in > https://bugs.llvm.org/show_bug.cgi?id=34347#c6. Currently, all > MaxAtomicInlineWidth of x86-32 targets are set to 64. However, i386 > doesn't support any cmpxchg related instructions. i486 only supports > cmpxchg. So in this patch MaxAtomicInlineWidth is reset as follows: > For i386, the MaxAtomicInlineWidth should be 0 because no cmpxchg is > supported. For i486, the MaxAtomicInlineWidth should be 32 because > it supports cmpxchg. For others 32 bits x86 cpu, the > MaxAtomicInlineWidth should be 64 because of cmpxchg8b. > > Differential Revision: https://reviews.llvm.org/D42154 > > This should fix buildworld on i386, because of our system libraries > missing __atomic_load_8, and possibly other 64 bit atomic functions, for > that architecture. > > We should really fix that at some point, but since we have been actually > using cmpxchg8b for years now, it does not seem to matter much... Hi, Is it possible to backport something similar on stable/11 and maybe do an EN for 11.2? Antoine > Modified: > projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h > > Modified: projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h > ============================================================================== > --- projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h Fri Aug 17 16:19:47 2018 (r337978) > +++ projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h Fri Aug 17 16:25:59 2018 (r337979) > @@ -350,11 +350,9 @@ class LLVM_LIBRARY_VISIBILITY X86_32TargetInfo : publi > (1 << TargetInfo::LongDouble)); > > // x86-32 has atomics up to 8 bytes > - CPUKind Kind = getCPUKind(Opts.CPU); > - if (Kind >= CK_i586 || Kind == CK_Generic) > - MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; > - else if (Kind >= CK_i486) > - MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; > + // FIXME: Check that we actually have cmpxchg8b before setting > + // MaxAtomicInlineWidth. (cmpxchg8b is an i586 instruction.) > + MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; > } > > BuiltinVaListKind getBuiltinVaListKind() const override { >