Alex Meakins <
alex.m...@gmail.com> wrote:
So you have a CPU without branch prediction or a C compiler that cannot
emit code to use the "unlikely" macro?
Why should Cython optimize for 1970s' compilers and processors?
Sturla
> 1)); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred()))
> {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__;
> goto __pyx_L1_error;}
> __pyx_v_min_range = __pyx_t_5;
>
> max_range = intersection[2]
>
> if (unlikely(__pyx_v_intersection == Py_None)) {
> PyErr_SetString(PyExc_TypeError, "'NoneType' object is not
> subscriptable");
> {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno =
> __LINE__; goto __pyx_L1_error;}
> }
> __pyx_t_5 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_intersection,
> 2)); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred()))
> {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__;
> goto __pyx_L1_error;}
> __pyx_v_max_range = __pyx_t_5;
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "cython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
cython-users...@googlegroups.com.
> For more options, visit <a
> href="
https://groups.google.com/d/optout.">
https://groups.google.com/d/optout.</a>
>
> ------=_Part_925_18764450.1403368937296
> Content-Type: text/html; charset=UTF-8
> Content-Transfer-Encoding: quoted-printable
>
> <div dir=3D"ltr">T be more specific, I would like to be able to ask the com=
> piler to produce:<br><br><div style=3D"margin-left:40px">intersection =3D s=
> elf.world_box.full_intersection(ray)<br><br><div style=3D"margin-left:40px"=
>> &nbsp; __pyx_t_1 =3D ((struct __pyx_vtabstruct_7raysect_4core_12accelerati=
> on_11boundingbox_BoundingBox *)__pyx_v_self-&gt;world_box-&gt;__pyx_vtab)-&=
> gt;full_intersection(__pyx_v_self-&gt;world_box, __pyx_v_ray, 0); if (unlik=
> ely(!__pyx_t_1)) {__pyx_filename =3D __pyx_f[0]; __pyx_lineno =3D 90; __pyx=
> _clineno =3D __LINE__; goto __pyx_L1_error;}<br>&nbsp; __Pyx_GOTREF(__pyx_t=
> _1);<br>&nbsp; __pyx_v_intersection =3D ((PyObject*)__pyx_t_1);<br>&nbsp; _=
> _pyx_t_1 =3D 0;<br></div><br>&nbsp;hit =3D intersection[0]<br><br><div styl=
> e=3D"margin-left:40px">&nbsp; __pyx_v_hit =3D __Pyx_PyObject_IsTrue(PyTuple=
> _GET_ITEM(__pyx_v_intersection, 0));<br></div><br>min_range =3D intersectio=
> n[1]<br><br><div style=3D"margin-left:40px">&nbsp; __pyx_v_min_range =3D __=
> pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_intersection, 1));<br></div><=
>> &nbsp;max_range =3D intersection[2]<br><br><div style=3D"margin-left:40p=
> x">&nbsp; __pyx_v_max_range =3D __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__p=
> yx_v_intersection, 2));<br></div></div><br><p>rather than:</p><p><br></p><d=
> iv style=3D"margin-left:40px">intersection =3D self.world_box.full_intersec=
> tion(ray)<br><br><div style=3D"margin-left:40px">&nbsp; __pyx_t_1 =3D ((str=
> uct __pyx_vtabstruct_7raysect_4core_12acceleration_11boundingbox_BoundingBo=
> x *)__pyx_v_self-&gt;world_box-&gt;__pyx_vtab)-&gt;full_intersection(__pyx_=
> v_self-&gt;world_box, __pyx_v_ray, 0); if (unlikely(!__pyx_t_1)) {__pyx_fil=
> ename =3D __pyx_f[0]; __pyx_lineno =3D 90; __pyx_clineno =3D __LINE__; goto=
> __pyx_L1_error;}<br>&nbsp; __Pyx_GOTREF(__pyx_t_1);<br>&nbsp; __pyx_v_inte=
> rsection =3D ((PyObject*)__pyx_t_1);<br>&nbsp; __pyx_t_1 =3D 0;<br></div><b=
>> &nbsp;hit =3D intersection[0]<br><br><div style=3D"margin-left:40px">&nbs=
> p; if (unlikely(__pyx_v_intersection =3D=3D Py_None)) {<br>&nbsp;&nbsp;&nbs=
> p; PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable=
> ");<br>&nbsp;&nbsp;&nbsp; {__pyx_filename =3D __pyx_f[0]; __pyx_lineno =3D =
> 91; __pyx_clineno =3D __LINE__; goto __pyx_L1_error;}<br>&nbsp; }<br>&nbsp;=
> __pyx_t_4 =3D __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_v_intersection,=
> 0)); if (unlikely(__pyx_t_4 &lt; 0)) {__pyx_filename =3D __pyx_f[0]; __pyx=
> _lineno =3D 91; __pyx_clineno =3D __LINE__; goto __pyx_L1_error;}<br>&nbsp;=
> __pyx_v_hit =3D __pyx_t_4;<br></div><br>min_range =3D intersection[1]<br><=
>> <div style=3D"margin-left:40px">&nbsp; if (unlikely(__pyx_v_intersection=
> =3D=3D Py_None)) {<br>&nbsp;&nbsp;&nbsp; PyErr_SetString(PyExc_TypeError, =
> "'NoneType' object is not subscriptable");<br>&nbsp;&nbsp;&nbsp; {__pyx_fil=
> ename =3D __pyx_f[0]; __pyx_lineno =3D 92; __pyx_clineno =3D __LINE__; goto=
> __pyx_L1_error;}<br>&nbsp; }<br>&nbsp; __pyx_t_5 =3D __pyx_PyFloat_AsDoubl=
> e(PyTuple_GET_ITEM(__pyx_v_intersection, 1)); if (unlikely((__pyx_t_5 =3D=
> =3D (double)-1) &amp;&amp; PyErr_Occurred())) {__pyx_filename =3D __pyx_f[0=
> ]; __pyx_lineno =3D 92; __pyx_clineno =3D __LINE__; goto __pyx_L1_error;}<b=
>> &nbsp; __pyx_v_min_range =3D __pyx_t_5;<br></div><br>&nbsp;max_range =3D =
> intersection[2]<br><br><div style=3D"margin-left:40px">&nbsp; if (unlikely(=
> __pyx_v_intersection =3D=3D Py_None)) {<br>&nbsp;&nbsp;&nbsp; PyErr_SetStri=
> ng(PyExc_TypeError, "'NoneType' object is not subscriptable");<br>&nbsp;&nb=
> sp;&nbsp; {__pyx_filename =3D __pyx_f[0]; __pyx_lineno =3D 93; __pyx_clinen=
> o =3D __LINE__; goto __pyx_L1_error;}<br>&nbsp; }<br>&nbsp; __pyx_t_5 =3D _=
> _pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_intersection, 2)); if (unlik=
> ely((__pyx_t_5 =3D=3D (double)-1) &amp;&amp; PyErr_Occurred())) {__pyx_file=
> name =3D __pyx_f[0]; __pyx_lineno =3D 93; __pyx_clineno =3D __LINE__; goto =
> __pyx_L1_error;}<br>&nbsp; __pyx_v_max_range =3D __pyx_t_5;<br></div></div>=
> <p></p></div>
>
> <p></p>
>
> -- <br />
> <br />
> --- <br />
> You received this message because you are subscribed to the Google Groups &=
> quot;cython-users&quot; group.<br />
> To unsubscribe from this group and stop receiving emails from it, send an e=
> mail to <a href=3D"mailto:
cython-users...@googlegroups.com">cython=
> -
users+un...@googlegroups.com</a>.<br />
> For more options, visit <a href=3D"
https://groups.google.com/d/optout">http=
> s://
groups.google.com/d/optout</a>.<br />
>
> ------=_Part_925_18764450.1403368937296--