TEMU  4.4
The Terma Emulator
Extensions128.h
Go to the documentation of this file.
1 //===-- temu-c/Extensions128.h - 128-bit extensions -------------*- C++ -*-===//
2 //
3 // TEMU: The Terma Emulator
4 // (c) Terma 2023
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef TEMU_EXTENSIONS_128_H
9 #define TEMU_EXTENSIONS_128_H
10 #include "temu-c/Support/Memory.h"
11 
12 typedef __int128_t temu_Int128;
13 typedef __uint128_t temu_UInt128;
14 
15 typedef union {
18 } temu_ExtendedIR;
19 
20 static inline temu_UInt128
21 temu_atomicLoadU128(temu_UInt128 *p)
22 {
23  return __sync_val_compare_and_swap(p, 0, 0);
24 }
25 
26 static inline temu_UInt128
27 temu_atomicCompareAndSwapU128(temu_UInt128 *p, temu_UInt128 expected, temu_UInt128 exchangeVal)
28 {
29  return __sync_val_compare_and_swap(p, expected, exchangeVal);
30 }
31 
32 
33 #endif // !TEMU_EXTENSIONS_128_H
temu_ExtendedIR::Bits
temu_UInt128 Bits
Definition: Extensions128.h:17
temu_ExtendedIR::IRInst
temu_ExtIRInstruction IRInst
Definition: Extensions128.h:16
temu_UInt128
__uint128_t temu_UInt128
Definition: Extensions128.h:13
temu_Int128
__int128_t temu_Int128
Definition: Extensions128.h:12