2024-02-23 22:32:32 +01:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
2023-05-02 17:22:19 +02:00
|
|
|
#pragma once
|
2023-11-05 15:56:28 +01:00
|
|
|
|
2024-02-14 23:52:57 +01:00
|
|
|
#include <array>
|
2023-09-29 13:40:26 +02:00
|
|
|
#include <cstdint>
|
2023-05-02 17:22:19 +02:00
|
|
|
|
2023-09-29 13:40:26 +02:00
|
|
|
using s08 = std::int8_t;
|
|
|
|
using s16 = std::int16_t;
|
|
|
|
using s32 = std::int32_t;
|
|
|
|
using s64 = std::int64_t;
|
2023-05-02 17:22:19 +02:00
|
|
|
|
2024-02-23 22:32:32 +01:00
|
|
|
using u8 = std::uint8_t;
|
2023-09-29 13:40:26 +02:00
|
|
|
using u16 = std::uint16_t;
|
|
|
|
using u32 = std::uint32_t;
|
|
|
|
using u64 = std::uint64_t;
|
2023-05-02 17:22:19 +02:00
|
|
|
|
|
|
|
using f32 = float;
|
2023-07-21 07:03:36 +02:00
|
|
|
using f64 = double;
|
|
|
|
|
2024-02-14 23:52:57 +01:00
|
|
|
using u128 = std::array<std::uint64_t, 2>;
|
|
|
|
static_assert(sizeof(u128) == 16, "u128 must be 128 bits wide");
|
|
|
|
|
2023-07-27 14:09:52 +02:00
|
|
|
#define PS4_SYSV_ABI __attribute__((sysv_abi))
|
|
|
|
|
|
|
|
// UDLs for memory size values
|
2024-02-23 21:57:57 +01:00
|
|
|
constexpr unsigned long long operator""_KB(unsigned long long x) {
|
|
|
|
return 1024ULL * x;
|
|
|
|
}
|
|
|
|
constexpr unsigned long long operator""_MB(unsigned long long x) {
|
|
|
|
return 1024_KB * x;
|
|
|
|
}
|
|
|
|
constexpr unsigned long long operator""_GB(unsigned long long x) {
|
|
|
|
return 1024_MB * x;
|
|
|
|
}
|