diff options
author | Zack Rusin <[email protected]> | 2007-11-02 12:09:23 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2007-11-02 12:09:23 -0400 |
commit | a2debc2704b9126d92d947c0407a0fbd709ab932 (patch) | |
tree | e5a9996a5474e568c781fdc07e0afd767092f823 /src/mesa/pipe/llvm/gallivm_builtins.cpp | |
parent | e0e91e7ceb50f0e23311788559a8547dd24c7a80 (diff) |
Implement sin opcode.
Seems to have similar rounding border problems as cos.
Diffstat (limited to 'src/mesa/pipe/llvm/gallivm_builtins.cpp')
-rw-r--r-- | src/mesa/pipe/llvm/gallivm_builtins.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mesa/pipe/llvm/gallivm_builtins.cpp b/src/mesa/pipe/llvm/gallivm_builtins.cpp index b06629265a6..da1e6ae1de4 100644 --- a/src/mesa/pipe/llvm/gallivm_builtins.cpp +++ b/src/mesa/pipe/llvm/gallivm_builtins.cpp @@ -126,6 +126,12 @@ Function* func_sinf = new Function( /*Name=*/"sinf", mod); // (external, no body) func_sinf->setCallingConv(CallingConv::C); +Function* func_vsin = new Function( + /*Type=*/FuncTy_5, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"vsin", mod); +func_vsin->setCallingConv(CallingConv::C); + // Global Variable Declarations @@ -428,6 +434,27 @@ gvar_array__str1->setInitializer(const_array_14); } +// Function: vsin (func_vsin) +{ + Function::arg_iterator args = func_vsin->arg_begin(); + Value* packed_val_59 = args++; + packed_val_59->setName("val"); + + BasicBlock* label_entry_60 = new BasicBlock("entry",func_vsin,0); + + // Block entry (label_entry_60) + ExtractElementInst* float_tmp2_61 = new ExtractElementInst(packed_val_59, const_int32_18, "tmp2", label_entry_60); + CallInst* float_call_62 = new CallInst(func_sinf, float_tmp2_61, "call", label_entry_60); + float_call_62->setCallingConv(CallingConv::C); + float_call_62->setTailCall(true); + InsertElementInst* packed_tmp6 = new InsertElementInst(const_packed_34, float_call_62, const_int32_18, "tmp6", label_entry_60); + InsertElementInst* packed_tmp9_63 = new InsertElementInst(packed_tmp6, float_call_62, const_int32_22, "tmp9", label_entry_60); + InsertElementInst* packed_tmp12_64 = new InsertElementInst(packed_tmp9_63, float_call_62, const_int32_24, "tmp12", label_entry_60); + InsertElementInst* packed_tmp15_65 = new InsertElementInst(packed_tmp12_64, float_call_62, const_int32_23, "tmp15", label_entry_60); + new ReturnInst(packed_tmp15_65, label_entry_60); + +} + return mod; } |