From 73b37ee6325261509b90e63b1aee895a1a28f282 Mon Sep 17 00:00:00 2001 From: "mdevan.foobar" Date: Sun, 25 Jul 2010 09:19:21 +0000 Subject: [PATCH] Fix fadd,fsub,fmul (Aaron S Lav) git-svn-id: http://llvm-py.googlecode.com/svn/trunk@87 8d1e9007-1d4e-0410-b67e-1979fd6579aa --- llvm/_core.c | 10 ++++++++-- test/testall.py | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/llvm/_core.c b/llvm/_core.c index 13e088f..5f04bdc 100644 --- a/llvm/_core.c +++ b/llvm/_core.c @@ -1285,8 +1285,11 @@ static PyMethodDef core_methods[] = { _method( LLVMConstNeg ) _method( LLVMConstNot ) _method( LLVMConstAdd ) - _method( LLVMConstSub ) + _method( LLVMConstFAdd ) + _method( LLVMConstSub ) + _method( LLVMConstFSub ) _method( LLVMConstMul ) + _method( LLVMConstFMul ) _method( LLVMConstUDiv ) _method( LLVMConstSDiv ) _method( LLVMConstFDiv ) @@ -1440,8 +1443,11 @@ static PyMethodDef core_methods[] = { /* Arithmetic */ _method( LLVMBuildAdd ) - _method( LLVMBuildSub ) + _method( LLVMBuildFAdd) + _method( LLVMBuildSub ) + _method( LLVMBuildFSub) _method( LLVMBuildMul ) + _method( LLVMBuildFMul) _method( LLVMBuildUDiv ) _method( LLVMBuildSDiv ) _method( LLVMBuildFDiv ) diff --git a/test/testall.py b/test/testall.py index 177e40d..653f852 100755 --- a/test/testall.py +++ b/test/testall.py @@ -206,6 +206,7 @@ def do_constant(): k.neg().not_().add(k).sub(k).mul(k).udiv(k).sdiv(k).urem(k) k.srem(k).and_(k).or_(k).xor(k).icmp(IPRED_ULT, k) f.fdiv(f).frem(f).fcmp(RPRED_ULT, f) + f.fadd(f).fmul(f).fsub(f) vi = Constant.vector([Constant.int(ti,42)]*10) vf = Constant.vector([Constant.real(Type.float(), 3.14)]*10) k.shl(k).lshr(k).ashr(k) @@ -415,8 +416,11 @@ def do_builder(): fv = Constant.real(Type.float(), "1.0") k = Constant.int(ti, 10) b.add(v, v) + b.fadd(fv, fv) b.sub(v, v) + b.fsub(fv, fv) b.mul(v, v) + b.fmul(fv, fv) b.udiv(v, v) b.sdiv(v, v) b.fdiv(fv, fv)