diff options
author | Zack Rusin <[email protected]> | 2007-11-02 12:05:00 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2007-11-02 12:05:00 -0400 |
commit | e0e91e7ceb50f0e23311788559a8547dd24c7a80 (patch) | |
tree | 5598bb6fd54024d7ea3d302d786c1b55a27a510f /src/mesa/pipe/llvm/gallivm_builtins.cpp | |
parent | 5c7bfb06e087ce4162590359ad75d1fca98f3549 (diff) |
Implement scs opcode
Diffstat (limited to 'src/mesa/pipe/llvm/gallivm_builtins.cpp')
-rw-r--r-- | src/mesa/pipe/llvm/gallivm_builtins.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mesa/pipe/llvm/gallivm_builtins.cpp b/src/mesa/pipe/llvm/gallivm_builtins.cpp index b23af915505..b06629265a6 100644 --- a/src/mesa/pipe/llvm/gallivm_builtins.cpp +++ b/src/mesa/pipe/llvm/gallivm_builtins.cpp @@ -114,6 +114,18 @@ Function* func_cosf = new Function( /*Name=*/"cosf", mod); // (external, no body) func_cosf->setCallingConv(CallingConv::C); +Function* func_scs = new Function( + /*Type=*/FuncTy_5, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"scs", mod); +func_scs->setCallingConv(CallingConv::C); + +Function* func_sinf = new Function( + /*Type=*/FuncTy_12, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"sinf", mod); // (external, no body) +func_sinf->setCallingConv(CallingConv::C); + // Global Variable Declarations @@ -394,6 +406,28 @@ gvar_array__str1->setInitializer(const_array_14); } +// Function: scs (func_scs) +{ + Function::arg_iterator args = func_scs->arg_begin(); + Value* packed_val_55 = args++; + packed_val_55->setName("val"); + + BasicBlock* label_entry_56 = new BasicBlock("entry",func_scs,0); + + // Block entry (label_entry_56) + ExtractElementInst* float_tmp2 = new ExtractElementInst(packed_val_55, const_int32_18, "tmp2", label_entry_56); + CallInst* float_call_57 = new CallInst(func_cosf, float_tmp2, "call", label_entry_56); + float_call_57->setCallingConv(CallingConv::C); + float_call_57->setTailCall(true); + InsertElementInst* packed_tmp5 = new InsertElementInst(const_packed_34, float_call_57, const_int32_18, "tmp5", label_entry_56); + CallInst* float_call7 = new CallInst(func_sinf, float_tmp2, "call7", label_entry_56); + float_call7->setCallingConv(CallingConv::C); + float_call7->setTailCall(true); + InsertElementInst* packed_tmp9 = new InsertElementInst(packed_tmp5, float_call7, const_int32_22, "tmp9", label_entry_56); + new ReturnInst(packed_tmp9, label_entry_56); + +} + return mod; } |