[PATCH] D28213: [Frontend] Correct values of ATOMIC_*_LOCK_FREE to match builtin

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 14:15:43 PDT 2019


craig.topper added a comment.

It's still wrong. I think this might fix it?

  --- a/clang/lib/Basic/Targets/X86.h
  +++ b/clang/lib/Basic/Targets/X86.h
  @@ -346,9 +346,8 @@ public:
            (1 << TargetInfo::LongDouble));
  
       // x86-32 has atomics up to 8 bytes
  -    // FIXME: Check that we actually have cmpxchg8b before setting
  -    // MaxAtomicInlineWidth. (cmpxchg8b is an i586 instruction.)
  -    MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
  +    MaxAtomicPromoteWidth = 64;
  +    MaxAtomicInlineWidth = 32;
     }
  
     BuiltinVaListKind getBuiltinVaListKind() const override {
  @@ -384,6 +383,11 @@ public:
       return X86TargetInfo::validateOperandSize(Constraint, Size);
     }
  
  +  void setMaxAtomicWidth() override {
  +    if (CPU >= CK_i586)
  +      MaxAtomicInlineWidth = 64;
  +  }
  +
     ArrayRef<Builtin::Info> getTargetBuiltins() const override;
   };


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D28213/new/

https://reviews.llvm.org/D28213





More information about the cfe-commits mailing list