-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change builtin types to counters. * Increment builtin counters. * Add `BuiltinStats` structure. * Fix stuff. * Fix stuff. * Fix stuff. * Fix stuff. * Fix benches.
- Loading branch information
1 parent
9c769ab
commit 7c70e71
Showing
41 changed files
with
683 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,32 @@ | ||
#include <stddef.h> | ||
#include <assert.h> | ||
#include <stdint.h> | ||
|
||
|
||
typedef struct factorial_return_values | ||
{ | ||
uint64_t range_check_counter; | ||
unsigned __int128 remaining_gas; | ||
struct { | ||
uint8_t discriminant; | ||
union { | ||
uint64_t ok[4]; | ||
struct { | ||
void* ptr; | ||
uint32_t len; | ||
uint32_t cap; | ||
} err; | ||
}; | ||
struct { | ||
void* ptr; | ||
uint32_t len; | ||
uint32_t cap; | ||
} err; | ||
} result; | ||
} factorial_return_values_t; | ||
|
||
|
||
static void run_bench(factorial_return_values_t*, void*, uint64_t) | ||
static void run_bench(factorial_return_values_t*, uint64_t) | ||
__attribute__((weakref("_mlir_ciface_factorial_2M::factorial_2M::main(f1)"))); | ||
|
||
|
||
int main() | ||
{ | ||
factorial_return_values_t return_values; | ||
|
||
run_bench(&return_values, NULL, 0); | ||
run_bench(&return_values, 0); | ||
assert(return_values.result.discriminant == 0); | ||
|
||
// discriminant 0 == Result::Ok | ||
// return value 0 == ok in hyperfine | ||
return return_values.result.discriminant; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,32 @@ | ||
#include <dlfcn.h> | ||
#include <stddef.h> | ||
#include <assert.h> | ||
#include <stdint.h> | ||
|
||
|
||
typedef struct fib_return_values | ||
{ | ||
uint64_t range_check_counter; | ||
unsigned __int128 remaining_gas; | ||
struct { | ||
uint8_t discriminant; | ||
union { | ||
uint64_t ok[4]; | ||
struct { | ||
void *ptr; | ||
uint32_t len; | ||
uint32_t cap; | ||
} err; | ||
}; | ||
struct { | ||
void *ptr; | ||
uint32_t len; | ||
uint32_t cap; | ||
} err; | ||
} result; | ||
} fib_return_values_t; | ||
|
||
|
||
static void run_bench(fib_return_values_t *, void *, uint64_t) | ||
static void run_bench(fib_return_values_t *, uint64_t) | ||
__attribute__((weakref("_mlir_ciface_fib_2M::fib_2M::main(f1)"))); | ||
|
||
|
||
int main() | ||
{ | ||
fib_return_values_t return_values; | ||
|
||
run_bench(&return_values, NULL, 0); | ||
run_bench(&return_values, 0); | ||
assert(return_values.result.discriminant == 0); | ||
|
||
// discriminant 0 == Result::Ok | ||
// return value 0 == ok in hyperfine | ||
return return_values.result.discriminant; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
#include <stddef.h> | ||
#include <assert.h> | ||
#include <stdint.h> | ||
|
||
|
||
typedef struct map_return_values | ||
{ | ||
uint64_t range_check_counter; | ||
unsigned __int128 remaining_gas; | ||
struct { | ||
uint8_t discriminant; | ||
union { | ||
uint64_t ok[4]; | ||
struct { | ||
void *ptr; | ||
uint32_t len; | ||
uint32_t cap; | ||
} err; | ||
}; | ||
struct { | ||
void *ptr; | ||
uint32_t len; | ||
uint32_t cap; | ||
} err; | ||
} result; | ||
} map_return_values_t; | ||
|
||
|
||
static void run_bench(map_return_values_t *, void *, uint64_t) | ||
static void run_bench(map_return_values_t *, uint64_t) | ||
__attribute__((weakref("_mlir_ciface_logistic_map::logistic_map::main(f2)"))); | ||
|
||
|
||
int main() | ||
{ | ||
map_return_values_t return_values; | ||
|
||
run_bench(&return_values, NULL, 0); | ||
run_bench(&return_values, 0); | ||
assert(return_values.result.discriminant == 0); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.