Add wasm tacle-bench targets

This commit is contained in:
2026-06-12 20:06:22 +02:00
parent 30daa8a00c
commit 08c2e9c13d
1122 changed files with 520422 additions and 0 deletions

View File

@ -0,0 +1,83 @@
(module $rad2deg.wasm
(type (;0;) (func (param i32 i32)))
(type (;1;) (func))
(type (;2;) (func (result i32)))
(import "__pragma" "loopbound" (func $__pragma_loopbound (type 0)))
(func $__wasm_apply_data_relocs (type 1))
(func $rad2deg_main (type 1)
(local f32 f32)
i32.const 360
i32.const 360
call $__pragma_loopbound
i32.const 0
f32.load offset=1028
local.set 0
f32.const 0x0p+0 (;=0;)
local.set 1
loop ;; label = @1
local.get 1
f32.const 0x1.68p+7 (;=180;)
f32.mul
f32.const 0x1.91eb86p+1 (;=3.14;)
f32.div
local.get 0
f32.add
local.set 0
local.get 1
f32.const 0x1.1dcf4ep-6 (;=0.0174444;)
f32.add
local.tee 1
f32.const 0x1.91eb8ap+2 (;=6.28;)
f32.le
br_if 0 (;@1;)
end
i32.const 0
local.get 0
f32.store offset=1028
i32.const 0
local.get 1
f32.store offset=1024)
(func $__original_main (type 2) (result i32)
(local f32 i32)
i32.const 0
i32.const 0
i32.store offset=1028
i32.const 0
i32.const 0
i32.store offset=1024
call $rad2deg_main
block ;; label = @1
block ;; label = @2
i32.const 0
f32.load offset=1028
local.tee 0
f32.abs
f32.const 0x1p+31 (;=2.14748e+09;)
f32.lt
i32.eqz
br_if 0 (;@2;)
local.get 0
i32.trunc_f32_s
local.set 1
br 1 (;@1;)
end
i32.const -2147483648
local.set 1
end
i32.const -1
i32.const 0
local.get 1
i32.const 64620
i32.ne
select)
(table (;0;) 1 1 funcref)
(memory (;0;) 1)
(global $__stack_pointer (mut i32) (i32.const 5136))
(global (;1;) i32 (i32.const 1032))
(global (;2;) i32 (i32.const 5136))
(export "memory" (memory 0))
(export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs))
(export "entrypoint" (func $rad2deg_main))
(export "main" (func $__original_main))
(export "__data_end" (global 1))
(export "__heap_base" (global 2)))

View File

@ -0,0 +1,30 @@
/*
This program is part of the TACLeBench benchmark suite.
Version V 1.9
Name: pi
Author: unknown
Function: Header file for definition of pi
Source: MiBench
http://wwweb.eecs.umich.edu/mibench
Original name: basicmath_small
Changes: no major functional changes
License: this code is FREE with no restrictions
*/
#ifndef PI__H
#define PI__H
#ifndef PI
#define PI 3.14f
#endif
#endif /* PI__H */

View File

@ -0,0 +1,89 @@
/*
This program is part of the TACLeBench benchmark suite.
Version V 1.9
Name: rad2deg
Author: unknown
Function: rad2deg performs conversion of radiant to degree
Source: MiBench
http://wwweb.eecs.umich.edu/mibench
Original name: basicmath_small
Changes: no major functional changes
License: this code is FREE with no restrictions
*/
#include "pi.h"
// Wasm loop bounds
__attribute__((import_module("__pragma"), import_name("loopbound"))) extern void
__pragma_loopbound(unsigned int min_bound, unsigned int max_bound);
#define rad2deg(r) ((r) * 180 / PI)
/*
Forward declaration of functions
*/
void rad2deg_init(void);
__attribute__((noinline)) __attribute__((export_name("entrypoint"))) void
rad2deg_main(void);
int rad2deg_return(void);
__attribute__((noinline)) __attribute__((export_name("main"))) int main(void);
/*
Declaration of global variables
*/
float rad2deg_X, rad2deg_Y;
/*
Initialization function
*/
void
rad2deg_init(void) {
rad2deg_X = 0;
rad2deg_Y = 0;
}
/*
Return function
*/
int
rad2deg_return(void) {
int temp = rad2deg_Y;
if (temp == 64620)
return 0;
else
return -1;
}
/*
Main functions
*/
__attribute__((noinline)) __attribute__((export_name("entrypoint"))) void
rad2deg_main(void) {
__pragma_loopbound(360, 360);
for (rad2deg_X = 0.0f; rad2deg_X <= (2 * PI + 1e-6f);
rad2deg_X += (PI / 180))
rad2deg_Y += rad2deg(rad2deg_X);
}
__attribute__((noinline)) __attribute__((export_name("main"))) int
main(void) {
rad2deg_init();
rad2deg_main();
return rad2deg_return();
}

View File

@ -0,0 +1,30 @@
/*
This program is part of the TACLeBench benchmark suite.
Version V 1.9
Name: pi
Author: unknown
Function: Header file for definition of pi
Source: MiBench
http://wwweb.eecs.umich.edu/mibench
Original name: basicmath_small
Changes: no major functional changes
License: this code is FREE with no restrictions
*/
#ifndef PI__H
#define PI__H
#ifndef PI
#define PI 3.14f
#endif
#endif /* PI__H */

View File

@ -0,0 +1,97 @@
/*
This program is part of the TACLeBench benchmark suite.
Version V 1.9
Name: rad2deg
Author: unknown
Function: rad2deg performs conversion of radiant to degree
Source: MiBench
http://wwweb.eecs.umich.edu/mibench
Original name: basicmath_small
Changes: no major functional changes
License: this code is FREE with no restrictions
*/
#include "pi.h"
// Wasm loop bounds
__attribute__((import_module("__pragma"), import_name("loopbound"))) extern void
__pragma_loopbound(unsigned int min_bound, unsigned int max_bound);
#define rad2deg(r) ((r) * 180 / PI)
/*
Forward declaration of functions
*/
__attribute__((always_inline)) static inline void rad2deg_init(void);
__attribute__((noinline)) __attribute__((export_name("entrypoint")))
__attribute__((noinline)) __attribute__((export_name("entrypoint"))) void
rad2deg_main(void);
__attribute__((always_inline)) static inline int rad2deg_return(void);
__attribute__((noinline)) __attribute__((export_name("main")))
__attribute__((noinline)) __attribute__((export_name("main"))) int
main(void);
/*
Declaration of global variables
*/
float rad2deg_X, rad2deg_Y;
/*
Initialization function
*/
__attribute__((always_inline)) static inline void
rad2deg_init(void) {
rad2deg_X = 0;
rad2deg_Y = 0;
}
/*
Return function
*/
__attribute__((always_inline)) static inline int
rad2deg_return(void) {
int temp = rad2deg_Y;
if (temp == 64620)
return 0;
else
return -1;
}
/*
Main functions
*/
__attribute__((noinline)) __attribute__((export_name("entrypoint")))
__attribute__((noinline)) __attribute__((export_name("entrypoint"))) void
rad2deg_main(void) {
__pragma_loopbound(360, 360);
for (rad2deg_X = 0.0f; rad2deg_X <= (2 * PI + 1e-6f);
rad2deg_X += (PI / 180))
rad2deg_Y += rad2deg(rad2deg_X);
}
__attribute__((noinline)) __attribute__((export_name("main")))
__attribute__((noinline)) __attribute__((export_name("main"))) int
main(void) {
rad2deg_init();
rad2deg_main();
return rad2deg_return();
}