Add codegen for one of the triangle variants

This commit is contained in:
Magnus Norddahl 2016-11-12 00:50:21 +01:00
commit c852b6c5e9
18 changed files with 739 additions and 38 deletions

View file

@ -44,6 +44,11 @@ llvm::Type *SSABool::llvm_type()
return llvm::Type::getInt1Ty(SSAScope::context());
}
SSAInt SSABool::zext_int()
{
return SSAInt::from_llvm(SSAScope::builder().CreateZExt(v, SSAInt::llvm_type(), SSAScope::hint()));
}
SSABool operator&&(const SSABool &a, const SSABool &b)
{
return SSABool::from_llvm(SSAScope::builder().CreateAnd(a.v, b.v, SSAScope::hint()));