Add wasm tacle-bench targets
This commit is contained in:
@ -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 */
|
||||
@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user