Skip to content

Instantly share code, notes, and snippets.

View psiha's full-sized avatar

Domagoj Šarić psiha

  • Zagreb, Croatia
  • 22:07 (UTC +02:00)
  • LinkedIn in/psiha
View GitHub Profile
@psiha
psiha / gist:1646185
Created January 20, 2012 08:47
nt2::sinecosine<small> msvc10 codegen
static inline A0_n sincosa(const A0_n a0_n, A0& c, const regular&)
{
063FA193 push ebp
063FA194 mov ebp,esp
063FA196 and esp,0FFFFFFF0h
063FA199 sub esp,68h
const A0 a0 = { a0_n };
const A0 x = nt2::abs(a0);
A0 xr = Nan<A0>(), xc;
063FA19C movdqa xmm1,xmmword ptr ds:[0648BD50h]
@psiha
psiha / gist:1647026
Created January 20, 2012 11:55
nt2::sinecosine<small> msvc10 codegen
static inline A0_n sincosa(const A0_n a0_n, A0& c, const regular&)
{
063F9EF3 push ebp
063F9EF4 mov ebp,esp
063F9EF6 and esp,0FFFFFFF0h
063F9EF9 sub esp,68h
const A0 a0 = { a0_n };
const A0 x = nt2::abs(a0);
A0 xr = Nan<A0>(), xc;
063F9EFC movdqa xmm1,xmmword ptr ds:[0648AD50h]
@psiha
psiha / gist:3873141
Created October 11, 2012 15:15
GCC 4.6 ICE workarounds
namespace boost
{
template <typename T> struct remove_reference;
template <> struct remove_reference<float const &> { typedef float const type; };
template <> struct remove_reference<float &> { typedef float type; };
template <> struct remove_reference< int const &> { typedef int const type; };
template <> struct remove_reference< int &> { typedef int type; };
template <> struct remove_reference<unsigned int const &> { typedef unsigned int const type; };
template <> struct remove_reference<unsigned int &> { typedef unsigned int type; };
@psiha
psiha / gist:3879115
Created October 12, 2012 13:08
error@crosscompiling
2>ClCompile:
2> gather_includes.cpp
2>xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
2>gather_includes.obj : error LNK2019: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXABVexception@std@@@Z) referenced in function "void __cdecl boost::exception_detail::throw_exception_<class std::runtime_error>(class std::runtime_error const &,char const *,char const *,int)" (??$throw_exception_@Vruntime_error@std@@@exception_detail@boost@@YAXABVruntime_error@std@@PBD1H@Z)
gather_includes.exe : fatal error LNK1120: 1 unresolved externals
@psiha
psiha / gist:3974720
Created October 29, 2012 16:38
signnz
000242d8 <boost::simd::ext::implement<boost::simd::tag::signnz_ (boost::dispatch::meta::simd_<boost::dispatch::meta::floating_<boost::simd::native<float, boost::simd::tag::simd_emulation_<16u>, void> >, boost::simd::tag::simd_emulation_<16u> >), boost::dispatch::tag::cpu_, void>::operator()(boost::simd::native<float, boost::simd::tag::simd_emulation_<16u>, void> const&) const>:
_ZNK5boost4simd3ext9implementIFNS0_3tag7signnz_ENS_8dispatch4meta5simd_INS6_9floating_INS0_6nativeIfNS3_15simd_emulation_ILj16EEEvEEEESB_EEENS5_3tag4cpu_EvEclERKSC_():
242d8: e92d41f0 push {r4, r5, r6, r7, r8, lr}
242dc: e24dd090 sub sp, sp, #144 ; 0x90
242e0: e92d4000 push {lr}
242e4: fa001e6c blx 2bc9c <__gnu_mcount_nc>
242e8: e1a05000 mov r5, r0
242ec: e1a01002 mov r1, r2
242f0: e28d0050 add r0, sp, #80 ; 0x50
242f4: e1a04002 mov r4, r2
@psiha
psiha / gist:4001645
Created November 2, 2012 14:21
blunder
namespace ext
{
BOOST_SIMD_FUNCTOR_IMPLEMENTATION( boost::simd::tag::minus_, boost::simd::tag::simd_emulation_<16>
, (A0)
, ((simd_<arithmetic_<A0>,boost::simd::tag::cpu_>))
((simd_<arithmetic_<A0>,boost::simd::tag::cpu_>))
)
{
typedef A0 result_type;
@psiha
psiha / gist:4038628
Created November 8, 2012 12:52
signnz#2
0001d348 <boost::simd::ext::implement<boost::simd::tag::signnz_ (boost::dispatch::meta::simd_<boost::dispatch::meta::floating_<boost::simd::native<float, boost::simd::tag::simd_emulation_<16u>, void> >, boost::simd::tag::simd_emulation_<16u> >), boost::dispatch::tag::cpu_, void>::operator()(boost::simd::native<float, boost::simd::tag::simd_emulation_<16u>, void> const&) const>:
1d348: e92d49f0 push {r4, r5, r6, r7, r8, fp, lr}
1d34c: e28db018 add fp, sp, #24
1d350: e24dd01c sub sp, sp, #28
1d354: e92d4000 push {lr}
1d358: fa000479 blx 1e544 <__gnu_mcount_nc>
1d35c: e24dd060 sub sp, sp, #96 ; 0x60
1d360: e1a05002 mov r5, r2
1d364: e28d4017 add r4, sp, #23
1d368: e1a08000 mov r8, r0
@psiha
psiha / gist:4038653
Created November 8, 2012 12:59
signnz#3
00019448 <boost::simd::ext::implement<boost::simd::tag::signnz_ (boost::dispatch::meta::simd_<boost::dispatch::meta::floating_<boost::simd::native<float, boost::simd::tag::simd_emulation_<16u>, void> >, boost::simd::tag::simd_emulation_<16u> >), boost::dispatch::tag::cpu_, void>::operator()(boost::simd::native<float, boost::simd::tag::simd_emulation_<16u>, void> const&) const>:
19448: e92d49f8 push {r3, r4, r5, r6, r7, r8, fp, lr}
1944c: e28db01c add fp, sp, #28
19450: e92d4000 push {lr}
19454: fa0010d6 blx 1d7b4 <__gnu_mcount_nc>
19458: e24dd060 sub sp, sp, #96 ; 0x60
1945c: e28d500f add r5, sp, #15
19460: e1a04000 mov r4, r0
19464: e3c5500f bic r5, r5, #15
19468: e1a06002 mov r6, r2
@psiha
psiha / gist:4038666
Created November 8, 2012 13:01
random gcc vectorizer output
boost\simd\operator\include/boost/simd/toolbox/operator/functions/simd/common/preprocessed/map.hpp:1: note: not vectorized: control flow in loop.
boost\simd\operator\include/boost/simd/toolbox/operator/functions/simd/common/preprocessed/map.hpp:1: note: not vectorized: data ref analysis failed D.596589_502 = MEM[(const type &)D.596576_495];
boost\simd\operator\include/boost/simd/toolbox/operator/functions/simd/common/preprocessed/map.hpp:1: note: not vectorized: data ref analysis failed D.596525_477 = MEM[(const type &)D.596504_466];
boost\simd\operator\include/boost/simd/toolbox/operator/functions/simd/common/preprocessed/map.hpp:1: note: not vectorized: control flow in loop.
boost\simd\operator\include/boost/simd/toolbox/operator/functions/simd/common/preprocessed/map.hpp:1: note: not vectorized: unexpected loop form.
boost\simd\operator\include/boost/simd/toolbox/operator/functions/simd/common/preprocessed/map.hpp:1: note: not vectorized: control flow in loop.
boost\simd\operator\include/boost/simd/toolbox
@psiha
psiha / gist:4058473
Created November 12, 2012 10:08
kernel_atan
0001dce0 <nt2::details::internal::invtrig_base<boost::simd::native<float, boost::simd::tag::simd_emulation_<16u>, void>, nt2::radian_tag, mpl_::bool_<true>, float>::kernel_atan(float __vector(4))>:
1dce0: e92d 03f0 stmdb sp!, {r4, r5, r6, r7, r8, r9}
1dce4: ed2d 8b04 vpush {d8-d9}
1dce8: b090 sub sp, #64 ; 0x40
1dcea: af00 add r7, sp, #0
1dcec: b500 push {lr}
1dcee: f00a fd91 bl 28814 <__gnu_mcount_nc>
1dcf2: b0c4 sub sp, #272 ; 0x110
1dcf4: ffc0 6610 vmov.i32 d22, #-2147483648 ; 0x80000000
1dcf8: f10d 040f add.w r4, sp, #15