xo-pyexpression: experiment: try moving xo intrinsics into xo-jit
This commit is contained in:
parent
2a4b9a4360
commit
1f02ec02ef
2 changed files with 33 additions and 0 deletions
13
include/xo/jit/intrinsics.hpp
Normal file
13
include/xo/jit/intrinsics.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/** @file intrinsics.hpp
|
||||
*
|
||||
* Author: Roland Conybeare
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
extern "C" int32_t mul_i32(int32_t x, int32_t y);
|
||||
extern "C" double mul_f64(double x, double y);
|
||||
|
||||
/** end intrinsics.hpp **/
|
||||
20
src/jit/intrinsics.cpp
Normal file
20
src/jit/intrinsics.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* @file intrinsics.cpp */
|
||||
|
||||
#include "intrinsics.hpp"
|
||||
|
||||
/* FIXME: don't know how to mangle symbols yet,
|
||||
* so putting functions invoked from jit into global namespace
|
||||
*/
|
||||
extern "C"
|
||||
int32_t
|
||||
mul_i32(int32_t x, int32_t y) {
|
||||
return x * y;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
double
|
||||
mul_f64(double x, double y) {
|
||||
return x * y;
|
||||
}
|
||||
|
||||
/* end intrinsics.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue