[all-commits] [llvm/llvm-project] e4ed93: [PowerPC] Implement XL compatible behavior of __co...

bzEq via All-commits all-commits at lists.llvm.org
Thu Jul 22 18:16:16 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e4ed93cb25acc624a1d32e77d2c63c8c25fddbae
      https://github.com/llvm/llvm-project/commit/e4ed93cb25acc624a1d32e77d2c63c8c25fddbae
  Author: Kai Luo <lkail at cn.ibm.com>
  Date:   2021-07-23 (Fri, 23 Jul 2021)

  Changed paths:
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/test/CodeGen/builtins-ppc-xlcompat-cas.c
    A llvm/test/CodeGen/PowerPC/opt-builtins-ppc-xlcompat-cas.ll

  Log Message:
  -----------
  [PowerPC] Implement XL compatible behavior of __compare_and_swap

According to https://www.ibm.com/docs/en/xl-c-and-cpp-aix/16.1?topic=functions-compare-swap-compare-swaplp
XL's `__compare_and_swap` has a weird behavior that

> In either case, the contents of the memory location specified by addr are copied into the memory location specified by old_val_addr.

(unlike c11 `atomic_compare_exchange` specified in http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf)

This patch let clang's implementation follow this behavior.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D106344




More information about the All-commits mailing list