1// WebAssemblyInstrAtomics.td-WebAssembly Atomic codegen support-*- tablegen -*- 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9/// 10/// \file 11/// \brief WebAssembly Atomic operand code-gen constructs. 12/// 13//===----------------------------------------------------------------------===// 14 15//===----------------------------------------------------------------------===// 16// Atomic loads 17//===----------------------------------------------------------------------===// 18 19let Defs = [ARGUMENTS] in { 20// TODO: add the rest of the atomic loads 21// TODO: factor out 0xfe atomic prefix? 22def ATOMIC_LOAD_I32 : ATOMIC_I<(outs I32:$dst), 23 (ins P2Align:$p2align, offset32_op:$off, I32:$addr), 24 [], "i32.atomic.load\t$dst, ${off}(${addr})${p2align}", 25 0xfe10>; 26} // Defs = [ARGUMENTS] 27 28// Select loads with no constant offset. 29let Predicates = [HasAtomics] in { 30def : Pat<(i32 (atomic_load I32:$addr)), (ATOMIC_LOAD_I32 0, 0, $addr)>; 31} 32 33//===----------------------------------------------------------------------===// 34// Atomic stores 35//===----------------------------------------------------------------------===// 36 37// TODO: add atomic stores here... 38 39//===----------------------------------------------------------------------===// 40// Low-level exclusive operations 41//===----------------------------------------------------------------------===// 42 43// TODO: add exclusive operations here... 44 45// Load-exclusives. 46 47// Store-exclusives. 48 49// Store-release-exclusives. 50 51// And clear exclusive. 52 53