Hooked up LLVM wall drawers
This commit is contained in:
parent
afab45674b
commit
28bb5da181
9 changed files with 411 additions and 48 deletions
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#include "ssa_int.h"
|
||||
#include "ssa_float.h"
|
||||
#include "ssa_bool.h"
|
||||
#include "ssa_scope.h"
|
||||
#include "r_compiler/llvm_include.h"
|
||||
|
||||
|
|
@ -31,6 +32,16 @@ llvm::Type *SSAInt::llvm_type()
|
|||
return llvm::Type::getInt32Ty(SSAScope::context());
|
||||
}
|
||||
|
||||
SSAInt SSAInt::MIN(SSAInt a, SSAInt b)
|
||||
{
|
||||
return SSAInt::from_llvm(SSAScope::builder().CreateSelect((a < b).v, a.v, b.v, SSAScope::hint()));
|
||||
}
|
||||
|
||||
SSAInt SSAInt::MAX(SSAInt a, SSAInt b)
|
||||
{
|
||||
return SSAInt::from_llvm(SSAScope::builder().CreateSelect((a > b).v, a.v, b.v, SSAScope::hint()));
|
||||
}
|
||||
|
||||
SSAInt operator+(const SSAInt &a, const SSAInt &b)
|
||||
{
|
||||
return SSAInt::from_llvm(SSAScope::builder().CreateAdd(a.v, b.v, SSAScope::hint()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue