Merge remote-tracking branch 'origin/YaSp' into jit 03/15103/1
Antoine ELIAS [Tue, 26 Aug 2014 13:43:29 +0000 (15:43 +0200)]
Conflicts:
scilab/modules/ast/ast.vcxproj.filters
scilab/modules/ast/includes/operations/types_substraction.hxx

Change-Id: I1be80c297e22dff47c1c6f1bc670c90b31d9634d

1  2 
scilab/modules/ast/Makefile.am
scilab/modules/ast/Makefile.in
scilab/modules/ast/ast.vcxproj
scilab/modules/ast/ast.vcxproj.filters
scilab/modules/ast/includes/jit/jit_operations.hxx
scilab/modules/ast/src/cpp/jit/GlobalCFunctions.cpp

Simple merge
Simple merge
Simple merge
@@@ -1,4 -1,4 +1,4 @@@
--<?xml version="1.0" encoding="utf-8"?>
++<?xml version="1.0" encoding="utf-8"?>
  <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup>
      <Library Include="..\..\bin\blasplus.lib" />
      <ClInclude Include="includes\types\overload.hxx">
        <Filter>Header Files\types</Filter>
      </ClInclude>
 +    <ClInclude Include="includes\jit\ScilabJITTraits.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\JITVisitor.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\JITValues.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\jit_operations.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\analysis\AnalysisVisitor.hxx">
 +      <Filter>Header Files\analysis</Filter>
 +    </ClInclude>
+     <ClInclude Include="includes\operations\types_opposite.hxx">
+       <Filter>Header Files\operations</Filter>
+     </ClInclude>
+     <ClInclude Include="includes\operations\types_subtraction.hxx">
+       <Filter>Header Files\operations</Filter>
+     </ClInclude>
+     <ClInclude Include="includes\operations\matrix_subtraction.h">
+       <Filter>Header Files\operations</Filter>
+     </ClInclude>
    </ItemGroup>
    <ItemGroup>
      <ClCompile Include="src\cpp\ast\debugvisitor.cpp">
      <ClCompile Include="src\cpp\types\callable.cpp">
        <Filter>Source Files\types</Filter>
      </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITValues.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITVisitor.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\GlobalCFunctions.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\types\internal.cpp">
 +      <Filter>Source Files\types</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\jit_operations.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
+     <ClCompile Include="src\cpp\operations\types_opposite.cpp">
+       <Filter>Source Files\operations</Filter>
+     </ClCompile>
+     <ClCompile Include="src\cpp\operations\types_subtraction.cpp">
+       <Filter>Source Files\operations</Filter>
+     </ClCompile>
+     <ClCompile Include="src\c\operations\matrix_subtraction.c">
+       <Filter>Source Files\operations</Filter>
+     </ClCompile>
    </ItemGroup>
  </Project>
index a5de15e,0000000..c13bdc1
mode 100644,000000..100644
--- /dev/null
@@@ -1,67 -1,0 +1,67 @@@
 +/*
 + *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 + *  Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET
 + *
 + *  This file must be used under the terms of the CeCILL.
 + *  This source file is licensed as described in the file COPYING, which
 + *  you should have received as part of this distribution.  The terms
 + *  are also available at
 + *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 + *
 + */
 +
 +#ifndef __JIT_OPERATIONS_HXX__
 +#define __JIT_OPERATIONS_HXX__
 +
 +#include "JITValues.hxx"
 +#include "types_addition.hxx"
- #include "types_substraction.hxx"
++#include "types_subtraction.hxx"
 +#include "types_multiplication.hxx"
 +
 +namespace jit
 +{
 +template<typename, typename>
 +inline static llvm::Value * add(llvm::Value * L, llvm::Value * R, llvm::IRBuilder<> & builder);
 +
 +template<typename, typename>
 +inline static llvm::Value * sub(llvm::Value * L, llvm::Value * R, llvm::IRBuilder<> & builder);
 +
 +template<typename, typename>
 +inline static llvm::Value * dotmul(llvm::Value * L, llvm::Value * R, llvm::IRBuilder<> & builder);
 +
 +template<typename T>
 +inline static llvm::Value * add(llvm::Value * L, llvm::Value * R, llvm::IRBuilder<> & builder)
 +{
 +    return std::is_integral<T>::value ? builder.CreateAdd(L, R) : builder.CreateFAdd(L, R);
 +}
 +
 +template<typename T>
 +inline static llvm::Value * sub(llvm::Value * L, llvm::Value * R, llvm::IRBuilder<> & builder)
 +{
 +    return std::is_integral<T>::value ? builder.CreateSub(L, R) : builder.CreateFSub(L, R);
 +}
 +
 +template<typename T>
 +inline static llvm::Value * dotmul(llvm::Value * L, llvm::Value * R, llvm::IRBuilder<> & builder)
 +{
 +    return std::is_integral<T>::value ? builder.CreateMul(L, R) : builder.CreateFMul(L, R);
 +}
 +
 +class JITVisitor;
 +typedef std::shared_ptr<JITVal> (*add_function)(std::shared_ptr<JITVal> &, std::shared_ptr<JITVal> &, JITVisitor &);
 +static add_function pAddfunction[types::InternalType::IdLast][types::InternalType::IdLast];
 +
 +/*template<typename>
 +  inline static JITVal add(JITVal & L, JITVal & R, JITVisitor & visitor);*/
 +
 +std::shared_ptr<JITVal> add_D_D(std::shared_ptr<JITVal> & L, std::shared_ptr<JITVal> & R, JITVisitor & visitor);
 +std::shared_ptr<JITVal> sub_D_D(std::shared_ptr<JITVal> & L, std::shared_ptr<JITVal> & R, JITVisitor & visitor);
 +std::shared_ptr<JITVal> dotmul_D_D(std::shared_ptr<JITVal> & L, std::shared_ptr<JITVal> & R, JITVisitor & visitor);
 +
 +std::shared_ptr<JITVal> add_M_M(std::shared_ptr<JITVal> & L, std::shared_ptr<JITVal> & R, JITVisitor & visitor);
 +std::shared_ptr<JITVal> sub_M_M(std::shared_ptr<JITVal> & L, std::shared_ptr<JITVal> & R, JITVisitor & visitor);
 +std::shared_ptr<JITVal> dotmul_M_M(std::shared_ptr<JITVal> & L, std::shared_ptr<JITVal> & R, JITVisitor & visitor);
 +
 +}
 +
 +#endif // __JIT_OPERATIONS_HXX__
index ee057b6,0000000..c71f120
mode 100644,000000..100644
--- /dev/null
@@@ -1,48 -1,0 +1,48 @@@
 +/*
 + *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 + *  Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET
 + *
 + *  This file must be used under the terms of the CeCILL.
 + *  This source file is licensed as described in the file COPYING, which
 + *  you should have received as part of this distribution.  The terms
 + *  are also available at
 + *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 + *
 + */
 +
 +#include "allexp.hxx"
 +#include "allvar.hxx"
 +
 +#include "ScilabJITTraits.hxx"
 +#include "types_addition.hxx"
- #include "types_substraction.hxx"
++#include "types_subtraction.hxx"
 +#include "types_multiplication.hxx"
 +#include "dynlib_ast.h"
 +
 +extern "C"
 +{
 +    EXTERN_AST void putInContext_S_D_d(symbol::Context * ctxt, symbol::Variable * var, double x)
 +    {
 +        jit::putInContext_S<Double, double>(ctxt, var, x);
 +    }
 +
 +    EXTERN_AST void putInContext_M_D_ds(symbol::Context * ctxt, symbol::Variable * var, double * x, int r, int c)
 +    {
 +        jit::putInContext_M<Double, double>(ctxt, var, x, r, c);
 +    }
 +
 +    EXTERN_AST void add_M_M_d_d(double * l, long long size, double * r, double * o)
 +    {
 +        add<double, double>(l, size, r, o);
 +    }
 +
 +    EXTERN_AST void sub_M_M_d_d(double * l, long long size, double * r, double * o)
 +    {
 +        sub<double, double>(l, size, r, o);
 +    }
 +
 +    EXTERN_AST void dotmul_M_M_d_d(double * l, long long size, double * r, double * o)
 +    {
 +        dotmul<double, double>(l, size, r, o);
 +    }
 +}