mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-28 07:47:02 -05:00
includes/std: Added std::math::accumulate, corrected std::hash::crc32
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace std::hash {
|
||||
|
||||
fn crc32(ref auto pattern, u32 init, u32 poly) {
|
||||
return builtin::std::hash::crc32(pattern, init, poly);
|
||||
fn crc32(ref auto pattern, u32 init, u32 poly, u32 xorout, bool reflect_in, bool reflect_out) {
|
||||
return builtin::std::hash::crc32(pattern, init, poly, xorout, reflect_in, reflect_out);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/mem.pat>
|
||||
|
||||
namespace std::math {
|
||||
|
||||
fn min(auto a, auto b) {
|
||||
@@ -105,5 +107,17 @@ namespace std::math {
|
||||
fn asinh(auto value) { return builtin::std::math::asinh(value); };
|
||||
fn acosh(auto value) { return builtin::std::math::acosh(value); };
|
||||
fn atanh(auto value) { return builtin::std::math::atanh(value); };
|
||||
|
||||
enum AccumulateOperation : u8 {
|
||||
Add = 0,
|
||||
Multiply = 1,
|
||||
Modulo = 2,
|
||||
Min = 3,
|
||||
Max = 4
|
||||
};
|
||||
|
||||
fn accumulate(u128 start, u128 end, u128 valueSize, std::mem::Section section = 0, AccumulateOperation operation = AccumulateOperation::Add, std::mem::Endian endian = std::mem::Endian::Native) {
|
||||
return builtin::std::math::accumulate(start, end, valueSize, section, u128(operation), u128(endian));
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user