sbin/fsck_ffs/main.c
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
#include <fstab.h> #include <fstab.h>
#include <grp.h> #include <grp.h>
#include <inttypes.h> #include <inttypes.h>
+#include <libufs.h>
#include <mntopts.h> #include <mntopts.h>
#include <paths.h> #include <paths.h>
#include <stdint.h> #include <stdint.h>
@@ -604,10 +605,8 @@ checkfilesys(char *filesys)
/* /*
* Write out the duplicate super blocks * Write out the duplicate super blocks
*/ */
- for (cylno = 0; cylno < sblock.fs_ncg; cylno++)+ if (sbput(fswritefd, &sblock, sblock.fs_ncg) == 0)
- blwrite(fswritefd, (char *)&sblock,+ fsmodified = 1;
- fsbtodb(&sblock, cgsblock(&sblock, cylno)),
- SBLOCKSIZE);
} }
if (rerun) if (rerun)
resolved = 0; resolved = 0;
sys/arm64/arm64/identcpu.c
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
#include <machine/elf.h> #include <machine/elf.h>
static void print_cpu_features(u_int cpu); static void print_cpu_features(u_int cpu);
-static u_long parse_cpu_features_hwcap(u_int cpu);+static u_long parse_cpu_features_hwcap(void);
char machine[] = "arm64"; char machine[] = "arm64";
@@ -364,6 +364,31 @@ static struct mrs_field id_aa64dfr1_fields[] = {
/* ID_AA64ISAR0_EL1 */ /* ID_AA64ISAR0_EL1 */
+static struct mrs_field_value id_aa64isar0_rndr[] = {
+ MRS_FIELD_VALUE(ID_AA64ISAR0_RNDR_NONE, ""),
+ MRS_FIELD_VALUE(ID_AA64ISAR0_RNDR_IMPL, "RNG"),
+ MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_aa64isar0_tlb[] = {
+ MRS_FIELD_VALUE(ID_AA64ISAR0_TLB_NONE, ""),
+ MRS_FIELD_VALUE(ID_AA64ISAR0_TLB_TLBIOS, "TLBI-OS"),
+ MRS_FIELD_VALUE(ID_AA64ISAR0_TLB_TLBIOSR, "TLBI-OSR"),
+ MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_aa64isar0_ts[] = {
+ MRS_FIELD_VALUE(ID_AA64ISAR0_TS_NONE, ""),
+ MRS_FIELD_VALUE(ID_AA64ISAR0_TS_CondM_8_4, "CondM-8.4"),
+ MRS_FIELD_VALUE(ID_AA64ISAR0_TS_CondM_8_5, "CondM-8.5"),
+ MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_aa64isar0_fhm[] = {
+ MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, FHM, NONE, IMPL),
+ MRS_FIELD_VALUE_END,
+};
+
static struct mrs_field_value id_aa64isar0_dp[] = { static struct mrs_field_value id_aa64isar0_dp[] = {
MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, DP, NONE, IMPL), MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, DP, NONE, IMPL),
MRS_FIELD_VALUE_END, MRS_FIELD_VALUE_END,
@@ -417,6 +442,10 @@ static struct mrs_field_value id_aa64isar0_aes[] = {
}; };
static struct mrs_field id_aa64isar0_fields[] = { static struct mrs_field id_aa64isar0_fields[] = {
+ MRS_FIELD(ID_AA64ISAR0, RNDR, false, MRS_LOWER, id_aa64isar0_rndr),
+ MRS_FIELD(ID_AA64ISAR0, TLB, false, MRS_LOWER, id_aa64isar0_tlb),
+ MRS_FIELD(ID_AA64ISAR0, TS, false, MRS_LOWER, id_aa64isar0_ts),
+ MRS_FIELD(ID_AA64ISAR0, FHM, false, MRS_LOWER, id_aa64isar0_fhm),
MRS_FIELD(ID_AA64ISAR0, DP, false, MRS_LOWER, id_aa64isar0_dp), MRS_FIELD(ID_AA64ISAR0, DP, false, MRS_LOWER, id_aa64isar0_dp),
MRS_FIELD(ID_AA64ISAR0, SM4, false, MRS_LOWER, id_aa64isar0_sm4), MRS_FIELD(ID_AA64ISAR0, SM4, false, MRS_LOWER, id_aa64isar0_sm4),
MRS_FIELD(ID_AA64ISAR0, SM3, false, MRS_LOWER, id_aa64isar0_sm3), MRS_FIELD(ID_AA64ISAR0, SM3, false, MRS_LOWER, id_aa64isar0_sm3),
@@ -432,6 +461,37 @@ static struct mrs_field id_aa64isar0_fields[] = {
/* ID_AA64ISAR1_EL1 */ /* ID_AA64ISAR1_EL1 */
+static struct mrs_field_value id_aa64isar1_i8mm[] = {
+ MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, I8MM, NONE, IMPL),
+ MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_aa64isar1_dgh[] = {
+ MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, DGH, NONE, IMPL),
+ MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_aa64isar1_bf16[] = {
+ MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, BF16, NONE, IMPL),
+ MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_aa64isar1_specres[] = {
+ MRS_FIELD_VALUE(ID_AA64ISAR1_SPECRES_NONE, ""),
+ MRS_FIELD_VALUE(ID_AA64ISAR1_SPECRES_IMPL, "PredInv"),
+ MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_aa64isar1_sb[] = {
+ MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, SB, NONE, IMPL),
+ MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_aa64isar1_frintts[] = {
+ MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, FRINTTS, NONE, IMPL),
+ MRS_FIELD_VALUE_END,
+};
+
static struct mrs_field_value id_aa64isar1_gpi[] = { static struct mrs_field_value id_aa64isar1_gpi[] = {
MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, GPI, NONE, IMPL), MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, GPI, NONE, IMPL),
MRS_FIELD_VALUE_END, MRS_FIELD_VALUE_END,
@@ -443,7 +503,9 @@ static struct mrs_field_value id_aa64isar1_gpa[] = {
}; };
static struct mrs_field_value id_aa64isar1_lrcpc[] = { static struct mrs_field_value id_aa64isar1_lrcpc[] = {
- MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, LRCPC, NONE, IMPL),+ MRS_FIELD_VALUE(ID_AA64ISAR1_LRCPC_NONE, ""),
+ MRS_FIELD_VALUE(ID_AA64ISAR1_LRCPC_RCPC_8_3, "RCPC-8.3"),
+ MRS_FIELD_VALUE(ID_AA64ISAR1_LRCPC_RCPC_8_4, "RCPC-8.4"),
MRS_FIELD_VALUE_END, MRS_FIELD_VALUE_END,
}; };
@@ -463,16 +525,26 @@ static struct mrs_field_value id_aa64isar1_api[] = {
}; };
static struct mrs_field_value id_aa64isar1_apa[] = { static struct mrs_field_value id_aa64isar1_apa[] = {
- MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, GPA, NONE, IMPL),+ MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, APA, NONE, IMPL),
MRS_FIELD_VALUE_END, MRS_FIELD_VALUE_END,
}; };
static struct mrs_field_value id_aa64isar1_dpb[] = { static struct mrs_field_value id_aa64isar1_dpb[] = {
- MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, DPB, NONE, IMPL),+ MRS_FIELD_VALUE(ID_AA64ISAR1_DPB_NONE, ""),
+ MRS_FIELD_VALUE(ID_AA64ISAR1_DPB_DCCVAP, "DCPoP"),
+ MRS_FIELD_VALUE(ID_AA64ISAR1_DPB_DCCVADP, "DCCVADP"),
MRS_FIELD_VALUE_END, MRS_FIELD_VALUE_END,
}; };
static struct mrs_field id_aa64isar1_fields[] = { static struct mrs_field id_aa64isar1_fields[] = {
+ MRS_FIELD(ID_AA64ISAR1, I8MM, false, MRS_LOWER, id_aa64isar1_i8mm),
+ MRS_FIELD(ID_AA64ISAR1, DGH, false, MRS_LOWER, id_aa64isar1_dgh),
+ MRS_FIELD(ID_AA64ISAR1, BF16, false, MRS_LOWER, id_aa64isar1_bf16),
+ MRS_FIELD(ID_AA64ISAR1, SPECRES, false, MRS_LOWER,
+ id_aa64isar1_specres),
+ MRS_FIELD(ID_AA64ISAR1, SB, false, MRS_LOWER, id_aa64isar1_sb),
+ MRS_FIELD(ID_AA64ISAR1, FRINTTS, false, MRS_LOWER,
+ id_aa64isar1_frintts),
MRS_FIELD(ID_AA64ISAR1, GPI, false, MRS_EXACT, id_aa64isar1_gpi), MRS_FIELD(ID_AA64ISAR1, GPI, false, MRS_EXACT, id_aa64isar1_gpi),
MRS_FIELD(ID_AA64ISAR1, GPA, false, MRS_EXACT, id_aa64isar1_gpa), MRS_FIELD(ID_AA64ISAR1, GPA, false, MRS_EXACT, id_aa64isar1_gpa),
MRS_FIELD(ID_AA64ISAR1, LRCPC, false, MRS_LOWER, id_aa64isar1_lrcpc), MRS_FIELD(ID_AA64ISAR1, LRCPC, false, MRS_LOWER, id_aa64isar1_lrcpc),
@@ -1023,7 +1095,7 @@ update_special_regs(u_int cpu)
for (j = 0; fields[j].type != 0; j++) { for (j = 0; fields[j].type != 0; j++) {
switch (fields[j].type & MRS_TYPE_MASK) { switch (fields[j].type & MRS_TYPE_MASK) {
case MRS_EXACT: case MRS_EXACT:
- user_reg &= ~(0xfu << fields[j].shift);+ user_reg &= ~(0xful << fields[j].shift);
user_reg |= user_reg |=
(uint64_t)MRS_EXACT_FIELD(fields[j].type) << (uint64_t)MRS_EXACT_FIELD(fields[j].type) <<
fields[j].shift; fields[j].shift;
@@ -1059,7 +1131,6 @@ static void
identify_cpu_sysinit(void *dummy __unused) identify_cpu_sysinit(void *dummy __unused)
{ {
int cpu; int cpu;
- u_long hwcap;
bool dic, idc; bool dic, idc;
dic = (allow_dic != 0); dic = (allow_dic != 0);
@@ -1067,11 +1138,6 @@ identify_cpu_sysinit(void *dummy __unused)
CPU_FOREACH(cpu) { CPU_FOREACH(cpu) {
check_cpu_regs(cpu); check_cpu_regs(cpu);
- hwcap = parse_cpu_features_hwcap(cpu);
- if (elf_hwcap == 0)
- elf_hwcap = hwcap;
- else
- elf_hwcap &= hwcap;
if (cpu != 0) if (cpu != 0)
update_special_regs(cpu); update_special_regs(cpu);
@@ -1081,6 +1147,9 @@ identify_cpu_sysinit(void *dummy __unused)
idc = false; idc = false;
} }
+ /* Exposed to userspace as AT_HWCAP */
+ elf_hwcap = parse_cpu_features_hwcap();
+
if (dic && idc) { if (dic && idc) {
arm64_icache_sync_range = &arm64_dic_idc_icache_sync_range; arm64_icache_sync_range = &arm64_dic_idc_icache_sync_range;
if (bootverbose) if (bootverbose)
@@ -1112,43 +1181,49 @@ cpu_features_sysinit(void *dummy __unused)
SYSINIT(cpu_features, SI_SUB_SMP, SI_ORDER_ANY, cpu_features_sysinit, NULL); SYSINIT(cpu_features, SI_SUB_SMP, SI_ORDER_ANY, cpu_features_sysinit, NULL);
static u_long static u_long
-parse_cpu_features_hwcap(u_int cpu)+parse_cpu_features_hwcap(void)
{ {
u_long hwcap = 0; u_long hwcap = 0;
- if (ID_AA64ISAR0_DP_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_DP_IMPL)+ if (ID_AA64ISAR0_DP_VAL(user_cpu_desc.id_aa64isar0) ==
+ ID_AA64ISAR0_DP_IMPL)
hwcap |= HWCAP_ASIMDDP; hwcap |= HWCAP_ASIMDDP;
- if (ID_AA64ISAR0_SM4_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM4_IMPL)+ if (ID_AA64ISAR0_SM4_VAL(user_cpu_desc.id_aa64isar0) ==
+ ID_AA64ISAR0_SM4_IMPL)
hwcap |= HWCAP_SM4; hwcap |= HWCAP_SM4;
- if (ID_AA64ISAR0_SM3_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM3_IMPL)+ if (ID_AA64ISAR0_SM3_VAL(user_cpu_desc.id_aa64isar0) ==
+ ID_AA64ISAR0_SM3_IMPL)
hwcap |= HWCAP_SM3; hwcap |= HWCAP_SM3;
- if (ID_AA64ISAR0_RDM_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_RDM_IMPL)+ if (ID_AA64ISAR0_RDM_VAL(user_cpu_desc.id_aa64isar0) ==
+ ID_AA64ISAR0_RDM_IMPL)
hwcap |= HWCAP_ASIMDRDM; hwcap |= HWCAP_ASIMDRDM;
- if (ID_AA64ISAR0_Atomic_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_Atomic_IMPL)+ if (ID_AA64ISAR0_Atomic_VAL(user_cpu_desc.id_aa64isar0) ==
+ ID_AA64ISAR0_Atomic_IMPL)
hwcap |= HWCAP_ATOMICS; hwcap |= HWCAP_ATOMICS;
- if (ID_AA64ISAR0_CRC32_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE)+ if (ID_AA64ISAR0_CRC32_VAL(user_cpu_desc.id_aa64isar0) ==
+ ID_AA64ISAR0_CRC32_BASE)
hwcap |= HWCAP_CRC32; hwcap |= HWCAP_CRC32;
- switch (ID_AA64ISAR0_SHA2_VAL(cpu_desc[cpu].id_aa64isar0)) {+ switch (ID_AA64ISAR0_SHA2_VAL(user_cpu_desc.id_aa64isar0)) {
- case ID_AA64ISAR0_SHA2_BASE:+ case ID_AA64ISAR0_SHA2_BASE:
- hwcap |= HWCAP_SHA2;+ hwcap |= HWCAP_SHA2;
- break;+ break;
- case ID_AA64ISAR0_SHA2_512:+ case ID_AA64ISAR0_SHA2_512:
- hwcap |= HWCAP_SHA2 | HWCAP_SHA512;+ hwcap |= HWCAP_SHA2 | HWCAP_SHA512;
- break;+ break;
default: default:
break; break;
} }
- if (ID_AA64ISAR0_SHA1_VAL(cpu_desc[cpu].id_aa64isar0))+ if (ID_AA64ISAR0_SHA1_VAL(user_cpu_desc.id_aa64isar0))
hwcap |= HWCAP_SHA1; hwcap |= HWCAP_SHA1;
- switch (ID_AA64ISAR0_AES_VAL(cpu_desc[cpu].id_aa64isar0)) {+ switch (ID_AA64ISAR0_AES_VAL(user_cpu_desc.id_aa64isar0)) {
case ID_AA64ISAR0_AES_BASE: case ID_AA64ISAR0_AES_BASE:
hwcap |= HWCAP_AES; hwcap |= HWCAP_AES;
break; break;
@@ -1159,22 +1234,27 @@ parse_cpu_features_hwcap(u_int cpu)
break; break;
} }
- if (ID_AA64ISAR1_LRCPC_VAL(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_LRCPC_IMPL)+ if (ID_AA64ISAR1_LRCPC_VAL(user_cpu_desc.id_aa64isar1) ==
+ ID_AA64ISAR1_LRCPC_RCPC_8_3)
hwcap |= HWCAP_LRCPC; hwcap |= HWCAP_LRCPC;
- if (ID_AA64ISAR1_FCMA_VAL(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_FCMA_IMPL)+ if (ID_AA64ISAR1_FCMA_VAL(user_cpu_desc.id_aa64isar1) ==
+ ID_AA64ISAR1_FCMA_IMPL)
hwcap |= HWCAP_FCMA; hwcap |= HWCAP_FCMA;
- if (ID_AA64ISAR1_JSCVT_VAL(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_JSCVT_IMPL)+ if (ID_AA64ISAR1_JSCVT_VAL(user_cpu_desc.id_aa64isar1) ==
+ ID_AA64ISAR1_JSCVT_IMPL)
hwcap |= HWCAP_JSCVT; hwcap |= HWCAP_JSCVT;
- if (ID_AA64ISAR1_DPB_VAL(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_DPB_IMPL)+ if (ID_AA64ISAR1_DPB_VAL(user_cpu_desc.id_aa64isar1) ==
+ ID_AA64ISAR1_DPB_DCCVAP)
hwcap |= HWCAP_DCPOP; hwcap |= HWCAP_DCPOP;
- if (ID_AA64PFR0_SVE_VAL(cpu_desc[cpu].id_aa64pfr0) == ID_AA64PFR0_SVE_IMPL)+ if (ID_AA64PFR0_SVE_VAL(user_cpu_desc.id_aa64pfr0) ==
+ ID_AA64PFR0_SVE_IMPL)
hwcap |= HWCAP_SVE; hwcap |= HWCAP_SVE;
- switch (ID_AA64PFR0_AdvSIMD_VAL(cpu_desc[cpu].id_aa64pfr0)) {+ switch (ID_AA64PFR0_AdvSIMD_VAL(user_cpu_desc.id_aa64pfr0)) {
case ID_AA64PFR0_AdvSIMD_IMPL: case ID_AA64PFR0_AdvSIMD_IMPL:
hwcap |= HWCAP_ASIMD; hwcap |= HWCAP_ASIMD;
break; break;
@@ -1185,7 +1265,7 @@ parse_cpu_features_hwcap(u_int cpu)
break; break;
} }
- switch (ID_AA64PFR0_FP_VAL(cpu_desc[cpu].id_aa64pfr0)) {+ switch (ID_AA64PFR0_FP_VAL(user_cpu_desc.id_aa64pfr0)) {
case ID_AA64PFR0_FP_IMPL: case ID_AA64PFR0_FP_IMPL:
hwcap |= HWCAP_FP; hwcap |= HWCAP_FP;
break; break;
sys/arm64/include/armreg.h
@@ -350,6 +350,28 @@
#define ID_AA64ISAR0_DP_VAL(x) ((x) & ID_AA64ISAR0_DP_MASK) #define ID_AA64ISAR0_DP_VAL(x) ((x) & ID_AA64ISAR0_DP_MASK)
#define ID_AA64ISAR0_DP_NONE (UL(0x0) << ID_AA64ISAR0_DP_SHIFT) #define ID_AA64ISAR0_DP_NONE (UL(0x0) << ID_AA64ISAR0_DP_SHIFT)
#define ID_AA64ISAR0_DP_IMPL (UL(0x1) << ID_AA64ISAR0_DP_SHIFT) #define ID_AA64ISAR0_DP_IMPL (UL(0x1) << ID_AA64ISAR0_DP_SHIFT)
+#define ID_AA64ISAR0_FHM_SHIFT 48
+#define ID_AA64ISAR0_FHM_MASK (UL(0xf) << ID_AA64ISAR0_FHM_SHIFT)
+#define ID_AA64ISAR0_FHM_VAL(x) ((x) & ID_AA64ISAR0_FHM_MASK)
+#define ID_AA64ISAR0_FHM_NONE (UL(0x0) << ID_AA64ISAR0_FHM_SHIFT)
+#define ID_AA64ISAR0_FHM_IMPL (UL(0x1) << ID_AA64ISAR0_FHM_SHIFT)
+#define ID_AA64ISAR0_TS_SHIFT 52
+#define ID_AA64ISAR0_TS_MASK (UL(0xf) << ID_AA64ISAR0_TS_SHIFT)
+#define ID_AA64ISAR0_TS_VAL(x) ((x) & ID_AA64ISAR0_TS_MASK)
+#define ID_AA64ISAR0_TS_NONE (UL(0x0) << ID_AA64ISAR0_TS_SHIFT)
+#define ID_AA64ISAR0_TS_CondM_8_4 (UL(0x1) << ID_AA64ISAR0_TS_SHIFT)
+#define ID_AA64ISAR0_TS_CondM_8_5 (UL(0x2) << ID_AA64ISAR0_TS_SHIFT)
+#define ID_AA64ISAR0_TLB_SHIFT 56
+#define ID_AA64ISAR0_TLB_MASK (UL(0xf) << ID_AA64ISAR0_TLB_SHIFT)
+#define ID_AA64ISAR0_TLB_VAL(x) ((x) & ID_AA64ISAR0_TLB_MASK)
+#define ID_AA64ISAR0_TLB_NONE (UL(0x0) << ID_AA64ISAR0_TLB_SHIFT)
+#define ID_AA64ISAR0_TLB_TLBIOS (UL(0x1) << ID_AA64ISAR0_TLB_SHIFT)
+#define ID_AA64ISAR0_TLB_TLBIOSR (UL(0x2) << ID_AA64ISAR0_TLB_SHIFT)
+#define ID_AA64ISAR0_RNDR_SHIFT 60
+#define ID_AA64ISAR0_RNDR_MASK (UL(0xf) << ID_AA64ISAR0_RNDR_SHIFT)
+#define ID_AA64ISAR0_RNDR_VAL(x) ((x) & ID_AA64ISAR0_RNDR_MASK)
+#define ID_AA64ISAR0_RNDR_NONE (UL(0x0) << ID_AA64ISAR0_RNDR_SHIFT)
+#define ID_AA64ISAR0_RNDR_IMPL (UL(0x1) << ID_AA64ISAR0_RNDR_SHIFT)
/* ID_AA64ISAR1_EL1 */ /* ID_AA64ISAR1_EL1 */
#define ID_AA64ISAR1_EL1 MRS_REG(3, 0, 0, 6, 1) #define ID_AA64ISAR1_EL1 MRS_REG(3, 0, 0, 6, 1)
@@ -357,7 +379,8 @@
#define ID_AA64ISAR1_DPB_MASK (UL(0xf) << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_DPB_MASK (UL(0xf) << ID_AA64ISAR1_DPB_SHIFT)
#define ID_AA64ISAR1_DPB_VAL(x) ((x) & ID_AA64ISAR1_DPB_MASK) #define ID_AA64ISAR1_DPB_VAL(x) ((x) & ID_AA64ISAR1_DPB_MASK)
#define ID_AA64ISAR1_DPB_NONE (UL(0x0) << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_DPB_NONE (UL(0x0) << ID_AA64ISAR1_DPB_SHIFT)
-#define ID_AA64ISAR1_DPB_IMPL (UL(0x1) << ID_AA64ISAR1_DPB_SHIFT)+#define ID_AA64ISAR1_DPB_DCCVAP (UL(0x1) << ID_AA64ISAR1_DPB_SHIFT)
+#define ID_AA64ISAR1_DPB_DCCVADP (UL(0x2) << ID_AA64ISAR1_DPB_SHIFT)
#define ID_AA64ISAR1_APA_SHIFT 4 #define ID_AA64ISAR1_APA_SHIFT 4
#define ID_AA64ISAR1_APA_MASK (UL(0xf) << ID_AA64ISAR1_APA_SHIFT) #define ID_AA64ISAR1_APA_MASK (UL(0xf) << ID_AA64ISAR1_APA_SHIFT)
#define ID_AA64ISAR1_APA_VAL(x) ((x) & ID_AA64ISAR1_APA_MASK) #define ID_AA64ISAR1_APA_VAL(x) ((x) & ID_AA64ISAR1_APA_MASK)
@@ -382,7 +405,8 @@
#define ID_AA64ISAR1_LRCPC_MASK (UL(0xf) << ID_AA64ISAR1_LRCPC_SHIFT) #define ID_AA64ISAR1_LRCPC_MASK (UL(0xf) << ID_AA64ISAR1_LRCPC_SHIFT)
#define ID_AA64ISAR1_LRCPC_VAL(x) ((x) & ID_AA64ISAR1_LRCPC_MASK) #define ID_AA64ISAR1_LRCPC_VAL(x) ((x) & ID_AA64ISAR1_LRCPC_MASK)
#define ID_AA64ISAR1_LRCPC_NONE (UL(0x0) << ID_AA64ISAR1_LRCPC_SHIFT) #define ID_AA64ISAR1_LRCPC_NONE (UL(0x0) << ID_AA64ISAR1_LRCPC_SHIFT)
-#define ID_AA64ISAR1_LRCPC_IMPL (UL(0x1) << ID_AA64ISAR1_LRCPC_SHIFT)+#define ID_AA64ISAR1_LRCPC_RCPC_8_3 (UL(0x1) << ID_AA64ISAR1_LRCPC_SHIFT)
+#define ID_AA64ISAR1_LRCPC_RCPC_8_4 (UL(0x2) << ID_AA64ISAR1_LRCPC_SHIFT)
#define ID_AA64ISAR1_GPA_SHIFT 24 #define ID_AA64ISAR1_GPA_SHIFT 24
#define ID_AA64ISAR1_GPA_MASK (UL(0xf) << ID_AA64ISAR1_GPA_SHIFT) #define ID_AA64ISAR1_GPA_MASK (UL(0xf) << ID_AA64ISAR1_GPA_SHIFT)
#define ID_AA64ISAR1_GPA_VAL(x) ((x) & ID_AA64ISAR1_GPA_MASK) #define ID_AA64ISAR1_GPA_VAL(x) ((x) & ID_AA64ISAR1_GPA_MASK)
@@ -393,6 +417,36 @@
#define ID_AA64ISAR1_GPI_VAL(x) ((x) & ID_AA64ISAR1_GPI_MASK) #define ID_AA64ISAR1_GPI_VAL(x) ((x) & ID_AA64ISAR1_GPI_MASK)
#define ID_AA64ISAR1_GPI_NONE (UL(0x0) << ID_AA64ISAR1_GPI_SHIFT) #define ID_AA64ISAR1_GPI_NONE (UL(0x0) << ID_AA64ISAR1_GPI_SHIFT)
#define ID_AA64ISAR1_GPI_IMPL (UL(0x1) << ID_AA64ISAR1_GPI_SHIFT) #define ID_AA64ISAR1_GPI_IMPL (UL(0x1) << ID_AA64ISAR1_GPI_SHIFT)
+#define ID_AA64ISAR1_FRINTTS_SHIFT 32
+#define ID_AA64ISAR1_FRINTTS_MASK (UL(0xf) << ID_AA64ISAR1_FRINTTS_SHIFT)
+#define ID_AA64ISAR1_FRINTTS_VAL(x) ((x) & ID_AA64ISAR1_FRINTTS_MASK)
+#define ID_AA64ISAR1_FRINTTS_NONE (UL(0x0) << ID_AA64ISAR1_FRINTTS_SHIFT)
+#define ID_AA64ISAR1_FRINTTS_IMPL (UL(0x1) << ID_AA64ISAR1_FRINTTS_SHIFT)
+#define ID_AA64ISAR1_SB_SHIFT 36
+#define ID_AA64ISAR1_SB_MASK (UL(0xf) << ID_AA64ISAR1_SB_SHIFT)
+#define ID_AA64ISAR1_SB_VAL(x) ((x) & ID_AA64ISAR1_SB_MASK)
+#define ID_AA64ISAR1_SB_NONE (UL(0x0) << ID_AA64ISAR1_SB_SHIFT)
+#define ID_AA64ISAR1_SB_IMPL (UL(0x1) << ID_AA64ISAR1_SB_SHIFT)
+#define ID_AA64ISAR1_SPECRES_SHIFT 40
+#define ID_AA64ISAR1_SPECRES_MASK (UL(0xf) << ID_AA64ISAR1_SPECRES_SHIFT)
+#define ID_AA64ISAR1_SPECRES_VAL(x) ((x) & ID_AA64ISAR1_SPECRES_MASK)
+#define ID_AA64ISAR1_SPECRES_NONE (UL(0x0) << ID_AA64ISAR1_SPECRES_SHIFT)
+#define ID_AA64ISAR1_SPECRES_IMPL (UL(0x1) << ID_AA64ISAR1_SPECRES_SHIFT)
+#define ID_AA64ISAR1_BF16_SHIFT 44
+#define ID_AA64ISAR1_BF16_MASK (UL(0xf) << ID_AA64ISAR1_BF16_SHIFT)
+#define ID_AA64ISAR1_BF16_VAL(x) ((x) & ID_AA64ISAR1_BF16_MASK)
+#define ID_AA64ISAR1_BF16_NONE (UL(0x0) << ID_AA64ISAR1_BF16_SHIFT)
+#define ID_AA64ISAR1_BF16_IMPL (UL(0x1) << ID_AA64ISAR1_BF16_SHIFT)
+#define ID_AA64ISAR1_DGH_SHIFT 48
+#define ID_AA64ISAR1_DGH_MASK (UL(0xf) << ID_AA64ISAR1_DGH_SHIFT)
+#define ID_AA64ISAR1_DGH_VAL(x) ((x) & ID_AA64ISAR1_DGH_MASK)
+#define ID_AA64ISAR1_DGH_NONE (UL(0x0) << ID_AA64ISAR1_DGH_SHIFT)
+#define ID_AA64ISAR1_DGH_IMPL (UL(0x1) << ID_AA64ISAR1_DGH_SHIFT)
+#define ID_AA64ISAR1_I8MM_SHIFT 52
+#define ID_AA64ISAR1_I8MM_MASK (UL(0xf) << ID_AA64ISAR1_I8MM_SHIFT)
+#define ID_AA64ISAR1_I8MM_VAL(x) ((x) & ID_AA64ISAR1_I8MM_MASK)
+#define ID_AA64ISAR1_I8MM_NONE (UL(0x0) << ID_AA64ISAR1_I8MM_SHIFT)
+#define ID_AA64ISAR1_I8MM_IMPL (UL(0x1) << ID_AA64ISAR1_I8MM_SHIFT)
/* ID_AA64MMFR0_EL1 */ /* ID_AA64MMFR0_EL1 */
#define ID_AA64MMFR0_EL1 MRS_REG(3, 0, 0, 7, 0) #define ID_AA64MMFR0_EL1 MRS_REG(3, 0, 0, 7, 0)
sys/contrib/pcg-c/include/pcg_variants.h
@@ -53,7 +53,7 @@ extern "C" {
* Rotate helper functions. * Rotate helper functions.
*/ */
-inline uint8_t pcg_rotr_8(uint8_t value, unsigned int rot)+static inline uint8_t pcg_rotr_8(uint8_t value, unsigned int rot)
{ {
/* Unfortunately, clang is kinda pathetic when it comes to properly /* Unfortunately, clang is kinda pathetic when it comes to properly
* recognizing idiomatic rotate code, so for clang we actually provide * recognizing idiomatic rotate code, so for clang we actually provide
@@ -67,7 +67,7 @@ inline uint8_t pcg_rotr_8(uint8_t value, unsigned int rot)
#endif #endif
} }
-inline uint16_t pcg_rotr_16(uint16_t value, unsigned int rot)+static inline uint16_t pcg_rotr_16(uint16_t value, unsigned int rot)
{ {
#if PCG_USE_INLINE_ASM && defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) #if PCG_USE_INLINE_ASM && defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
__asm__ ("rorw %%cl, %0" : "=r" (value) : "0" (value), "c" (rot)); __asm__ ("rorw %%cl, %0" : "=r" (value) : "0" (value), "c" (rot));
@@ -77,7 +77,7 @@ inline uint16_t pcg_rotr_16(uint16_t value, unsigned int rot)
#endif #endif
} }
-inline uint32_t pcg_rotr_32(uint32_t value, unsigned int rot)+static inline uint32_t pcg_rotr_32(uint32_t value, unsigned int rot)
{ {
#if PCG_USE_INLINE_ASM && defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) #if PCG_USE_INLINE_ASM && defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
__asm__ ("rorl %%cl, %0" : "=r" (value) : "0" (value), "c" (rot)); __asm__ ("rorl %%cl, %0" : "=r" (value) : "0" (value), "c" (rot));
@@ -87,7 +87,7 @@ inline uint32_t pcg_rotr_32(uint32_t value, unsigned int rot)
#endif #endif
} }
-inline uint64_t pcg_rotr_64(uint64_t value, unsigned int rot)+static inline uint64_t pcg_rotr_64(uint64_t value, unsigned int rot)
{ {
#if 0 && PCG_USE_INLINE_ASM && defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) #if 0 && PCG_USE_INLINE_ASM && defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
/* For whatever reason, clang actually *does* generate rotq by /* For whatever reason, clang actually *does* generate rotq by
@@ -100,7 +100,7 @@ inline uint64_t pcg_rotr_64(uint64_t value, unsigned int rot)
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t pcg_rotr_128(pcg128_t value, unsigned int rot)+static inline pcg128_t pcg_rotr_128(pcg128_t value, unsigned int rot)
{ {
return (value >> rot) | (value << ((- rot) & 127)); return (value >> rot) | (value << ((- rot) & 127));
} }
@@ -112,24 +112,24 @@ inline pcg128_t pcg_rotr_128(pcg128_t value, unsigned int rot)
/* XSH RS */ /* XSH RS */
-inline uint8_t pcg_output_xsh_rs_16_8(uint16_t state)+static inline uint8_t pcg_output_xsh_rs_16_8(uint16_t state)
{ {
return (uint8_t)(((state >> 7u) ^ state) >> ((state >> 14u) + 3u)); return (uint8_t)(((state >> 7u) ^ state) >> ((state >> 14u) + 3u));
} }
-inline uint16_t pcg_output_xsh_rs_32_16(uint32_t state)+static inline uint16_t pcg_output_xsh_rs_32_16(uint32_t state)
{ {
return (uint16_t)(((state >> 11u) ^ state) >> ((state >> 30u) + 11u)); return (uint16_t)(((state >> 11u) ^ state) >> ((state >> 30u) + 11u));
} }
-inline uint32_t pcg_output_xsh_rs_64_32(uint64_t state)+static inline uint32_t pcg_output_xsh_rs_64_32(uint64_t state)
{ {
return (uint32_t)(((state >> 22u) ^ state) >> ((state >> 61u) + 22u)); return (uint32_t)(((state >> 22u) ^ state) >> ((state >> 61u) + 22u));
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_output_xsh_rs_128_64(pcg128_t state)+static inline uint64_t pcg_output_xsh_rs_128_64(pcg128_t state)
{ {
return (uint64_t)(((state >> 43u) ^ state) >> ((state >> 124u) + 45u)); return (uint64_t)(((state >> 43u) ^ state) >> ((state >> 124u) + 45u));
} }
@@ -137,23 +137,23 @@ inline uint64_t pcg_output_xsh_rs_128_64(pcg128_t state)
/* XSH RR */ /* XSH RR */
-inline uint8_t pcg_output_xsh_rr_16_8(uint16_t state)+static inline uint8_t pcg_output_xsh_rr_16_8(uint16_t state)
{ {
return pcg_rotr_8(((state >> 5u) ^ state) >> 5u, state >> 13u); return pcg_rotr_8(((state >> 5u) ^ state) >> 5u, state >> 13u);
} }
-inline uint16_t pcg_output_xsh_rr_32_16(uint32_t state)+static inline uint16_t pcg_output_xsh_rr_32_16(uint32_t state)
{ {
return pcg_rotr_16(((state >> 10u) ^ state) >> 12u, state >> 28u); return pcg_rotr_16(((state >> 10u) ^ state) >> 12u, state >> 28u);
} }
-inline uint32_t pcg_output_xsh_rr_64_32(uint64_t state)+static inline uint32_t pcg_output_xsh_rr_64_32(uint64_t state)
{ {
return pcg_rotr_32(((state >> 18u) ^ state) >> 27u, state >> 59u); return pcg_rotr_32(((state >> 18u) ^ state) >> 27u, state >> 59u);
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_output_xsh_rr_128_64(pcg128_t state)+static inline uint64_t pcg_output_xsh_rr_128_64(pcg128_t state)
{ {
return pcg_rotr_64(((state >> 35u) ^ state) >> 58u, state >> 122u); return pcg_rotr_64(((state >> 35u) ^ state) >> 58u, state >> 122u);
} }
@@ -161,25 +161,25 @@ inline uint64_t pcg_output_xsh_rr_128_64(pcg128_t state)
/* RXS M XS */ /* RXS M XS */
-inline uint8_t pcg_output_rxs_m_xs_8_8(uint8_t state)+static inline uint8_t pcg_output_rxs_m_xs_8_8(uint8_t state)
{ {
uint8_t word = ((state >> ((state >> 6u) + 2u)) ^ state) * 217u; uint8_t word = ((state >> ((state >> 6u) + 2u)) ^ state) * 217u;
return (word >> 6u) ^ word; return (word >> 6u) ^ word;
} }
-inline uint16_t pcg_output_rxs_m_xs_16_16(uint16_t state)+static inline uint16_t pcg_output_rxs_m_xs_16_16(uint16_t state)
{ {
uint16_t word = ((state >> ((state >> 13u) + 3u)) ^ state) * 62169u; uint16_t word = ((state >> ((state >> 13u) + 3u)) ^ state) * 62169u;
return (word >> 11u) ^ word; return (word >> 11u) ^ word;
} }
-inline uint32_t pcg_output_rxs_m_xs_32_32(uint32_t state)+static inline uint32_t pcg_output_rxs_m_xs_32_32(uint32_t state)
{ {
uint32_t word = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u; uint32_t word = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u;
return (word >> 22u) ^ word; return (word >> 22u) ^ word;
} }
-inline uint64_t pcg_output_rxs_m_xs_64_64(uint64_t state)+static inline uint64_t pcg_output_rxs_m_xs_64_64(uint64_t state)
{ {
uint64_t word = ((state >> ((state >> 59u) + 5u)) ^ state) uint64_t word = ((state >> ((state >> 59u) + 5u)) ^ state)
* 12605985483714917081ull; * 12605985483714917081ull;
@@ -187,7 +187,7 @@ inline uint64_t pcg_output_rxs_m_xs_64_64(uint64_t state)
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t pcg_output_rxs_m_xs_128_128(pcg128_t state)+static inline pcg128_t pcg_output_rxs_m_xs_128_128(pcg128_t state)
{ {
pcg128_t word = ((state >> ((state >> 122u) + 6u)) ^ state) pcg128_t word = ((state >> ((state >> 122u) + 6u)) ^ state)
* (PCG_128BIT_CONSTANT(17766728186571221404ULL, * (PCG_128BIT_CONSTANT(17766728186571221404ULL,
@@ -199,24 +199,24 @@ inline pcg128_t pcg_output_rxs_m_xs_128_128(pcg128_t state)
/* RXS M */ /* RXS M */
-inline uint8_t pcg_output_rxs_m_16_8(uint16_t state)+static inline uint8_t pcg_output_rxs_m_16_8(uint16_t state)
{ {
return (((state >> ((state >> 13u) + 3u)) ^ state) * 62169u) >> 8u; return (((state >> ((state >> 13u) + 3u)) ^ state) * 62169u) >> 8u;
} }
-inline uint16_t pcg_output_rxs_m_32_16(uint32_t state)+static inline uint16_t pcg_output_rxs_m_32_16(uint32_t state)
{ {
return (((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u) >> 16u; return (((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u) >> 16u;
} }
-inline uint32_t pcg_output_rxs_m_64_32(uint64_t state)+static inline uint32_t pcg_output_rxs_m_64_32(uint64_t state)
{ {
return (((state >> ((state >> 59u) + 5u)) ^ state) return (((state >> ((state >> 59u) + 5u)) ^ state)
* 12605985483714917081ull) >> 32u; * 12605985483714917081ull) >> 32u;
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_output_rxs_m_128_64(pcg128_t state)+static inline uint64_t pcg_output_rxs_m_128_64(pcg128_t state)
{ {
return (((state >> ((state >> 122u) + 6u)) ^ state) return (((state >> ((state >> 122u) + 6u)) ^ state)
* (PCG_128BIT_CONSTANT(17766728186571221404ULL, * (PCG_128BIT_CONSTANT(17766728186571221404ULL,
@@ -227,14 +227,14 @@ inline uint64_t pcg_output_rxs_m_128_64(pcg128_t state)
/* XSL RR (only defined for >= 64 bits) */ /* XSL RR (only defined for >= 64 bits) */
-inline uint32_t pcg_output_xsl_rr_64_32(uint64_t state)+static inline uint32_t pcg_output_xsl_rr_64_32(uint64_t state)
{ {
return pcg_rotr_32(((uint32_t)(state >> 32u)) ^ (uint32_t)state, return pcg_rotr_32(((uint32_t)(state >> 32u)) ^ (uint32_t)state,
state >> 59u); state >> 59u);
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_output_xsl_rr_128_64(pcg128_t state)+static inline uint64_t pcg_output_xsl_rr_128_64(pcg128_t state)
{ {
return pcg_rotr_64(((uint64_t)(state >> 64u)) ^ (uint64_t)state, return pcg_rotr_64(((uint64_t)(state >> 64u)) ^ (uint64_t)state,
state >> 122u); state >> 122u);
@@ -243,7 +243,7 @@ inline uint64_t pcg_output_xsl_rr_128_64(pcg128_t state)
/* XSL RR RR (only defined for >= 64 bits) */ /* XSL RR RR (only defined for >= 64 bits) */
-inline uint64_t pcg_output_xsl_rr_rr_64_64(uint64_t state)+static inline uint64_t pcg_output_xsl_rr_rr_64_64(uint64_t state)
{ {
uint32_t rot1 = (uint32_t)(state >> 59u); uint32_t rot1 = (uint32_t)(state >> 59u);
uint32_t high = (uint32_t)(state >> 32u); uint32_t high = (uint32_t)(state >> 32u);
@@ -255,7 +255,7 @@ inline uint64_t pcg_output_xsl_rr_rr_64_64(uint64_t state)
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t pcg_output_xsl_rr_rr_128_128(pcg128_t state)+static inline pcg128_t pcg_output_xsl_rr_rr_128_128(pcg128_t state)
{ {
uint32_t rot1 = (uint32_t)(state >> 122u); uint32_t rot1 = (uint32_t)(state >> 122u);
uint64_t high = (uint64_t)(state >> 64u); uint64_t high = (uint64_t)(state >> 64u);
@@ -400,191 +400,191 @@ extern pcg128_t pcg_advance_lcg_128(pcg128_t state, pcg128_t delta,
* a good reason to call them directly. * a good reason to call them directly.
*/ */
-inline void pcg_oneseq_8_step_r(struct pcg_state_8* rng)+static inline void pcg_oneseq_8_step_r(struct pcg_state_8* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8
+ PCG_DEFAULT_INCREMENT_8; + PCG_DEFAULT_INCREMENT_8;
} }
-inline void pcg_oneseq_8_advance_r(struct pcg_state_8* rng, uint8_t delta)+static inline void pcg_oneseq_8_advance_r(struct pcg_state_8* rng, uint8_t delta)
{ {
rng->state = pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8, rng->state = pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8,
PCG_DEFAULT_INCREMENT_8); PCG_DEFAULT_INCREMENT_8);
} }
-inline void pcg_mcg_8_step_r(struct pcg_state_8* rng)+static inline void pcg_mcg_8_step_r(struct pcg_state_8* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8;
} }
-inline void pcg_mcg_8_advance_r(struct pcg_state_8* rng, uint8_t delta)+static inline void pcg_mcg_8_advance_r(struct pcg_state_8* rng, uint8_t delta)
{ {
rng->state rng->state
= pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8, 0u); = pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8, 0u);
} }
-inline void pcg_unique_8_step_r(struct pcg_state_8* rng)+static inline void pcg_unique_8_step_r(struct pcg_state_8* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8
+ (uint8_t)(((intptr_t)rng) | 1u); + (uint8_t)(((intptr_t)rng) | 1u);
} }
-inline void pcg_unique_8_advance_r(struct pcg_state_8* rng, uint8_t delta)+static inline void pcg_unique_8_advance_r(struct pcg_state_8* rng, uint8_t delta)
{ {
rng->state = pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8, rng->state = pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8,
(uint8_t)(((intptr_t)rng) | 1u)); (uint8_t)(((intptr_t)rng) | 1u));
} }
-inline void pcg_setseq_8_step_r(struct pcg_state_setseq_8* rng)+static inline void pcg_setseq_8_step_r(struct pcg_state_setseq_8* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8 + rng->inc; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_8 + rng->inc;
} }
-inline void pcg_setseq_8_advance_r(struct pcg_state_setseq_8* rng,+static inline void pcg_setseq_8_advance_r(struct pcg_state_setseq_8* rng,
uint8_t delta) uint8_t delta)
{ {
rng->state = pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8, rng->state = pcg_advance_lcg_8(rng->state, delta, PCG_DEFAULT_MULTIPLIER_8,
rng->inc); rng->inc);
} }
-inline void pcg_oneseq_16_step_r(struct pcg_state_16* rng)+static inline void pcg_oneseq_16_step_r(struct pcg_state_16* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_16 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_16
+ PCG_DEFAULT_INCREMENT_16; + PCG_DEFAULT_INCREMENT_16;
} }
-inline void pcg_oneseq_16_advance_r(struct pcg_state_16* rng, uint16_t delta)+static inline void pcg_oneseq_16_advance_r(struct pcg_state_16* rng, uint16_t delta)
{ {
rng->state = pcg_advance_lcg_16( rng->state = pcg_advance_lcg_16(
rng->state, delta, PCG_DEFAULT_MULTIPLIER_16, PCG_DEFAULT_INCREMENT_16); rng->state, delta, PCG_DEFAULT_MULTIPLIER_16, PCG_DEFAULT_INCREMENT_16);
} }
-inline void pcg_mcg_16_step_r(struct pcg_state_16* rng)+static inline void pcg_mcg_16_step_r(struct pcg_state_16* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_16; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_16;
} }
-inline void pcg_mcg_16_advance_r(struct pcg_state_16* rng, uint16_t delta)+static inline void pcg_mcg_16_advance_r(struct pcg_state_16* rng, uint16_t delta)
{ {
rng->state rng->state
= pcg_advance_lcg_16(rng->state, delta, PCG_DEFAULT_MULTIPLIER_16, 0u); = pcg_advance_lcg_16(rng->state, delta, PCG_DEFAULT_MULTIPLIER_16, 0u);
} }
-inline void pcg_unique_16_step_r(struct pcg_state_16* rng)+static inline void pcg_unique_16_step_r(struct pcg_state_16* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_16 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_16
+ (uint16_t)(((intptr_t)rng) | 1u); + (uint16_t)(((intptr_t)rng) | 1u);
} }
-inline void pcg_unique_16_advance_r(struct pcg_state_16* rng, uint16_t delta)+static inline void pcg_unique_16_advance_r(struct pcg_state_16* rng, uint16_t delta)
{ {
rng->state rng->state
= pcg_advance_lcg_16(rng->state, delta, PCG_DEFAULT_MULTIPLIER_16, = pcg_advance_lcg_16(rng->state, delta, PCG_DEFAULT_MULTIPLIER_16,
(uint16_t)(((intptr_t)rng) | 1u)); (uint16_t)(((intptr_t)rng) | 1u));
} }
-inline void pcg_setseq_16_step_r(struct pcg_state_setseq_16* rng)+static inline void pcg_setseq_16_step_r(struct pcg_state_setseq_16* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_16 + rng->inc; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_16 + rng->inc;
} }
-inline void pcg_setseq_16_advance_r(struct pcg_state_setseq_16* rng,+static inline void pcg_setseq_16_advance_r(struct pcg_state_setseq_16* rng,
uint16_t delta) uint16_t delta)
{ {
rng->state = pcg_advance_lcg_16(rng->state, delta, rng->state = pcg_advance_lcg_16(rng->state, delta,
PCG_DEFAULT_MULTIPLIER_16, rng->inc); PCG_DEFAULT_MULTIPLIER_16, rng->inc);
} }
-inline void pcg_oneseq_32_step_r(struct pcg_state_32* rng)+static inline void pcg_oneseq_32_step_r(struct pcg_state_32* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_32 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_32
+ PCG_DEFAULT_INCREMENT_32; + PCG_DEFAULT_INCREMENT_32;
} }
-inline void pcg_oneseq_32_advance_r(struct pcg_state_32* rng, uint32_t delta)+static inline void pcg_oneseq_32_advance_r(struct pcg_state_32* rng, uint32_t delta)
{ {
rng->state = pcg_advance_lcg_32( rng->state = pcg_advance_lcg_32(
rng->state, delta, PCG_DEFAULT_MULTIPLIER_32, PCG_DEFAULT_INCREMENT_32); rng->state, delta, PCG_DEFAULT_MULTIPLIER_32, PCG_DEFAULT_INCREMENT_32);
} }
-inline void pcg_mcg_32_step_r(struct pcg_state_32* rng)+static inline void pcg_mcg_32_step_r(struct pcg_state_32* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_32; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_32;
} }
-inline void pcg_mcg_32_advance_r(struct pcg_state_32* rng, uint32_t delta)+static inline void pcg_mcg_32_advance_r(struct pcg_state_32* rng, uint32_t delta)
{ {
rng->state rng->state
= pcg_advance_lcg_32(rng->state, delta, PCG_DEFAULT_MULTIPLIER_32, 0u); = pcg_advance_lcg_32(rng->state, delta, PCG_DEFAULT_MULTIPLIER_32, 0u);
} }
-inline void pcg_unique_32_step_r(struct pcg_state_32* rng)+static inline void pcg_unique_32_step_r(struct pcg_state_32* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_32 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_32
+ (uint32_t)(((intptr_t)rng) | 1u); + (uint32_t)(((intptr_t)rng) | 1u);
} }
-inline void pcg_unique_32_advance_r(struct pcg_state_32* rng, uint32_t delta)+static inline void pcg_unique_32_advance_r(struct pcg_state_32* rng, uint32_t delta)
{ {
rng->state rng->state
= pcg_advance_lcg_32(rng->state, delta, PCG_DEFAULT_MULTIPLIER_32, = pcg_advance_lcg_32(rng->state, delta, PCG_DEFAULT_MULTIPLIER_32,
(uint32_t)(((intptr_t)rng) | 1u)); (uint32_t)(((intptr_t)rng) | 1u));
} }
-inline void pcg_setseq_32_step_r(struct pcg_state_setseq_32* rng)+static inline void pcg_setseq_32_step_r(struct pcg_state_setseq_32* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_32 + rng->inc; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_32 + rng->inc;
} }
-inline void pcg_setseq_32_advance_r(struct pcg_state_setseq_32* rng,+static inline void pcg_setseq_32_advance_r(struct pcg_state_setseq_32* rng,
uint32_t delta) uint32_t delta)
{ {
rng->state = pcg_advance_lcg_32(rng->state, delta, rng->state = pcg_advance_lcg_32(rng->state, delta,
PCG_DEFAULT_MULTIPLIER_32, rng->inc); PCG_DEFAULT_MULTIPLIER_32, rng->inc);
} }
-inline void pcg_oneseq_64_step_r(struct pcg_state_64* rng)+static inline void pcg_oneseq_64_step_r(struct pcg_state_64* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_64 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_64
+ PCG_DEFAULT_INCREMENT_64; + PCG_DEFAULT_INCREMENT_64;
} }
-inline void pcg_oneseq_64_advance_r(struct pcg_state_64* rng, uint64_t delta)+static inline void pcg_oneseq_64_advance_r(struct pcg_state_64* rng, uint64_t delta)
{ {
rng->state = pcg_advance_lcg_64( rng->state = pcg_advance_lcg_64(
rng->state, delta, PCG_DEFAULT_MULTIPLIER_64, PCG_DEFAULT_INCREMENT_64); rng->state, delta, PCG_DEFAULT_MULTIPLIER_64, PCG_DEFAULT_INCREMENT_64);
} }
-inline void pcg_mcg_64_step_r(struct pcg_state_64* rng)+static inline void pcg_mcg_64_step_r(struct pcg_state_64* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_64; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_64;
} }
-inline void pcg_mcg_64_advance_r(struct pcg_state_64* rng, uint64_t delta)+static inline void pcg_mcg_64_advance_r(struct pcg_state_64* rng, uint64_t delta)
{ {
rng->state rng->state
= pcg_advance_lcg_64(rng->state, delta, PCG_DEFAULT_MULTIPLIER_64, 0u); = pcg_advance_lcg_64(rng->state, delta, PCG_DEFAULT_MULTIPLIER_64, 0u);
} }
-inline void pcg_unique_64_step_r(struct pcg_state_64* rng)+static inline void pcg_unique_64_step_r(struct pcg_state_64* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_64 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_64
+ (uint64_t)(((intptr_t)rng) | 1u); + (uint64_t)(((intptr_t)rng) | 1u);
} }
-inline void pcg_unique_64_advance_r(struct pcg_state_64* rng, uint64_t delta)+static inline void pcg_unique_64_advance_r(struct pcg_state_64* rng, uint64_t delta)
{ {
rng->state rng->state
= pcg_advance_lcg_64(rng->state, delta, PCG_DEFAULT_MULTIPLIER_64, = pcg_advance_lcg_64(rng->state, delta, PCG_DEFAULT_MULTIPLIER_64,
(uint64_t)(((intptr_t)rng) | 1u)); (uint64_t)(((intptr_t)rng) | 1u));
} }
-inline void pcg_setseq_64_step_r(struct pcg_state_setseq_64* rng)+static inline void pcg_setseq_64_step_r(struct pcg_state_setseq_64* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_64 + rng->inc; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_64 + rng->inc;
} }
-inline void pcg_setseq_64_advance_r(struct pcg_state_setseq_64* rng,+static inline void pcg_setseq_64_advance_r(struct pcg_state_setseq_64* rng,
uint64_t delta) uint64_t delta)
{ {
rng->state = pcg_advance_lcg_64(rng->state, delta, rng->state = pcg_advance_lcg_64(rng->state, delta,
@@ -592,7 +592,7 @@ inline void pcg_setseq_64_advance_r(struct pcg_state_setseq_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_oneseq_128_step_r(struct pcg_state_128* rng)+static inline void pcg_oneseq_128_step_r(struct pcg_state_128* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_128 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_128
+ PCG_DEFAULT_INCREMENT_128; + PCG_DEFAULT_INCREMENT_128;
@@ -600,7 +600,7 @@ inline void pcg_oneseq_128_step_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_oneseq_128_advance_r(struct pcg_state_128* rng, pcg128_t delta)+static inline void pcg_oneseq_128_advance_r(struct pcg_state_128* rng, pcg128_t delta)
{ {
rng->state rng->state
= pcg_advance_lcg_128(rng->state, delta, PCG_DEFAULT_MULTIPLIER_128, = pcg_advance_lcg_128(rng->state, delta, PCG_DEFAULT_MULTIPLIER_128,
@@ -609,14 +609,14 @@ inline void pcg_oneseq_128_advance_r(struct pcg_state_128* rng, pcg128_t delta)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_mcg_128_step_r(struct pcg_state_128* rng)+static inline void pcg_mcg_128_step_r(struct pcg_state_128* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_128; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_128;
} }
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_mcg_128_advance_r(struct pcg_state_128* rng, pcg128_t delta)+static inline void pcg_mcg_128_advance_r(struct pcg_state_128* rng, pcg128_t delta)
{ {
rng->state = pcg_advance_lcg_128(rng->state, delta, rng->state = pcg_advance_lcg_128(rng->state, delta,
PCG_DEFAULT_MULTIPLIER_128, 0u); PCG_DEFAULT_MULTIPLIER_128, 0u);
@@ -624,7 +624,7 @@ inline void pcg_mcg_128_advance_r(struct pcg_state_128* rng, pcg128_t delta)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_unique_128_step_r(struct pcg_state_128* rng)+static inline void pcg_unique_128_step_r(struct pcg_state_128* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_128 rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_128
+ (pcg128_t)(((intptr_t)rng) | 1u); + (pcg128_t)(((intptr_t)rng) | 1u);
@@ -632,7 +632,7 @@ inline void pcg_unique_128_step_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_unique_128_advance_r(struct pcg_state_128* rng, pcg128_t delta)+static inline void pcg_unique_128_advance_r(struct pcg_state_128* rng, pcg128_t delta)
{ {
rng->state rng->state
= pcg_advance_lcg_128(rng->state, delta, PCG_DEFAULT_MULTIPLIER_128, = pcg_advance_lcg_128(rng->state, delta, PCG_DEFAULT_MULTIPLIER_128,
@@ -641,14 +641,14 @@ inline void pcg_unique_128_advance_r(struct pcg_state_128* rng, pcg128_t delta)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_setseq_128_step_r(struct pcg_state_setseq_128* rng)+static inline void pcg_setseq_128_step_r(struct pcg_state_setseq_128* rng)
{ {
rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_128 + rng->inc; rng->state = rng->state * PCG_DEFAULT_MULTIPLIER_128 + rng->inc;
} }
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_setseq_128_advance_r(struct pcg_state_setseq_128* rng,+static inline void pcg_setseq_128_advance_r(struct pcg_state_setseq_128* rng,
pcg128_t delta) pcg128_t delta)
{ {
rng->state = pcg_advance_lcg_128(rng->state, delta, rng->state = pcg_advance_lcg_128(rng->state, delta,
@@ -661,7 +661,7 @@ inline void pcg_setseq_128_advance_r(struct pcg_state_setseq_128* rng,
* these functions. * these functions.
*/ */
-inline void pcg_oneseq_8_srandom_r(struct pcg_state_8* rng, uint8_t initstate)+static inline void pcg_oneseq_8_srandom_r(struct pcg_state_8* rng, uint8_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
pcg_oneseq_8_step_r(rng); pcg_oneseq_8_step_r(rng);
@@ -669,12 +669,12 @@ inline void pcg_oneseq_8_srandom_r(struct pcg_state_8* rng, uint8_t initstate)
pcg_oneseq_8_step_r(rng); pcg_oneseq_8_step_r(rng);
} }
-inline void pcg_mcg_8_srandom_r(struct pcg_state_8* rng, uint8_t initstate)+static inline void pcg_mcg_8_srandom_r(struct pcg_state_8* rng, uint8_t initstate)
{ {
rng->state = initstate | 1u; rng->state = initstate | 1u;
} }
-inline void pcg_unique_8_srandom_r(struct pcg_state_8* rng, uint8_t initstate)+static inline void pcg_unique_8_srandom_r(struct pcg_state_8* rng, uint8_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
pcg_unique_8_step_r(rng); pcg_unique_8_step_r(rng);
@@ -682,7 +682,7 @@ inline void pcg_unique_8_srandom_r(struct pcg_state_8* rng, uint8_t initstate)
pcg_unique_8_step_r(rng); pcg_unique_8_step_r(rng);
} }
-inline void pcg_setseq_8_srandom_r(struct pcg_state_setseq_8* rng,+static inline void pcg_setseq_8_srandom_r(struct pcg_state_setseq_8* rng,
uint8_t initstate, uint8_t initseq) uint8_t initstate, uint8_t initseq)
{ {
rng->state = 0U; rng->state = 0U;
@@ -692,7 +692,7 @@ inline void pcg_setseq_8_srandom_r(struct pcg_state_setseq_8* rng,
pcg_setseq_8_step_r(rng); pcg_setseq_8_step_r(rng);
} }
-inline void pcg_oneseq_16_srandom_r(struct pcg_state_16* rng,+static inline void pcg_oneseq_16_srandom_r(struct pcg_state_16* rng,
uint16_t initstate) uint16_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
@@ -701,12 +701,12 @@ inline void pcg_oneseq_16_srandom_r(struct pcg_state_16* rng,
pcg_oneseq_16_step_r(rng); pcg_oneseq_16_step_r(rng);
} }
-inline void pcg_mcg_16_srandom_r(struct pcg_state_16* rng, uint16_t initstate)+static inline void pcg_mcg_16_srandom_r(struct pcg_state_16* rng, uint16_t initstate)
{ {
rng->state = initstate | 1u; rng->state = initstate | 1u;
} }
-inline void pcg_unique_16_srandom_r(struct pcg_state_16* rng,+static inline void pcg_unique_16_srandom_r(struct pcg_state_16* rng,
uint16_t initstate) uint16_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
@@ -715,7 +715,7 @@ inline void pcg_unique_16_srandom_r(struct pcg_state_16* rng,
pcg_unique_16_step_r(rng); pcg_unique_16_step_r(rng);
} }
-inline void pcg_setseq_16_srandom_r(struct pcg_state_setseq_16* rng,+static inline void pcg_setseq_16_srandom_r(struct pcg_state_setseq_16* rng,
uint16_t initstate, uint16_t initseq) uint16_t initstate, uint16_t initseq)
{ {
rng->state = 0U; rng->state = 0U;
@@ -725,7 +725,7 @@ inline void pcg_setseq_16_srandom_r(struct pcg_state_setseq_16* rng,
pcg_setseq_16_step_r(rng); pcg_setseq_16_step_r(rng);
} }
-inline void pcg_oneseq_32_srandom_r(struct pcg_state_32* rng,+static inline void pcg_oneseq_32_srandom_r(struct pcg_state_32* rng,
uint32_t initstate) uint32_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
@@ -734,12 +734,12 @@ inline void pcg_oneseq_32_srandom_r(struct pcg_state_32* rng,
pcg_oneseq_32_step_r(rng); pcg_oneseq_32_step_r(rng);
} }
-inline void pcg_mcg_32_srandom_r(struct pcg_state_32* rng, uint32_t initstate)+static inline void pcg_mcg_32_srandom_r(struct pcg_state_32* rng, uint32_t initstate)
{ {
rng->state = initstate | 1u; rng->state = initstate | 1u;
} }
-inline void pcg_unique_32_srandom_r(struct pcg_state_32* rng,+static inline void pcg_unique_32_srandom_r(struct pcg_state_32* rng,
uint32_t initstate) uint32_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
@@ -748,7 +748,7 @@ inline void pcg_unique_32_srandom_r(struct pcg_state_32* rng,
pcg_unique_32_step_r(rng); pcg_unique_32_step_r(rng);
} }
-inline void pcg_setseq_32_srandom_r(struct pcg_state_setseq_32* rng,+static inline void pcg_setseq_32_srandom_r(struct pcg_state_setseq_32* rng,
uint32_t initstate, uint32_t initseq) uint32_t initstate, uint32_t initseq)
{ {
rng->state = 0U; rng->state = 0U;
@@ -758,7 +758,7 @@ inline void pcg_setseq_32_srandom_r(struct pcg_state_setseq_32* rng,
pcg_setseq_32_step_r(rng); pcg_setseq_32_step_r(rng);
} }
-inline void pcg_oneseq_64_srandom_r(struct pcg_state_64* rng,+static inline void pcg_oneseq_64_srandom_r(struct pcg_state_64* rng,
uint64_t initstate) uint64_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
@@ -767,12 +767,12 @@ inline void pcg_oneseq_64_srandom_r(struct pcg_state_64* rng,
pcg_oneseq_64_step_r(rng); pcg_oneseq_64_step_r(rng);
} }
-inline void pcg_mcg_64_srandom_r(struct pcg_state_64* rng, uint64_t initstate)+static inline void pcg_mcg_64_srandom_r(struct pcg_state_64* rng, uint64_t initstate)
{ {
rng->state = initstate | 1u; rng->state = initstate | 1u;
} }
-inline void pcg_unique_64_srandom_r(struct pcg_state_64* rng,+static inline void pcg_unique_64_srandom_r(struct pcg_state_64* rng,
uint64_t initstate) uint64_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
@@ -781,7 +781,7 @@ inline void pcg_unique_64_srandom_r(struct pcg_state_64* rng,
pcg_unique_64_step_r(rng); pcg_unique_64_step_r(rng);
} }
-inline void pcg_setseq_64_srandom_r(struct pcg_state_setseq_64* rng,+static inline void pcg_setseq_64_srandom_r(struct pcg_state_setseq_64* rng,
uint64_t initstate, uint64_t initseq) uint64_t initstate, uint64_t initseq)
{ {
rng->state = 0U; rng->state = 0U;
@@ -792,7 +792,7 @@ inline void pcg_setseq_64_srandom_r(struct pcg_state_setseq_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_oneseq_128_srandom_r(struct pcg_state_128* rng,+static inline void pcg_oneseq_128_srandom_r(struct pcg_state_128* rng,
pcg128_t initstate) pcg128_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
@@ -803,14 +803,14 @@ inline void pcg_oneseq_128_srandom_r(struct pcg_state_128* rng,
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_mcg_128_srandom_r(struct pcg_state_128* rng, pcg128_t initstate)+static inline void pcg_mcg_128_srandom_r(struct pcg_state_128* rng, pcg128_t initstate)
{ {
rng->state = initstate | 1u; rng->state = initstate | 1u;
} }
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_unique_128_srandom_r(struct pcg_state_128* rng,+static inline void pcg_unique_128_srandom_r(struct pcg_state_128* rng,
pcg128_t initstate) pcg128_t initstate)
{ {
rng->state = 0U; rng->state = 0U;
@@ -821,7 +821,7 @@ inline void pcg_unique_128_srandom_r(struct pcg_state_128* rng,
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline void pcg_setseq_128_srandom_r(struct pcg_state_setseq_128* rng,+static inline void pcg_setseq_128_srandom_r(struct pcg_state_setseq_128* rng,
pcg128_t initstate, pcg128_t initseq) pcg128_t initstate, pcg128_t initseq)
{ {
rng->state = 0U; rng->state = 0U;
@@ -863,14 +863,14 @@ inline void pcg_setseq_128_srandom_r(struct pcg_state_setseq_128* rng,
/* Generation functions for XSH RS */ /* Generation functions for XSH RS */
-inline uint8_t pcg_oneseq_16_xsh_rs_8_random_r(struct pcg_state_16* rng)+static inline uint8_t pcg_oneseq_16_xsh_rs_8_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_oneseq_16_step_r(rng); pcg_oneseq_16_step_r(rng);
return pcg_output_xsh_rs_16_8(oldstate); return pcg_output_xsh_rs_16_8(oldstate);
} }
-inline uint8_t pcg_oneseq_16_xsh_rs_8_boundedrand_r(struct pcg_state_16* rng,+static inline uint8_t pcg_oneseq_16_xsh_rs_8_boundedrand_r(struct pcg_state_16* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -881,14 +881,14 @@ inline uint8_t pcg_oneseq_16_xsh_rs_8_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint16_t pcg_oneseq_32_xsh_rs_16_random_r(struct pcg_state_32* rng)+static inline uint16_t pcg_oneseq_32_xsh_rs_16_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_oneseq_32_step_r(rng); pcg_oneseq_32_step_r(rng);
return pcg_output_xsh_rs_32_16(oldstate); return pcg_output_xsh_rs_32_16(oldstate);
} }
-inline uint16_t pcg_oneseq_32_xsh_rs_16_boundedrand_r(struct pcg_state_32* rng,+static inline uint16_t pcg_oneseq_32_xsh_rs_16_boundedrand_r(struct pcg_state_32* rng,
uint16_t bound) uint16_t bound)
{ {
uint16_t threshold = ((uint16_t)(-bound)) % bound; uint16_t threshold = ((uint16_t)(-bound)) % bound;
@@ -899,14 +899,14 @@ inline uint16_t pcg_oneseq_32_xsh_rs_16_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint32_t pcg_oneseq_64_xsh_rs_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_oneseq_64_xsh_rs_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_oneseq_64_step_r(rng); pcg_oneseq_64_step_r(rng);
return pcg_output_xsh_rs_64_32(oldstate); return pcg_output_xsh_rs_64_32(oldstate);
} }
-inline uint32_t pcg_oneseq_64_xsh_rs_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_oneseq_64_xsh_rs_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -918,7 +918,7 @@ inline uint32_t pcg_oneseq_64_xsh_rs_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_oneseq_128_xsh_rs_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_oneseq_128_xsh_rs_64_random_r(struct pcg_state_128* rng)
{ {
pcg_oneseq_128_step_r(rng); pcg_oneseq_128_step_r(rng);
return pcg_output_xsh_rs_128_64(rng->state); return pcg_output_xsh_rs_128_64(rng->state);
@@ -926,7 +926,7 @@ inline uint64_t pcg_oneseq_128_xsh_rs_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_oneseq_128_xsh_rs_64_boundedrand_r(struct pcg_state_128* rng, pcg_oneseq_128_xsh_rs_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -939,14 +939,14 @@ pcg_oneseq_128_xsh_rs_64_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint8_t pcg_unique_16_xsh_rs_8_random_r(struct pcg_state_16* rng)+static inline uint8_t pcg_unique_16_xsh_rs_8_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_unique_16_step_r(rng); pcg_unique_16_step_r(rng);
return pcg_output_xsh_rs_16_8(oldstate); return pcg_output_xsh_rs_16_8(oldstate);
} }
-inline uint8_t pcg_unique_16_xsh_rs_8_boundedrand_r(struct pcg_state_16* rng,+static inline uint8_t pcg_unique_16_xsh_rs_8_boundedrand_r(struct pcg_state_16* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -957,14 +957,14 @@ inline uint8_t pcg_unique_16_xsh_rs_8_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint16_t pcg_unique_32_xsh_rs_16_random_r(struct pcg_state_32* rng)+static inline uint16_t pcg_unique_32_xsh_rs_16_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_unique_32_step_r(rng); pcg_unique_32_step_r(rng);
return pcg_output_xsh_rs_32_16(oldstate); return pcg_output_xsh_rs_32_16(oldstate);
} }
-inline uint16_t pcg_unique_32_xsh_rs_16_boundedrand_r(struct pcg_state_32* rng,+static inline uint16_t pcg_unique_32_xsh_rs_16_boundedrand_r(struct pcg_state_32* rng,
uint16_t bound) uint16_t bound)
{ {
uint16_t threshold = ((uint16_t)(-bound)) % bound; uint16_t threshold = ((uint16_t)(-bound)) % bound;
@@ -975,14 +975,14 @@ inline uint16_t pcg_unique_32_xsh_rs_16_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint32_t pcg_unique_64_xsh_rs_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_unique_64_xsh_rs_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_unique_64_step_r(rng); pcg_unique_64_step_r(rng);
return pcg_output_xsh_rs_64_32(oldstate); return pcg_output_xsh_rs_64_32(oldstate);
} }
-inline uint32_t pcg_unique_64_xsh_rs_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_unique_64_xsh_rs_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -994,7 +994,7 @@ inline uint32_t pcg_unique_64_xsh_rs_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_unique_128_xsh_rs_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_unique_128_xsh_rs_64_random_r(struct pcg_state_128* rng)
{ {
pcg_unique_128_step_r(rng); pcg_unique_128_step_r(rng);
return pcg_output_xsh_rs_128_64(rng->state); return pcg_output_xsh_rs_128_64(rng->state);
@@ -1002,7 +1002,7 @@ inline uint64_t pcg_unique_128_xsh_rs_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_unique_128_xsh_rs_64_boundedrand_r(struct pcg_state_128* rng, pcg_unique_128_xsh_rs_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -1015,14 +1015,14 @@ pcg_unique_128_xsh_rs_64_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint8_t pcg_setseq_16_xsh_rs_8_random_r(struct pcg_state_setseq_16* rng)+static inline uint8_t pcg_setseq_16_xsh_rs_8_random_r(struct pcg_state_setseq_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_setseq_16_step_r(rng); pcg_setseq_16_step_r(rng);
return pcg_output_xsh_rs_16_8(oldstate); return pcg_output_xsh_rs_16_8(oldstate);
} }
-inline uint8_t+static inline uint8_t
pcg_setseq_16_xsh_rs_8_boundedrand_r(struct pcg_state_setseq_16* rng, pcg_setseq_16_xsh_rs_8_boundedrand_r(struct pcg_state_setseq_16* rng,
uint8_t bound) uint8_t bound)
{ {
@@ -1034,7 +1034,7 @@ pcg_setseq_16_xsh_rs_8_boundedrand_r(struct pcg_state_setseq_16* rng,
} }
} }
-inline uint16_t+static inline uint16_t
pcg_setseq_32_xsh_rs_16_random_r(struct pcg_state_setseq_32* rng) pcg_setseq_32_xsh_rs_16_random_r(struct pcg_state_setseq_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
@@ -1042,7 +1042,7 @@ pcg_setseq_32_xsh_rs_16_random_r(struct pcg_state_setseq_32* rng)
return pcg_output_xsh_rs_32_16(oldstate); return pcg_output_xsh_rs_32_16(oldstate);
} }
-inline uint16_t+static inline uint16_t
pcg_setseq_32_xsh_rs_16_boundedrand_r(struct pcg_state_setseq_32* rng, pcg_setseq_32_xsh_rs_16_boundedrand_r(struct pcg_state_setseq_32* rng,
uint16_t bound) uint16_t bound)
{ {
@@ -1054,7 +1054,7 @@ pcg_setseq_32_xsh_rs_16_boundedrand_r(struct pcg_state_setseq_32* rng,
} }
} }
-inline uint32_t+static inline uint32_t
pcg_setseq_64_xsh_rs_32_random_r(struct pcg_state_setseq_64* rng) pcg_setseq_64_xsh_rs_32_random_r(struct pcg_state_setseq_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
@@ -1062,7 +1062,7 @@ pcg_setseq_64_xsh_rs_32_random_r(struct pcg_state_setseq_64* rng)
return pcg_output_xsh_rs_64_32(oldstate); return pcg_output_xsh_rs_64_32(oldstate);
} }
-inline uint32_t+static inline uint32_t
pcg_setseq_64_xsh_rs_32_boundedrand_r(struct pcg_state_setseq_64* rng, pcg_setseq_64_xsh_rs_32_boundedrand_r(struct pcg_state_setseq_64* rng,
uint32_t bound) uint32_t bound)
{ {
@@ -1075,7 +1075,7 @@ pcg_setseq_64_xsh_rs_32_boundedrand_r(struct pcg_state_setseq_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_setseq_128_xsh_rs_64_random_r(struct pcg_state_setseq_128* rng) pcg_setseq_128_xsh_rs_64_random_r(struct pcg_state_setseq_128* rng)
{ {
pcg_setseq_128_step_r(rng); pcg_setseq_128_step_r(rng);
@@ -1084,7 +1084,7 @@ pcg_setseq_128_xsh_rs_64_random_r(struct pcg_state_setseq_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_setseq_128_xsh_rs_64_boundedrand_r(struct pcg_state_setseq_128* rng, pcg_setseq_128_xsh_rs_64_boundedrand_r(struct pcg_state_setseq_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -1097,14 +1097,14 @@ pcg_setseq_128_xsh_rs_64_boundedrand_r(struct pcg_state_setseq_128* rng,
} }
#endif #endif
-inline uint8_t pcg_mcg_16_xsh_rs_8_random_r(struct pcg_state_16* rng)+static inline uint8_t pcg_mcg_16_xsh_rs_8_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_mcg_16_step_r(rng); pcg_mcg_16_step_r(rng);
return pcg_output_xsh_rs_16_8(oldstate); return pcg_output_xsh_rs_16_8(oldstate);
} }
-inline uint8_t pcg_mcg_16_xsh_rs_8_boundedrand_r(struct pcg_state_16* rng,+static inline uint8_t pcg_mcg_16_xsh_rs_8_boundedrand_r(struct pcg_state_16* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -1115,14 +1115,14 @@ inline uint8_t pcg_mcg_16_xsh_rs_8_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint16_t pcg_mcg_32_xsh_rs_16_random_r(struct pcg_state_32* rng)+static inline uint16_t pcg_mcg_32_xsh_rs_16_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_mcg_32_step_r(rng); pcg_mcg_32_step_r(rng);
return pcg_output_xsh_rs_32_16(oldstate); return pcg_output_xsh_rs_32_16(oldstate);
} }
-inline uint16_t pcg_mcg_32_xsh_rs_16_boundedrand_r(struct pcg_state_32* rng,+static inline uint16_t pcg_mcg_32_xsh_rs_16_boundedrand_r(struct pcg_state_32* rng,
uint16_t bound) uint16_t bound)
{ {
uint16_t threshold = ((uint16_t)(-bound)) % bound; uint16_t threshold = ((uint16_t)(-bound)) % bound;
@@ -1133,14 +1133,14 @@ inline uint16_t pcg_mcg_32_xsh_rs_16_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint32_t pcg_mcg_64_xsh_rs_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_mcg_64_xsh_rs_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_mcg_64_step_r(rng); pcg_mcg_64_step_r(rng);
return pcg_output_xsh_rs_64_32(oldstate); return pcg_output_xsh_rs_64_32(oldstate);
} }
-inline uint32_t pcg_mcg_64_xsh_rs_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_mcg_64_xsh_rs_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -1152,7 +1152,7 @@ inline uint32_t pcg_mcg_64_xsh_rs_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_mcg_128_xsh_rs_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_mcg_128_xsh_rs_64_random_r(struct pcg_state_128* rng)
{ {
pcg_mcg_128_step_r(rng); pcg_mcg_128_step_r(rng);
return pcg_output_xsh_rs_128_64(rng->state); return pcg_output_xsh_rs_128_64(rng->state);
@@ -1160,7 +1160,7 @@ inline uint64_t pcg_mcg_128_xsh_rs_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_mcg_128_xsh_rs_64_boundedrand_r(struct pcg_state_128* rng,+static inline uint64_t pcg_mcg_128_xsh_rs_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
uint64_t threshold = -bound % bound; uint64_t threshold = -bound % bound;
@@ -1174,14 +1174,14 @@ inline uint64_t pcg_mcg_128_xsh_rs_64_boundedrand_r(struct pcg_state_128* rng,
/* Generation functions for XSH RR */ /* Generation functions for XSH RR */
-inline uint8_t pcg_oneseq_16_xsh_rr_8_random_r(struct pcg_state_16* rng)+static inline uint8_t pcg_oneseq_16_xsh_rr_8_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_oneseq_16_step_r(rng); pcg_oneseq_16_step_r(rng);
return pcg_output_xsh_rr_16_8(oldstate); return pcg_output_xsh_rr_16_8(oldstate);
} }
-inline uint8_t pcg_oneseq_16_xsh_rr_8_boundedrand_r(struct pcg_state_16* rng,+static inline uint8_t pcg_oneseq_16_xsh_rr_8_boundedrand_r(struct pcg_state_16* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -1192,14 +1192,14 @@ inline uint8_t pcg_oneseq_16_xsh_rr_8_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint16_t pcg_oneseq_32_xsh_rr_16_random_r(struct pcg_state_32* rng)+static inline uint16_t pcg_oneseq_32_xsh_rr_16_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_oneseq_32_step_r(rng); pcg_oneseq_32_step_r(rng);
return pcg_output_xsh_rr_32_16(oldstate); return pcg_output_xsh_rr_32_16(oldstate);
} }
-inline uint16_t pcg_oneseq_32_xsh_rr_16_boundedrand_r(struct pcg_state_32* rng,+static inline uint16_t pcg_oneseq_32_xsh_rr_16_boundedrand_r(struct pcg_state_32* rng,
uint16_t bound) uint16_t bound)
{ {
uint16_t threshold = ((uint16_t)(-bound)) % bound; uint16_t threshold = ((uint16_t)(-bound)) % bound;
@@ -1210,14 +1210,14 @@ inline uint16_t pcg_oneseq_32_xsh_rr_16_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint32_t pcg_oneseq_64_xsh_rr_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_oneseq_64_xsh_rr_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_oneseq_64_step_r(rng); pcg_oneseq_64_step_r(rng);
return pcg_output_xsh_rr_64_32(oldstate); return pcg_output_xsh_rr_64_32(oldstate);
} }
-inline uint32_t pcg_oneseq_64_xsh_rr_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_oneseq_64_xsh_rr_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -1229,7 +1229,7 @@ inline uint32_t pcg_oneseq_64_xsh_rr_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_oneseq_128_xsh_rr_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_oneseq_128_xsh_rr_64_random_r(struct pcg_state_128* rng)
{ {
pcg_oneseq_128_step_r(rng); pcg_oneseq_128_step_r(rng);
return pcg_output_xsh_rr_128_64(rng->state); return pcg_output_xsh_rr_128_64(rng->state);
@@ -1237,7 +1237,7 @@ inline uint64_t pcg_oneseq_128_xsh_rr_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_oneseq_128_xsh_rr_64_boundedrand_r(struct pcg_state_128* rng, pcg_oneseq_128_xsh_rr_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -1250,14 +1250,14 @@ pcg_oneseq_128_xsh_rr_64_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint8_t pcg_unique_16_xsh_rr_8_random_r(struct pcg_state_16* rng)+static inline uint8_t pcg_unique_16_xsh_rr_8_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_unique_16_step_r(rng); pcg_unique_16_step_r(rng);
return pcg_output_xsh_rr_16_8(oldstate); return pcg_output_xsh_rr_16_8(oldstate);
} }
-inline uint8_t pcg_unique_16_xsh_rr_8_boundedrand_r(struct pcg_state_16* rng,+static inline uint8_t pcg_unique_16_xsh_rr_8_boundedrand_r(struct pcg_state_16* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -1268,14 +1268,14 @@ inline uint8_t pcg_unique_16_xsh_rr_8_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint16_t pcg_unique_32_xsh_rr_16_random_r(struct pcg_state_32* rng)+static inline uint16_t pcg_unique_32_xsh_rr_16_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_unique_32_step_r(rng); pcg_unique_32_step_r(rng);
return pcg_output_xsh_rr_32_16(oldstate); return pcg_output_xsh_rr_32_16(oldstate);
} }
-inline uint16_t pcg_unique_32_xsh_rr_16_boundedrand_r(struct pcg_state_32* rng,+static inline uint16_t pcg_unique_32_xsh_rr_16_boundedrand_r(struct pcg_state_32* rng,
uint16_t bound) uint16_t bound)
{ {
uint16_t threshold = ((uint16_t)(-bound)) % bound; uint16_t threshold = ((uint16_t)(-bound)) % bound;
@@ -1286,14 +1286,14 @@ inline uint16_t pcg_unique_32_xsh_rr_16_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint32_t pcg_unique_64_xsh_rr_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_unique_64_xsh_rr_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_unique_64_step_r(rng); pcg_unique_64_step_r(rng);
return pcg_output_xsh_rr_64_32(oldstate); return pcg_output_xsh_rr_64_32(oldstate);
} }
-inline uint32_t pcg_unique_64_xsh_rr_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_unique_64_xsh_rr_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -1305,7 +1305,7 @@ inline uint32_t pcg_unique_64_xsh_rr_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_unique_128_xsh_rr_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_unique_128_xsh_rr_64_random_r(struct pcg_state_128* rng)
{ {
pcg_unique_128_step_r(rng); pcg_unique_128_step_r(rng);
return pcg_output_xsh_rr_128_64(rng->state); return pcg_output_xsh_rr_128_64(rng->state);
@@ -1313,7 +1313,7 @@ inline uint64_t pcg_unique_128_xsh_rr_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_unique_128_xsh_rr_64_boundedrand_r(struct pcg_state_128* rng, pcg_unique_128_xsh_rr_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -1326,14 +1326,14 @@ pcg_unique_128_xsh_rr_64_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint8_t pcg_setseq_16_xsh_rr_8_random_r(struct pcg_state_setseq_16* rng)+static inline uint8_t pcg_setseq_16_xsh_rr_8_random_r(struct pcg_state_setseq_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_setseq_16_step_r(rng); pcg_setseq_16_step_r(rng);
return pcg_output_xsh_rr_16_8(oldstate); return pcg_output_xsh_rr_16_8(oldstate);
} }
-inline uint8_t+static inline uint8_t
pcg_setseq_16_xsh_rr_8_boundedrand_r(struct pcg_state_setseq_16* rng, pcg_setseq_16_xsh_rr_8_boundedrand_r(struct pcg_state_setseq_16* rng,
uint8_t bound) uint8_t bound)
{ {
@@ -1345,7 +1345,7 @@ pcg_setseq_16_xsh_rr_8_boundedrand_r(struct pcg_state_setseq_16* rng,
} }
} }
-inline uint16_t+static inline uint16_t
pcg_setseq_32_xsh_rr_16_random_r(struct pcg_state_setseq_32* rng) pcg_setseq_32_xsh_rr_16_random_r(struct pcg_state_setseq_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
@@ -1353,7 +1353,7 @@ pcg_setseq_32_xsh_rr_16_random_r(struct pcg_state_setseq_32* rng)
return pcg_output_xsh_rr_32_16(oldstate); return pcg_output_xsh_rr_32_16(oldstate);
} }
-inline uint16_t+static inline uint16_t
pcg_setseq_32_xsh_rr_16_boundedrand_r(struct pcg_state_setseq_32* rng, pcg_setseq_32_xsh_rr_16_boundedrand_r(struct pcg_state_setseq_32* rng,
uint16_t bound) uint16_t bound)
{ {
@@ -1365,7 +1365,7 @@ pcg_setseq_32_xsh_rr_16_boundedrand_r(struct pcg_state_setseq_32* rng,
} }
} }
-inline uint32_t+static inline uint32_t
pcg_setseq_64_xsh_rr_32_random_r(struct pcg_state_setseq_64* rng) pcg_setseq_64_xsh_rr_32_random_r(struct pcg_state_setseq_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
@@ -1373,7 +1373,7 @@ pcg_setseq_64_xsh_rr_32_random_r(struct pcg_state_setseq_64* rng)
return pcg_output_xsh_rr_64_32(oldstate); return pcg_output_xsh_rr_64_32(oldstate);
} }
-inline uint32_t+static inline uint32_t
pcg_setseq_64_xsh_rr_32_boundedrand_r(struct pcg_state_setseq_64* rng, pcg_setseq_64_xsh_rr_32_boundedrand_r(struct pcg_state_setseq_64* rng,
uint32_t bound) uint32_t bound)
{ {
@@ -1386,7 +1386,7 @@ pcg_setseq_64_xsh_rr_32_boundedrand_r(struct pcg_state_setseq_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_setseq_128_xsh_rr_64_random_r(struct pcg_state_setseq_128* rng) pcg_setseq_128_xsh_rr_64_random_r(struct pcg_state_setseq_128* rng)
{ {
pcg_setseq_128_step_r(rng); pcg_setseq_128_step_r(rng);
@@ -1395,7 +1395,7 @@ pcg_setseq_128_xsh_rr_64_random_r(struct pcg_state_setseq_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_setseq_128_xsh_rr_64_boundedrand_r(struct pcg_state_setseq_128* rng, pcg_setseq_128_xsh_rr_64_boundedrand_r(struct pcg_state_setseq_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -1408,14 +1408,14 @@ pcg_setseq_128_xsh_rr_64_boundedrand_r(struct pcg_state_setseq_128* rng,
} }
#endif #endif
-inline uint8_t pcg_mcg_16_xsh_rr_8_random_r(struct pcg_state_16* rng)+static inline uint8_t pcg_mcg_16_xsh_rr_8_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_mcg_16_step_r(rng); pcg_mcg_16_step_r(rng);
return pcg_output_xsh_rr_16_8(oldstate); return pcg_output_xsh_rr_16_8(oldstate);
} }
-inline uint8_t pcg_mcg_16_xsh_rr_8_boundedrand_r(struct pcg_state_16* rng,+static inline uint8_t pcg_mcg_16_xsh_rr_8_boundedrand_r(struct pcg_state_16* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -1426,14 +1426,14 @@ inline uint8_t pcg_mcg_16_xsh_rr_8_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint16_t pcg_mcg_32_xsh_rr_16_random_r(struct pcg_state_32* rng)+static inline uint16_t pcg_mcg_32_xsh_rr_16_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_mcg_32_step_r(rng); pcg_mcg_32_step_r(rng);
return pcg_output_xsh_rr_32_16(oldstate); return pcg_output_xsh_rr_32_16(oldstate);
} }
-inline uint16_t pcg_mcg_32_xsh_rr_16_boundedrand_r(struct pcg_state_32* rng,+static inline uint16_t pcg_mcg_32_xsh_rr_16_boundedrand_r(struct pcg_state_32* rng,
uint16_t bound) uint16_t bound)
{ {
uint16_t threshold = ((uint16_t)(-bound)) % bound; uint16_t threshold = ((uint16_t)(-bound)) % bound;
@@ -1444,14 +1444,14 @@ inline uint16_t pcg_mcg_32_xsh_rr_16_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint32_t pcg_mcg_64_xsh_rr_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_mcg_64_xsh_rr_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_mcg_64_step_r(rng); pcg_mcg_64_step_r(rng);
return pcg_output_xsh_rr_64_32(oldstate); return pcg_output_xsh_rr_64_32(oldstate);
} }
-inline uint32_t pcg_mcg_64_xsh_rr_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_mcg_64_xsh_rr_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -1463,7 +1463,7 @@ inline uint32_t pcg_mcg_64_xsh_rr_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_mcg_128_xsh_rr_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_mcg_128_xsh_rr_64_random_r(struct pcg_state_128* rng)
{ {
pcg_mcg_128_step_r(rng); pcg_mcg_128_step_r(rng);
return pcg_output_xsh_rr_128_64(rng->state); return pcg_output_xsh_rr_128_64(rng->state);
@@ -1471,7 +1471,7 @@ inline uint64_t pcg_mcg_128_xsh_rr_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_mcg_128_xsh_rr_64_boundedrand_r(struct pcg_state_128* rng,+static inline uint64_t pcg_mcg_128_xsh_rr_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
uint64_t threshold = -bound % bound; uint64_t threshold = -bound % bound;
@@ -1487,14 +1487,14 @@ inline uint64_t pcg_mcg_128_xsh_rr_64_boundedrand_r(struct pcg_state_128* rng,
* don't make sense when you want to use the entire state) * don't make sense when you want to use the entire state)
*/ */
-inline uint8_t pcg_oneseq_8_rxs_m_xs_8_random_r(struct pcg_state_8* rng)+static inline uint8_t pcg_oneseq_8_rxs_m_xs_8_random_r(struct pcg_state_8* rng)
{ {
uint8_t oldstate = rng->state; uint8_t oldstate = rng->state;
pcg_oneseq_8_step_r(rng); pcg_oneseq_8_step_r(rng);
return pcg_output_rxs_m_xs_8_8(oldstate); return pcg_output_rxs_m_xs_8_8(oldstate);
} }
-inline uint8_t pcg_oneseq_8_rxs_m_xs_8_boundedrand_r(struct pcg_state_8* rng,+static inline uint8_t pcg_oneseq_8_rxs_m_xs_8_boundedrand_r(struct pcg_state_8* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -1505,14 +1505,14 @@ inline uint8_t pcg_oneseq_8_rxs_m_xs_8_boundedrand_r(struct pcg_state_8* rng,
} }
} }
-inline uint16_t pcg_oneseq_16_rxs_m_xs_16_random_r(struct pcg_state_16* rng)+static inline uint16_t pcg_oneseq_16_rxs_m_xs_16_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_oneseq_16_step_r(rng); pcg_oneseq_16_step_r(rng);
return pcg_output_rxs_m_xs_16_16(oldstate); return pcg_output_rxs_m_xs_16_16(oldstate);
} }
-inline uint16_t+static inline uint16_t
pcg_oneseq_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_16* rng, pcg_oneseq_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_16* rng,
uint16_t bound) uint16_t bound)
{ {
@@ -1524,14 +1524,14 @@ pcg_oneseq_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint32_t pcg_oneseq_32_rxs_m_xs_32_random_r(struct pcg_state_32* rng)+static inline uint32_t pcg_oneseq_32_rxs_m_xs_32_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_oneseq_32_step_r(rng); pcg_oneseq_32_step_r(rng);
return pcg_output_rxs_m_xs_32_32(oldstate); return pcg_output_rxs_m_xs_32_32(oldstate);
} }
-inline uint32_t+static inline uint32_t
pcg_oneseq_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_32* rng, pcg_oneseq_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_32* rng,
uint32_t bound) uint32_t bound)
{ {
@@ -1543,14 +1543,14 @@ pcg_oneseq_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint64_t pcg_oneseq_64_rxs_m_xs_64_random_r(struct pcg_state_64* rng)+static inline uint64_t pcg_oneseq_64_rxs_m_xs_64_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_oneseq_64_step_r(rng); pcg_oneseq_64_step_r(rng);
return pcg_output_rxs_m_xs_64_64(oldstate); return pcg_output_rxs_m_xs_64_64(oldstate);
} }
-inline uint64_t+static inline uint64_t
pcg_oneseq_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_64* rng, pcg_oneseq_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_64* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -1563,7 +1563,7 @@ pcg_oneseq_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t pcg_oneseq_128_rxs_m_xs_128_random_r(struct pcg_state_128* rng)+static inline pcg128_t pcg_oneseq_128_rxs_m_xs_128_random_r(struct pcg_state_128* rng)
{ {
pcg_oneseq_128_step_r(rng); pcg_oneseq_128_step_r(rng);
return pcg_output_rxs_m_xs_128_128(rng->state); return pcg_output_rxs_m_xs_128_128(rng->state);
@@ -1571,7 +1571,7 @@ inline pcg128_t pcg_oneseq_128_rxs_m_xs_128_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t+static inline pcg128_t
pcg_oneseq_128_rxs_m_xs_128_boundedrand_r(struct pcg_state_128* rng, pcg_oneseq_128_rxs_m_xs_128_boundedrand_r(struct pcg_state_128* rng,
pcg128_t bound) pcg128_t bound)
{ {
@@ -1584,14 +1584,14 @@ pcg_oneseq_128_rxs_m_xs_128_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint16_t pcg_unique_16_rxs_m_xs_16_random_r(struct pcg_state_16* rng)+static inline uint16_t pcg_unique_16_rxs_m_xs_16_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_unique_16_step_r(rng); pcg_unique_16_step_r(rng);
return pcg_output_rxs_m_xs_16_16(oldstate); return pcg_output_rxs_m_xs_16_16(oldstate);
} }
-inline uint16_t+static inline uint16_t
pcg_unique_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_16* rng, pcg_unique_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_16* rng,
uint16_t bound) uint16_t bound)
{ {
@@ -1603,14 +1603,14 @@ pcg_unique_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint32_t pcg_unique_32_rxs_m_xs_32_random_r(struct pcg_state_32* rng)+static inline uint32_t pcg_unique_32_rxs_m_xs_32_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_unique_32_step_r(rng); pcg_unique_32_step_r(rng);
return pcg_output_rxs_m_xs_32_32(oldstate); return pcg_output_rxs_m_xs_32_32(oldstate);
} }
-inline uint32_t+static inline uint32_t
pcg_unique_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_32* rng, pcg_unique_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_32* rng,
uint32_t bound) uint32_t bound)
{ {
@@ -1622,14 +1622,14 @@ pcg_unique_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint64_t pcg_unique_64_rxs_m_xs_64_random_r(struct pcg_state_64* rng)+static inline uint64_t pcg_unique_64_rxs_m_xs_64_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_unique_64_step_r(rng); pcg_unique_64_step_r(rng);
return pcg_output_rxs_m_xs_64_64(oldstate); return pcg_output_rxs_m_xs_64_64(oldstate);
} }
-inline uint64_t+static inline uint64_t
pcg_unique_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_64* rng, pcg_unique_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_64* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -1642,7 +1642,7 @@ pcg_unique_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t pcg_unique_128_rxs_m_xs_128_random_r(struct pcg_state_128* rng)+static inline pcg128_t pcg_unique_128_rxs_m_xs_128_random_r(struct pcg_state_128* rng)
{ {
pcg_unique_128_step_r(rng); pcg_unique_128_step_r(rng);
return pcg_output_rxs_m_xs_128_128(rng->state); return pcg_output_rxs_m_xs_128_128(rng->state);
@@ -1650,7 +1650,7 @@ inline pcg128_t pcg_unique_128_rxs_m_xs_128_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t+static inline pcg128_t
pcg_unique_128_rxs_m_xs_128_boundedrand_r(struct pcg_state_128* rng, pcg_unique_128_rxs_m_xs_128_boundedrand_r(struct pcg_state_128* rng,
pcg128_t bound) pcg128_t bound)
{ {
@@ -1663,14 +1663,14 @@ pcg_unique_128_rxs_m_xs_128_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint8_t pcg_setseq_8_rxs_m_xs_8_random_r(struct pcg_state_setseq_8* rng)+static inline uint8_t pcg_setseq_8_rxs_m_xs_8_random_r(struct pcg_state_setseq_8* rng)
{ {
uint8_t oldstate = rng->state; uint8_t oldstate = rng->state;
pcg_setseq_8_step_r(rng); pcg_setseq_8_step_r(rng);
return pcg_output_rxs_m_xs_8_8(oldstate); return pcg_output_rxs_m_xs_8_8(oldstate);
} }
-inline uint8_t+static inline uint8_t
pcg_setseq_8_rxs_m_xs_8_boundedrand_r(struct pcg_state_setseq_8* rng, pcg_setseq_8_rxs_m_xs_8_boundedrand_r(struct pcg_state_setseq_8* rng,
uint8_t bound) uint8_t bound)
{ {
@@ -1682,7 +1682,7 @@ pcg_setseq_8_rxs_m_xs_8_boundedrand_r(struct pcg_state_setseq_8* rng,
} }
} }
-inline uint16_t+static inline uint16_t
pcg_setseq_16_rxs_m_xs_16_random_r(struct pcg_state_setseq_16* rng) pcg_setseq_16_rxs_m_xs_16_random_r(struct pcg_state_setseq_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
@@ -1690,7 +1690,7 @@ pcg_setseq_16_rxs_m_xs_16_random_r(struct pcg_state_setseq_16* rng)
return pcg_output_rxs_m_xs_16_16(oldstate); return pcg_output_rxs_m_xs_16_16(oldstate);
} }
-inline uint16_t+static inline uint16_t
pcg_setseq_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_setseq_16* rng, pcg_setseq_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_setseq_16* rng,
uint16_t bound) uint16_t bound)
{ {
@@ -1702,7 +1702,7 @@ pcg_setseq_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_setseq_16* rng,
} }
} }
-inline uint32_t+static inline uint32_t
pcg_setseq_32_rxs_m_xs_32_random_r(struct pcg_state_setseq_32* rng) pcg_setseq_32_rxs_m_xs_32_random_r(struct pcg_state_setseq_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
@@ -1710,7 +1710,7 @@ pcg_setseq_32_rxs_m_xs_32_random_r(struct pcg_state_setseq_32* rng)
return pcg_output_rxs_m_xs_32_32(oldstate); return pcg_output_rxs_m_xs_32_32(oldstate);
} }
-inline uint32_t+static inline uint32_t
pcg_setseq_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_setseq_32* rng, pcg_setseq_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_setseq_32* rng,
uint32_t bound) uint32_t bound)
{ {
@@ -1722,7 +1722,7 @@ pcg_setseq_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_setseq_32* rng,
} }
} }
-inline uint64_t+static inline uint64_t
pcg_setseq_64_rxs_m_xs_64_random_r(struct pcg_state_setseq_64* rng) pcg_setseq_64_rxs_m_xs_64_random_r(struct pcg_state_setseq_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
@@ -1730,7 +1730,7 @@ pcg_setseq_64_rxs_m_xs_64_random_r(struct pcg_state_setseq_64* rng)
return pcg_output_rxs_m_xs_64_64(oldstate); return pcg_output_rxs_m_xs_64_64(oldstate);
} }
-inline uint64_t+static inline uint64_t
pcg_setseq_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_setseq_64* rng, pcg_setseq_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_setseq_64* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -1743,7 +1743,7 @@ pcg_setseq_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_setseq_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t+static inline pcg128_t
pcg_setseq_128_rxs_m_xs_128_random_r(struct pcg_state_setseq_128* rng) pcg_setseq_128_rxs_m_xs_128_random_r(struct pcg_state_setseq_128* rng)
{ {
pcg_setseq_128_step_r(rng); pcg_setseq_128_step_r(rng);
@@ -1752,7 +1752,7 @@ pcg_setseq_128_rxs_m_xs_128_random_r(struct pcg_state_setseq_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t+static inline pcg128_t
pcg_setseq_128_rxs_m_xs_128_boundedrand_r(struct pcg_state_setseq_128* rng, pcg_setseq_128_rxs_m_xs_128_boundedrand_r(struct pcg_state_setseq_128* rng,
pcg128_t bound) pcg128_t bound)
{ {
@@ -1767,14 +1767,14 @@ pcg_setseq_128_rxs_m_xs_128_boundedrand_r(struct pcg_state_setseq_128* rng,
/* Generation functions for RXS M */ /* Generation functions for RXS M */
-inline uint8_t pcg_oneseq_16_rxs_m_8_random_r(struct pcg_state_16* rng)+static inline uint8_t pcg_oneseq_16_rxs_m_8_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_oneseq_16_step_r(rng); pcg_oneseq_16_step_r(rng);
return pcg_output_rxs_m_16_8(oldstate); return pcg_output_rxs_m_16_8(oldstate);
} }
-inline uint8_t pcg_oneseq_16_rxs_m_8_boundedrand_r(struct pcg_state_16* rng,+static inline uint8_t pcg_oneseq_16_rxs_m_8_boundedrand_r(struct pcg_state_16* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -1785,14 +1785,14 @@ inline uint8_t pcg_oneseq_16_rxs_m_8_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint16_t pcg_oneseq_32_rxs_m_16_random_r(struct pcg_state_32* rng)+static inline uint16_t pcg_oneseq_32_rxs_m_16_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_oneseq_32_step_r(rng); pcg_oneseq_32_step_r(rng);
return pcg_output_rxs_m_32_16(oldstate); return pcg_output_rxs_m_32_16(oldstate);
} }
-inline uint16_t pcg_oneseq_32_rxs_m_16_boundedrand_r(struct pcg_state_32* rng,+static inline uint16_t pcg_oneseq_32_rxs_m_16_boundedrand_r(struct pcg_state_32* rng,
uint16_t bound) uint16_t bound)
{ {
uint16_t threshold = ((uint16_t)(-bound)) % bound; uint16_t threshold = ((uint16_t)(-bound)) % bound;
@@ -1803,14 +1803,14 @@ inline uint16_t pcg_oneseq_32_rxs_m_16_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint32_t pcg_oneseq_64_rxs_m_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_oneseq_64_rxs_m_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_oneseq_64_step_r(rng); pcg_oneseq_64_step_r(rng);
return pcg_output_rxs_m_64_32(oldstate); return pcg_output_rxs_m_64_32(oldstate);
} }
-inline uint32_t pcg_oneseq_64_rxs_m_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_oneseq_64_rxs_m_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -1822,7 +1822,7 @@ inline uint32_t pcg_oneseq_64_rxs_m_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_oneseq_128_rxs_m_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_oneseq_128_rxs_m_64_random_r(struct pcg_state_128* rng)
{ {
pcg_oneseq_128_step_r(rng); pcg_oneseq_128_step_r(rng);
return pcg_output_rxs_m_128_64(rng->state); return pcg_output_rxs_m_128_64(rng->state);
@@ -1830,7 +1830,7 @@ inline uint64_t pcg_oneseq_128_rxs_m_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_oneseq_128_rxs_m_64_boundedrand_r(struct pcg_state_128* rng,+static inline uint64_t pcg_oneseq_128_rxs_m_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
uint64_t threshold = -bound % bound; uint64_t threshold = -bound % bound;
@@ -1842,14 +1842,14 @@ inline uint64_t pcg_oneseq_128_rxs_m_64_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint8_t pcg_unique_16_rxs_m_8_random_r(struct pcg_state_16* rng)+static inline uint8_t pcg_unique_16_rxs_m_8_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_unique_16_step_r(rng); pcg_unique_16_step_r(rng);
return pcg_output_rxs_m_16_8(oldstate); return pcg_output_rxs_m_16_8(oldstate);
} }
-inline uint8_t pcg_unique_16_rxs_m_8_boundedrand_r(struct pcg_state_16* rng,+static inline uint8_t pcg_unique_16_rxs_m_8_boundedrand_r(struct pcg_state_16* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -1860,14 +1860,14 @@ inline uint8_t pcg_unique_16_rxs_m_8_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint16_t pcg_unique_32_rxs_m_16_random_r(struct pcg_state_32* rng)+static inline uint16_t pcg_unique_32_rxs_m_16_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_unique_32_step_r(rng); pcg_unique_32_step_r(rng);
return pcg_output_rxs_m_32_16(oldstate); return pcg_output_rxs_m_32_16(oldstate);
} }
-inline uint16_t pcg_unique_32_rxs_m_16_boundedrand_r(struct pcg_state_32* rng,+static inline uint16_t pcg_unique_32_rxs_m_16_boundedrand_r(struct pcg_state_32* rng,
uint16_t bound) uint16_t bound)
{ {
uint16_t threshold = ((uint16_t)(-bound)) % bound; uint16_t threshold = ((uint16_t)(-bound)) % bound;
@@ -1878,14 +1878,14 @@ inline uint16_t pcg_unique_32_rxs_m_16_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint32_t pcg_unique_64_rxs_m_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_unique_64_rxs_m_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_unique_64_step_r(rng); pcg_unique_64_step_r(rng);
return pcg_output_rxs_m_64_32(oldstate); return pcg_output_rxs_m_64_32(oldstate);
} }
-inline uint32_t pcg_unique_64_rxs_m_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_unique_64_rxs_m_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -1897,7 +1897,7 @@ inline uint32_t pcg_unique_64_rxs_m_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_unique_128_rxs_m_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_unique_128_rxs_m_64_random_r(struct pcg_state_128* rng)
{ {
pcg_unique_128_step_r(rng); pcg_unique_128_step_r(rng);
return pcg_output_rxs_m_128_64(rng->state); return pcg_output_rxs_m_128_64(rng->state);
@@ -1905,7 +1905,7 @@ inline uint64_t pcg_unique_128_rxs_m_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_unique_128_rxs_m_64_boundedrand_r(struct pcg_state_128* rng,+static inline uint64_t pcg_unique_128_rxs_m_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
uint64_t threshold = -bound % bound; uint64_t threshold = -bound % bound;
@@ -1917,14 +1917,14 @@ inline uint64_t pcg_unique_128_rxs_m_64_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint8_t pcg_setseq_16_rxs_m_8_random_r(struct pcg_state_setseq_16* rng)+static inline uint8_t pcg_setseq_16_rxs_m_8_random_r(struct pcg_state_setseq_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_setseq_16_step_r(rng); pcg_setseq_16_step_r(rng);
return pcg_output_rxs_m_16_8(oldstate); return pcg_output_rxs_m_16_8(oldstate);
} }
-inline uint8_t+static inline uint8_t
pcg_setseq_16_rxs_m_8_boundedrand_r(struct pcg_state_setseq_16* rng, pcg_setseq_16_rxs_m_8_boundedrand_r(struct pcg_state_setseq_16* rng,
uint8_t bound) uint8_t bound)
{ {
@@ -1936,14 +1936,14 @@ pcg_setseq_16_rxs_m_8_boundedrand_r(struct pcg_state_setseq_16* rng,
} }
} }
-inline uint16_t pcg_setseq_32_rxs_m_16_random_r(struct pcg_state_setseq_32* rng)+static inline uint16_t pcg_setseq_32_rxs_m_16_random_r(struct pcg_state_setseq_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_setseq_32_step_r(rng); pcg_setseq_32_step_r(rng);
return pcg_output_rxs_m_32_16(oldstate); return pcg_output_rxs_m_32_16(oldstate);
} }
-inline uint16_t+static inline uint16_t
pcg_setseq_32_rxs_m_16_boundedrand_r(struct pcg_state_setseq_32* rng, pcg_setseq_32_rxs_m_16_boundedrand_r(struct pcg_state_setseq_32* rng,
uint16_t bound) uint16_t bound)
{ {
@@ -1955,14 +1955,14 @@ pcg_setseq_32_rxs_m_16_boundedrand_r(struct pcg_state_setseq_32* rng,
} }
} }
-inline uint32_t pcg_setseq_64_rxs_m_32_random_r(struct pcg_state_setseq_64* rng)+static inline uint32_t pcg_setseq_64_rxs_m_32_random_r(struct pcg_state_setseq_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_setseq_64_step_r(rng); pcg_setseq_64_step_r(rng);
return pcg_output_rxs_m_64_32(oldstate); return pcg_output_rxs_m_64_32(oldstate);
} }
-inline uint32_t+static inline uint32_t
pcg_setseq_64_rxs_m_32_boundedrand_r(struct pcg_state_setseq_64* rng, pcg_setseq_64_rxs_m_32_boundedrand_r(struct pcg_state_setseq_64* rng,
uint32_t bound) uint32_t bound)
{ {
@@ -1975,7 +1975,7 @@ pcg_setseq_64_rxs_m_32_boundedrand_r(struct pcg_state_setseq_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_setseq_128_rxs_m_64_random_r(struct pcg_state_setseq_128* rng) pcg_setseq_128_rxs_m_64_random_r(struct pcg_state_setseq_128* rng)
{ {
pcg_setseq_128_step_r(rng); pcg_setseq_128_step_r(rng);
@@ -1984,7 +1984,7 @@ pcg_setseq_128_rxs_m_64_random_r(struct pcg_state_setseq_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_setseq_128_rxs_m_64_boundedrand_r(struct pcg_state_setseq_128* rng, pcg_setseq_128_rxs_m_64_boundedrand_r(struct pcg_state_setseq_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -1997,14 +1997,14 @@ pcg_setseq_128_rxs_m_64_boundedrand_r(struct pcg_state_setseq_128* rng,
} }
#endif #endif
-inline uint8_t pcg_mcg_16_rxs_m_8_random_r(struct pcg_state_16* rng)+static inline uint8_t pcg_mcg_16_rxs_m_8_random_r(struct pcg_state_16* rng)
{ {
uint16_t oldstate = rng->state; uint16_t oldstate = rng->state;
pcg_mcg_16_step_r(rng); pcg_mcg_16_step_r(rng);
return pcg_output_rxs_m_16_8(oldstate); return pcg_output_rxs_m_16_8(oldstate);
} }
-inline uint8_t pcg_mcg_16_rxs_m_8_boundedrand_r(struct pcg_state_16* rng,+static inline uint8_t pcg_mcg_16_rxs_m_8_boundedrand_r(struct pcg_state_16* rng,
uint8_t bound) uint8_t bound)
{ {
uint8_t threshold = ((uint8_t)(-bound)) % bound; uint8_t threshold = ((uint8_t)(-bound)) % bound;
@@ -2015,14 +2015,14 @@ inline uint8_t pcg_mcg_16_rxs_m_8_boundedrand_r(struct pcg_state_16* rng,
} }
} }
-inline uint16_t pcg_mcg_32_rxs_m_16_random_r(struct pcg_state_32* rng)+static inline uint16_t pcg_mcg_32_rxs_m_16_random_r(struct pcg_state_32* rng)
{ {
uint32_t oldstate = rng->state; uint32_t oldstate = rng->state;
pcg_mcg_32_step_r(rng); pcg_mcg_32_step_r(rng);
return pcg_output_rxs_m_32_16(oldstate); return pcg_output_rxs_m_32_16(oldstate);
} }
-inline uint16_t pcg_mcg_32_rxs_m_16_boundedrand_r(struct pcg_state_32* rng,+static inline uint16_t pcg_mcg_32_rxs_m_16_boundedrand_r(struct pcg_state_32* rng,
uint16_t bound) uint16_t bound)
{ {
uint16_t threshold = ((uint16_t)(-bound)) % bound; uint16_t threshold = ((uint16_t)(-bound)) % bound;
@@ -2033,14 +2033,14 @@ inline uint16_t pcg_mcg_32_rxs_m_16_boundedrand_r(struct pcg_state_32* rng,
} }
} }
-inline uint32_t pcg_mcg_64_rxs_m_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_mcg_64_rxs_m_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_mcg_64_step_r(rng); pcg_mcg_64_step_r(rng);
return pcg_output_rxs_m_64_32(oldstate); return pcg_output_rxs_m_64_32(oldstate);
} }
-inline uint32_t pcg_mcg_64_rxs_m_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_mcg_64_rxs_m_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -2052,7 +2052,7 @@ inline uint32_t pcg_mcg_64_rxs_m_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_mcg_128_rxs_m_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_mcg_128_rxs_m_64_random_r(struct pcg_state_128* rng)
{ {
pcg_mcg_128_step_r(rng); pcg_mcg_128_step_r(rng);
return pcg_output_rxs_m_128_64(rng->state); return pcg_output_rxs_m_128_64(rng->state);
@@ -2060,7 +2060,7 @@ inline uint64_t pcg_mcg_128_rxs_m_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_mcg_128_rxs_m_64_boundedrand_r(struct pcg_state_128* rng,+static inline uint64_t pcg_mcg_128_rxs_m_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
uint64_t threshold = -bound % bound; uint64_t threshold = -bound % bound;
@@ -2074,14 +2074,14 @@ inline uint64_t pcg_mcg_128_rxs_m_64_boundedrand_r(struct pcg_state_128* rng,
/* Generation functions for XSL RR (only defined for "large" types) */ /* Generation functions for XSL RR (only defined for "large" types) */
-inline uint32_t pcg_oneseq_64_xsl_rr_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_oneseq_64_xsl_rr_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_oneseq_64_step_r(rng); pcg_oneseq_64_step_r(rng);
return pcg_output_xsl_rr_64_32(oldstate); return pcg_output_xsl_rr_64_32(oldstate);
} }
-inline uint32_t pcg_oneseq_64_xsl_rr_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_oneseq_64_xsl_rr_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -2093,7 +2093,7 @@ inline uint32_t pcg_oneseq_64_xsl_rr_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_oneseq_128_xsl_rr_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_oneseq_128_xsl_rr_64_random_r(struct pcg_state_128* rng)
{ {
pcg_oneseq_128_step_r(rng); pcg_oneseq_128_step_r(rng);
return pcg_output_xsl_rr_128_64(rng->state); return pcg_output_xsl_rr_128_64(rng->state);
@@ -2101,7 +2101,7 @@ inline uint64_t pcg_oneseq_128_xsl_rr_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_oneseq_128_xsl_rr_64_boundedrand_r(struct pcg_state_128* rng, pcg_oneseq_128_xsl_rr_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -2114,14 +2114,14 @@ pcg_oneseq_128_xsl_rr_64_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint32_t pcg_unique_64_xsl_rr_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_unique_64_xsl_rr_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_unique_64_step_r(rng); pcg_unique_64_step_r(rng);
return pcg_output_xsl_rr_64_32(oldstate); return pcg_output_xsl_rr_64_32(oldstate);
} }
-inline uint32_t pcg_unique_64_xsl_rr_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_unique_64_xsl_rr_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -2133,7 +2133,7 @@ inline uint32_t pcg_unique_64_xsl_rr_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_unique_128_xsl_rr_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_unique_128_xsl_rr_64_random_r(struct pcg_state_128* rng)
{ {
pcg_unique_128_step_r(rng); pcg_unique_128_step_r(rng);
return pcg_output_xsl_rr_128_64(rng->state); return pcg_output_xsl_rr_128_64(rng->state);
@@ -2141,7 +2141,7 @@ inline uint64_t pcg_unique_128_xsl_rr_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_unique_128_xsl_rr_64_boundedrand_r(struct pcg_state_128* rng, pcg_unique_128_xsl_rr_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -2154,7 +2154,7 @@ pcg_unique_128_xsl_rr_64_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint32_t+static inline uint32_t
pcg_setseq_64_xsl_rr_32_random_r(struct pcg_state_setseq_64* rng) pcg_setseq_64_xsl_rr_32_random_r(struct pcg_state_setseq_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
@@ -2162,7 +2162,7 @@ pcg_setseq_64_xsl_rr_32_random_r(struct pcg_state_setseq_64* rng)
return pcg_output_xsl_rr_64_32(oldstate); return pcg_output_xsl_rr_64_32(oldstate);
} }
-inline uint32_t+static inline uint32_t
pcg_setseq_64_xsl_rr_32_boundedrand_r(struct pcg_state_setseq_64* rng, pcg_setseq_64_xsl_rr_32_boundedrand_r(struct pcg_state_setseq_64* rng,
uint32_t bound) uint32_t bound)
{ {
@@ -2175,7 +2175,7 @@ pcg_setseq_64_xsl_rr_32_boundedrand_r(struct pcg_state_setseq_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_setseq_128_xsl_rr_64_random_r(struct pcg_state_setseq_128* rng) pcg_setseq_128_xsl_rr_64_random_r(struct pcg_state_setseq_128* rng)
{ {
pcg_setseq_128_step_r(rng); pcg_setseq_128_step_r(rng);
@@ -2184,7 +2184,7 @@ pcg_setseq_128_xsl_rr_64_random_r(struct pcg_state_setseq_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t+static inline uint64_t
pcg_setseq_128_xsl_rr_64_boundedrand_r(struct pcg_state_setseq_128* rng, pcg_setseq_128_xsl_rr_64_boundedrand_r(struct pcg_state_setseq_128* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -2197,14 +2197,14 @@ pcg_setseq_128_xsl_rr_64_boundedrand_r(struct pcg_state_setseq_128* rng,
} }
#endif #endif
-inline uint32_t pcg_mcg_64_xsl_rr_32_random_r(struct pcg_state_64* rng)+static inline uint32_t pcg_mcg_64_xsl_rr_32_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_mcg_64_step_r(rng); pcg_mcg_64_step_r(rng);
return pcg_output_xsl_rr_64_32(oldstate); return pcg_output_xsl_rr_64_32(oldstate);
} }
-inline uint32_t pcg_mcg_64_xsl_rr_32_boundedrand_r(struct pcg_state_64* rng,+static inline uint32_t pcg_mcg_64_xsl_rr_32_boundedrand_r(struct pcg_state_64* rng,
uint32_t bound) uint32_t bound)
{ {
uint32_t threshold = -bound % bound; uint32_t threshold = -bound % bound;
@@ -2216,7 +2216,7 @@ inline uint32_t pcg_mcg_64_xsl_rr_32_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_mcg_128_xsl_rr_64_random_r(struct pcg_state_128* rng)+static inline uint64_t pcg_mcg_128_xsl_rr_64_random_r(struct pcg_state_128* rng)
{ {
pcg_mcg_128_step_r(rng); pcg_mcg_128_step_r(rng);
return pcg_output_xsl_rr_128_64(rng->state); return pcg_output_xsl_rr_128_64(rng->state);
@@ -2224,7 +2224,7 @@ inline uint64_t pcg_mcg_128_xsl_rr_64_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline uint64_t pcg_mcg_128_xsl_rr_64_boundedrand_r(struct pcg_state_128* rng,+static inline uint64_t pcg_mcg_128_xsl_rr_64_boundedrand_r(struct pcg_state_128* rng,
uint64_t bound) uint64_t bound)
{ {
uint64_t threshold = -bound % bound; uint64_t threshold = -bound % bound;
@@ -2238,14 +2238,14 @@ inline uint64_t pcg_mcg_128_xsl_rr_64_boundedrand_r(struct pcg_state_128* rng,
/* Generation functions for XSL RR RR (only defined for "large" types) */ /* Generation functions for XSL RR RR (only defined for "large" types) */
-inline uint64_t pcg_oneseq_64_xsl_rr_rr_64_random_r(struct pcg_state_64* rng)+static inline uint64_t pcg_oneseq_64_xsl_rr_rr_64_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_oneseq_64_step_r(rng); pcg_oneseq_64_step_r(rng);
return pcg_output_xsl_rr_rr_64_64(oldstate); return pcg_output_xsl_rr_rr_64_64(oldstate);
} }
-inline uint64_t+static inline uint64_t
pcg_oneseq_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_64* rng, pcg_oneseq_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_64* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -2258,7 +2258,7 @@ pcg_oneseq_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t pcg_oneseq_128_xsl_rr_rr_128_random_r(struct pcg_state_128* rng)+static inline pcg128_t pcg_oneseq_128_xsl_rr_rr_128_random_r(struct pcg_state_128* rng)
{ {
pcg_oneseq_128_step_r(rng); pcg_oneseq_128_step_r(rng);
return pcg_output_xsl_rr_rr_128_128(rng->state); return pcg_output_xsl_rr_rr_128_128(rng->state);
@@ -2266,7 +2266,7 @@ inline pcg128_t pcg_oneseq_128_xsl_rr_rr_128_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t+static inline pcg128_t
pcg_oneseq_128_xsl_rr_rr_128_boundedrand_r(struct pcg_state_128* rng, pcg_oneseq_128_xsl_rr_rr_128_boundedrand_r(struct pcg_state_128* rng,
pcg128_t bound) pcg128_t bound)
{ {
@@ -2279,14 +2279,14 @@ pcg_oneseq_128_xsl_rr_rr_128_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint64_t pcg_unique_64_xsl_rr_rr_64_random_r(struct pcg_state_64* rng)+static inline uint64_t pcg_unique_64_xsl_rr_rr_64_random_r(struct pcg_state_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
pcg_unique_64_step_r(rng); pcg_unique_64_step_r(rng);
return pcg_output_xsl_rr_rr_64_64(oldstate); return pcg_output_xsl_rr_rr_64_64(oldstate);
} }
-inline uint64_t+static inline uint64_t
pcg_unique_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_64* rng, pcg_unique_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_64* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -2299,7 +2299,7 @@ pcg_unique_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t pcg_unique_128_xsl_rr_rr_128_random_r(struct pcg_state_128* rng)+static inline pcg128_t pcg_unique_128_xsl_rr_rr_128_random_r(struct pcg_state_128* rng)
{ {
pcg_unique_128_step_r(rng); pcg_unique_128_step_r(rng);
return pcg_output_xsl_rr_rr_128_128(rng->state); return pcg_output_xsl_rr_rr_128_128(rng->state);
@@ -2307,7 +2307,7 @@ inline pcg128_t pcg_unique_128_xsl_rr_rr_128_random_r(struct pcg_state_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t+static inline pcg128_t
pcg_unique_128_xsl_rr_rr_128_boundedrand_r(struct pcg_state_128* rng, pcg_unique_128_xsl_rr_rr_128_boundedrand_r(struct pcg_state_128* rng,
pcg128_t bound) pcg128_t bound)
{ {
@@ -2320,7 +2320,7 @@ pcg_unique_128_xsl_rr_rr_128_boundedrand_r(struct pcg_state_128* rng,
} }
#endif #endif
-inline uint64_t+static inline uint64_t
pcg_setseq_64_xsl_rr_rr_64_random_r(struct pcg_state_setseq_64* rng) pcg_setseq_64_xsl_rr_rr_64_random_r(struct pcg_state_setseq_64* rng)
{ {
uint64_t oldstate = rng->state; uint64_t oldstate = rng->state;
@@ -2328,7 +2328,7 @@ pcg_setseq_64_xsl_rr_rr_64_random_r(struct pcg_state_setseq_64* rng)
return pcg_output_xsl_rr_rr_64_64(oldstate); return pcg_output_xsl_rr_rr_64_64(oldstate);
} }
-inline uint64_t+static inline uint64_t
pcg_setseq_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_setseq_64* rng, pcg_setseq_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_setseq_64* rng,
uint64_t bound) uint64_t bound)
{ {
@@ -2341,7 +2341,7 @@ pcg_setseq_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_setseq_64* rng,
} }
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t+static inline pcg128_t
pcg_setseq_128_xsl_rr_rr_128_random_r(struct pcg_state_setseq_128* rng) pcg_setseq_128_xsl_rr_rr_128_random_r(struct pcg_state_setseq_128* rng)
{ {
pcg_setseq_128_step_r(rng); pcg_setseq_128_step_r(rng);
@@ -2350,7 +2350,7 @@ pcg_setseq_128_xsl_rr_rr_128_random_r(struct pcg_state_setseq_128* rng)
#endif #endif
#if PCG_HAS_128BIT_OPS #if PCG_HAS_128BIT_OPS
-inline pcg128_t+static inline pcg128_t
pcg_setseq_128_xsl_rr_rr_128_boundedrand_r(struct pcg_state_setseq_128* rng, pcg_setseq_128_xsl_rr_rr_128_boundedrand_r(struct pcg_state_setseq_128* rng,
pcg128_t bound) pcg128_t bound)
{ {
sys/kern/subr_witness.c
@@ -338,6 +338,7 @@ static void witness_ddb_display_list(int(*prnt)(const char *fmt, ...),
static void witness_ddb_level_descendants(struct witness *parent, int l); static void witness_ddb_level_descendants(struct witness *parent, int l);
static void witness_ddb_list(struct thread *td); static void witness_ddb_list(struct thread *td);
#endif #endif
+static void witness_enter_debugger(const char *msg);
static void witness_debugger(int cond, const char *msg); static void witness_debugger(int cond, const char *msg);
static void witness_free(struct witness *m); static void witness_free(struct witness *m);
static struct witness *witness_get(void); static struct witness *witness_get(void);
@@ -358,6 +359,8 @@ static struct witness_lock_order_data *witness_lock_order_get(
static void witness_list_lock(struct lock_instance *instance, static void witness_list_lock(struct lock_instance *instance,
int (*prnt)(const char *fmt, ...)); int (*prnt)(const char *fmt, ...));
static int witness_output(const char *fmt, ...) __printflike(1, 2); static int witness_output(const char *fmt, ...) __printflike(1, 2);
+static int witness_output_drain(void *arg __unused, const char *data,
+ int len);
static int witness_voutput(const char *fmt, va_list ap) __printflike(1, 0); static int witness_voutput(const char *fmt, va_list ap) __printflike(1, 0);
static void witness_setflag(struct lock_object *lock, int flag, int set); static void witness_setflag(struct lock_object *lock, int flag, int set);
@@ -1281,6 +1284,8 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file,
for (j = 0, lle = lock_list; lle != NULL; lle = lle->ll_next) { for (j = 0, lle = lock_list; lle != NULL; lle = lle->ll_next) {
for (i = lle->ll_count - 1; i >= 0; i--, j++) { for (i = lle->ll_count - 1; i >= 0; i--, j++) {
+ struct stack pstack;
+ bool pstackv, trace;
MPASS(j < LOCK_CHILDCOUNT * LOCK_NCHILDREN); MPASS(j < LOCK_CHILDCOUNT * LOCK_NCHILDREN);
lock1 = &lle->ll_children[i]; lock1 = &lle->ll_children[i];
@@ -1367,6 +1372,19 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file,
*/ */
if (blessed(w, w1)) if (blessed(w, w1))
goto out; goto out;
+
+ trace = atomic_load_int(&witness_trace);
+ if (trace) {
+ struct witness_lock_order_data *data;
+
+ pstackv = false;
+ data = witness_lock_order_get(w, w1);
+ if (data != NULL) {
+ stack_copy(&data->wlod_stack,
+ &pstack);
+ pstackv = true;
+ }
+ }
mtx_unlock_spin(&w_mtx); mtx_unlock_spin(&w_mtx);
#ifdef WITNESS_NO_VNODE #ifdef WITNESS_NO_VNODE
@@ -1413,28 +1431,60 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file,
i--; i--;
} while (i >= 0); } while (i >= 0);
if (i < 0) { if (i < 0) {
- witness_output(" 1st %p %s (%s) @ %s:%d\n",+ witness_output(" 1st %p %s (%s, %s) @ %s:%d\n",
lock1->li_lock, lock1->li_lock->lo_name, lock1->li_lock, lock1->li_lock->lo_name,
- w1->w_name, fixup_filename(lock1->li_file),+ w1->w_name, w1->w_class->lc_name,
+ fixup_filename(lock1->li_file),
lock1->li_line); lock1->li_line);
- witness_output(" 2nd %p %s (%s) @ %s:%d\n", lock,+ witness_output(" 2nd %p %s (%s, %s) @ %s:%d\n",
- lock->lo_name, w->w_name,+ lock, lock->lo_name, w->w_name,
- fixup_filename(file), line);+ w->w_class->lc_name, fixup_filename(file),
+ line);
} else { } else {
- witness_output(" 1st %p %s (%s) @ %s:%d\n",+ struct witness *w2 = lock2->li_lock->lo_witness;
+
+ witness_output(" 1st %p %s (%s, %s) @ %s:%d\n",
lock2->li_lock, lock2->li_lock->lo_name, lock2->li_lock, lock2->li_lock->lo_name,
- lock2->li_lock->lo_witness->w_name,+ w2->w_name, w2->w_class->lc_name,
fixup_filename(lock2->li_file), fixup_filename(lock2->li_file),
lock2->li_line); lock2->li_line);
- witness_output(" 2nd %p %s (%s) @ %s:%d\n",+ witness_output(" 2nd %p %s (%s, %s) @ %s:%d\n",
lock1->li_lock, lock1->li_lock->lo_name, lock1->li_lock, lock1->li_lock->lo_name,
- w1->w_name, fixup_filename(lock1->li_file),+ w1->w_name, w1->w_class->lc_name,
+ fixup_filename(lock1->li_file),
lock1->li_line); lock1->li_line);
- witness_output(" 3rd %p %s (%s) @ %s:%d\n", lock,+ witness_output(" 3rd %p %s (%s, %s) @ %s:%d\n", lock,
lock->lo_name, w->w_name, lock->lo_name, w->w_name,
- fixup_filename(file), line);+ w->w_class->lc_name, fixup_filename(file),
+ line);
} }
- witness_debugger(1, __func__);+ if (trace) {
+ char buf[64];
+ struct sbuf sb;
+
+ sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN);
+ sbuf_set_drain(&sb, witness_output_drain,
+ NULL);
+
+ if (pstackv) {
+ sbuf_printf(&sb,
+ "lock order %s -> %s established at:\n",
+ w->w_name, w1->w_name);
+ stack_sbuf_print_flags(&sb, &pstack,
+ M_NOWAIT, STACK_SBUF_FMT_LONG);
+ }
+
+ sbuf_printf(&sb,
+ "lock order %s -> %s attempted at:\n",
+ w1->w_name, w->w_name);
+ stack_save(&pstack);
+ stack_sbuf_print_flags(&sb, &pstack, M_NOWAIT,
+ STACK_SBUF_FMT_LONG);
+
+ sbuf_finish(&sb);
+ sbuf_delete(&sb);
+ }
+ witness_enter_debugger(__func__);
return; return;
} }
} }
@@ -3085,6 +3135,12 @@ witness_debugger(int cond, const char *msg)
sbuf_finish(&sb); sbuf_finish(&sb);
} }
+ witness_enter_debugger(msg);
+}
+
+static void
+witness_enter_debugger(const char *msg)
+{
#ifdef KDB #ifdef KDB
if (witness_kdb) if (witness_kdb)
kdb_enter(KDB_WHY_WITNESS, msg); kdb_enter(KDB_WHY_WITNESS, msg);
sys/net/if_vxlan.c
@@ -2545,7 +2545,7 @@ vxlan_rcv_udp_packet(struct mbuf *m, int offset, struct inpcb *inpcb,
* the behavior of the Linux implementation. * the behavior of the Linux implementation.
*/ */
if (vxh->vxlh_flags != htonl(VXLAN_HDR_FLAGS_VALID_VNI) || if (vxh->vxlh_flags != htonl(VXLAN_HDR_FLAGS_VALID_VNI) ||
- vxh->vxlh_vni & ~htonl(VXLAN_VNI_MASK))+ vxh->vxlh_vni & ~VXLAN_VNI_MASK)
goto out; goto out;
vni = ntohl(vxh->vxlh_vni) >> VXLAN_HDR_VNI_SHIFT; vni = ntohl(vxh->vxlh_vni) >> VXLAN_HDR_VNI_SHIFT;
sys/riscv/riscv/machdep.c
@@ -861,6 +861,7 @@ initriscv(struct riscv_bootparams *rvbp)
phandle_t chosen; phandle_t chosen;
uint32_t hart; uint32_t hart;
#endif #endif
+ char *env;
TSRAW(&thread0, TS_ENTER, __func__, NULL); TSRAW(&thread0, TS_ENTER, __func__, NULL);
@@ -955,6 +956,10 @@ initriscv(struct riscv_bootparams *rvbp)
init_param2(physmem); init_param2(physmem);
kdb_init(); kdb_init();
+ env = kern_getenv("kernelname");
+ if (env != NULL)
+ strlcpy(kernelname, env, sizeof(kernelname));
+
if (boothowto & RB_VERBOSE) if (boothowto & RB_VERBOSE)
physmem_print_tables(); physmem_print_tables();