Skip to content

Instantly share code, notes, and snippets.

View mgaunard's full-sized avatar

Mathias Gaunard mgaunard

  • Crypto startup
  • London
View GitHub Profile
@mgaunard
mgaunard / native.patch
Created August 19, 2011 15:44
native patch
@@ -10,22 +10,61 @@
#define BOOST_SIMD_SDK_SIMD_NATIVE_HPP_INCLUDED
#include <boost/utility/enable_if.hpp>
#include <boost/dispatch/meta/fusion.hpp>
#include <boost/simd/sdk/simd/category.hpp>
#include <boost/simd/sdk/memory/overload.hpp>
+#include <boost/dispatch/attributes.hpp>
#include <boost/dispatch/error/static_assert.hpp>
#include <boost/simd/sdk/simd/meta/is_vectorizable.hpp>
@mgaunard
mgaunard / gist:1216838
Created September 14, 2011 15:14
SSE division by zero
#include <xmmintrin.h>
#include <stdio.h>
int main()
{
__m128 v = _mm_div_ps(_mm_setzero_ps(), _mm_setzero_ps());
float result;
_mm_store_ss(&result, v);
printf("%f\n", result);
@mgaunard
mgaunard / gist:4001714
Created November 2, 2012 14:33 — forked from psiha/gist:4001645
blunder
namespace boost { namespace simd { namespace ext
{
BOOST_SIMD_FUNCTOR_IMPLEMENTATION( boost::simd::tag::minus_, boost::simd::tag::cpu_
, (A0)
, ((simd_<arithmetic_<A0>, boost::simd::tag::simd_emulation_<16> >))
((simd_<arithmetic_<A0>, boost::simd::tag::simd_emulation_<16> >))
)
{
typedef A0 result_type;
mal indenté
NT2_FUNCTOR_IMPLEMENTATION( nt2::tag::ratfracder_, tag::cpu_
, (A0)(N0)(A1)(N1)
, ((node_<A0, nt2::tag::ratfracder_, N0, nt2::container::domain>))
((node_<A1, nt2::tag::tie_ , N1, nt2::container::domain>))
)
bien indenté
@mgaunard
mgaunard / gist:4945591
Last active December 13, 2015 17:09
custom indentation style
f( a
, b
c
);
Auto-indent with BSD style will give
f( a
, b
c
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_VERSION 5.1)
SET(CMAKE_SYSTEM_PROCESSOR i686)
SET(CMAKE_C_COMPILER /usr/bin/i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/i686-w64-mingw32-g++)
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32/)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
cat<<END;
Some string
literal
END
@mgaunard
mgaunard / gist:5685444
Last active December 17, 2015 22:58 — forked from anonymous/gist:5685297
//==============================================================================
// Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//==============================================================================
#define NT2_UNIT_MODULE "nt2 arithmetic toolbox - abs/simd Mode"
//==============================================================================
// Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//==============================================================================
#ifndef BOOST_SIMD_SDK_SIMD_PACK_DOMAIN_HPP_INCLUDED
#define BOOST_SIMD_SDK_SIMD_PACK_DOMAIN_HPP_INCLUDED
template<class T, class X>
struct soa_proxy
{
BOOST_FORCEINLINE soa_proxy(native<T, X>& data_, std::size_t index_) : data(data_), index(index_)
{
}
BOOST_FORCEINLINE soa_proxy& operator=(T const& other) const
{
typename dispatch::make_functor<tag::insert_, T>::type()(other, data, index);