You can subscribe to this list here.
2000 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}
(390) 
_{Aug}
(767) 
_{Sep}
(940) 
_{Oct}
(964) 
_{Nov}
(819) 
_{Dec}
(762) 

2001 
_{Jan}
(680) 
_{Feb}
(1075) 
_{Mar}
(954) 
_{Apr}
(595) 
_{May}
(725) 
_{Jun}
(868) 
_{Jul}
(678) 
_{Aug}
(785) 
_{Sep}
(410) 
_{Oct}
(395) 
_{Nov}
(374) 
_{Dec}
(419) 
2002 
_{Jan}
(699) 
_{Feb}
(501) 
_{Mar}
(311) 
_{Apr}
(334) 
_{May}
(501) 
_{Jun}
(507) 
_{Jul}
(441) 
_{Aug}
(395) 
_{Sep}
(540) 
_{Oct}
(416) 
_{Nov}
(369) 
_{Dec}
(373) 
2003 
_{Jan}
(514) 
_{Feb}
(488) 
_{Mar}
(396) 
_{Apr}
(624) 
_{May}
(590) 
_{Jun}
(562) 
_{Jul}
(546) 
_{Aug}
(463) 
_{Sep}
(389) 
_{Oct}
(399) 
_{Nov}
(333) 
_{Dec}
(449) 
2004 
_{Jan}
(317) 
_{Feb}
(395) 
_{Mar}
(136) 
_{Apr}
(338) 
_{May}
(488) 
_{Jun}
(306) 
_{Jul}
(266) 
_{Aug}
(424) 
_{Sep}
(502) 
_{Oct}
(170) 
_{Nov}
(170) 
_{Dec}
(134) 
2005 
_{Jan}
(249) 
_{Feb}
(109) 
_{Mar}
(119) 
_{Apr}
(282) 
_{May}
(82) 
_{Jun}
(113) 
_{Jul}
(56) 
_{Aug}
(160) 
_{Sep}
(89) 
_{Oct}
(98) 
_{Nov}
(237) 
_{Dec}
(297) 
2006 
_{Jan}
(151) 
_{Feb}
(250) 
_{Mar}
(222) 
_{Apr}
(147) 
_{May}
(266) 
_{Jun}
(313) 
_{Jul}
(367) 
_{Aug}
(135) 
_{Sep}
(108) 
_{Oct}
(110) 
_{Nov}
(220) 
_{Dec}
(47) 
2007 
_{Jan}
(133) 
_{Feb}
(144) 
_{Mar}
(247) 
_{Apr}
(191) 
_{May}
(191) 
_{Jun}
(171) 
_{Jul}
(160) 
_{Aug}
(51) 
_{Sep}
(125) 
_{Oct}
(115) 
_{Nov}
(78) 
_{Dec}
(67) 
2008 
_{Jan}
(165) 
_{Feb}
(37) 
_{Mar}
(130) 
_{Apr}
(111) 
_{May}
(91) 
_{Jun}
(142) 
_{Jul}
(54) 
_{Aug}
(104) 
_{Sep}
(89) 
_{Oct}
(87) 
_{Nov}
(44) 
_{Dec}
(54) 
2009 
_{Jan}
(283) 
_{Feb}
(113) 
_{Mar}
(154) 
_{Apr}
(395) 
_{May}
(62) 
_{Jun}
(48) 
_{Jul}
(52) 
_{Aug}
(54) 
_{Sep}
(131) 
_{Oct}
(29) 
_{Nov}
(32) 
_{Dec}
(37) 
2010 
_{Jan}
(34) 
_{Feb}
(36) 
_{Mar}
(40) 
_{Apr}
(23) 
_{May}
(38) 
_{Jun}
(34) 
_{Jul}
(36) 
_{Aug}
(27) 
_{Sep}
(9) 
_{Oct}
(18) 
_{Nov}
(25) 
_{Dec}

2011 
_{Jan}
(1) 
_{Feb}
(14) 
_{Mar}
(1) 
_{Apr}
(5) 
_{May}
(1) 
_{Jun}

_{Jul}

_{Aug}
(37) 
_{Sep}
(6) 
_{Oct}
(2) 
_{Nov}

_{Dec}

2012 
_{Jan}

_{Feb}
(7) 
_{Mar}

_{Apr}
(4) 
_{May}

_{Jun}
(3) 
_{Jul}

_{Aug}

_{Sep}
(1) 
_{Oct}

_{Nov}

_{Dec}
(10) 
2013 
_{Jan}

_{Feb}
(1) 
_{Mar}
(7) 
_{Apr}
(2) 
_{May}

_{Jun}

_{Jul}
(9) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

2014 
_{Jan}
(14) 
_{Feb}

_{Mar}
(2) 
_{Apr}

_{May}
(10) 
_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}
(3) 
_{Dec}

S  M  T  W  T  F  S 

1
(8) 
2
(6) 
3
(22) 
4
(3) 
5
(15) 
6
(9) 
7
(4) 
8
(9) 
9
(14) 
10
(23) 
11
(29) 
12
(3) 
13

14

15

16

17

18
(9) 
19

20

21

22

23

24

25

26

27

28

29

30

31





From: Glenn Fiedler <gaffer@ga...>  20090301 09:12:53

garrrrr! i hate coding in gmail :) union FloatInt { unsigned int i; float f; }; FloatInt x, y, z; x.f = n.x; y.f = n.y; z.f = n.z; x.i &= 0x7FFFFFFF; y.i &= 0x7FFFFFFF; z.i &= 0x7FFFFFFF; return (x.i > y.i) ? (x.i > z.i) ? 0 : 2 : (y.i > z.i) ? 1 : 2; cheers On Sun, Mar 1, 2009 at 1:10 AM, Glenn Fiedler <gaffer@...> wrote: > if you would like this on GCC with O2 or greater, you'll need to use > unions instead of aliasing pointers, like this: > union FloatInt > { > unsigned int i; > float f; > }; > > FloatInt nx, ny, nz; > x.f = n.x; > y.f = n.y; > z.f = n.z; > return (x.i > y.i) ? (x.i > z.i) ? 0 : 2 : (y.i > z.i) ? 1 : 2; > > just fyi, you are going to have very VERY difficult optimizer bugs to track > down otherwise  and yes, unions are the only way to guarantee that GCC > generates the correct code in this case > > cheers > > > I did some profiling on MSVC 2009, and integer methods are ~10% >> > faster: >> > unsigned int x = 0x7FFFFFFF & *(unsigned int *)&n.x; >> > unsigned int y = 0x7FFFFFFF & *(unsigned int *)&n.y; >> > unsigned int z = 0x7FFFFFFF & *(unsigned int *)&n.z; >> > >> > return (x > y) ? (x > z) ? 0 : 2 : (y > z) ? 1 : 2; >> > >> > For some odd reason only when using integers can it simplify the >> > two inner >> > ternary methods using bit 'magic'. If we use floats or use SSE the >> > integermethods are about ~5% faster because this compiler generates >> > a bunch of >> > jumps. The method above (as well as mine) generates 1 jump. >> > >> > I actually eliminated all jumps but since I use one too many >> > registers it >> > slows it down. I think the CPU is smart enough to look ahead if you >> > get down >> > to one conditional ..so yeah I think if you use the stack it can >> > slow things >> > down slightly but you do see a gain if you use integers. I assume >> > conditional jumps would be the best way, assuming the compiler can >> > do it >> > depth first because you need 3 conditionals  the inner two, and >> > then a >> > conditional move on the results of those two >> > >> > Asm: >> > >> > >> > ; _n$ = edx >> > >> > ; 61 : unsigned int x = 0x7FFFFFFF & *(unsigned int *)&n.x; >> > >> > mov eax, DWORD PTR [edx] >> > >> > ; 62 : unsigned int y = 0x7FFFFFFF & *(unsigned int *)&n.y; >> > >> > mov ecx, DWORD PTR [edx+4] >> > >> > ; 63 : unsigned int z = 0x7FFFFFFF & *(unsigned int *)&n.z; >> > >> > mov edx, DWORD PTR [edx+8] >> > and eax, 2147483647 ; 7fffffffH >> > and ecx, 2147483647 ; 7fffffffH >> > and edx, 2147483647 ; 7fffffffH >> > >> > ; 69 : return (x > y) ? (x > z) ? 0 : 2 : (y > z) ? 1 : 2; >> > >> > cmp eax, ecx >> > jbe SHORT $LN3@... >> > cmp edx, eax >> > sbb eax, eax >> > and eax, 2 ; fffffffeH >> > add eax, 2 >> > >> > ; 70 : } >> > >> > ret 0 >> > $LN3@...: >> > >> > ; 69 : return (x > y) ? (x > z) ? 0 : 2 : (y > z) ? 1 : 2; >> > >> > cmp edx, ecx >> > sbb eax, eax >> > add eax, 2 >> > >> > ; 70 : } >> > >> > ret >> > >> >> >>  >> Open Source Business Conference (OSBC), March 2425, 2009, San Francisco, >> CA >> OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> Strategies to boost innovation and cut costs with open source >> participation >> Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> GDAlgorithmslist mailing list >> GDAlgorithmslist@... >> https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist >> > > 
From: Glenn Fiedler <gaffer@ga...>  20090301 09:10:47

if you would like this on GCC with O2 or greater, you'll need to use unions instead of aliasing pointers, like this: union FloatInt { unsigned int i; float f; }; FloatInt nx, ny, nz; x.f = n.x; y.f = n.y; z.f = n.z; return (x.i > y.i) ? (x.i > z.i) ? 0 : 2 : (y.i > z.i) ? 1 : 2; just fyi, you are going to have very VERY difficult optimizer bugs to track down otherwise  and yes, unions are the only way to guarantee that GCC generates the correct code in this case cheers > I did some profiling on MSVC 2009, and integer methods are ~10% > > faster: > > unsigned int x = 0x7FFFFFFF & *(unsigned int *)&n.x; > > unsigned int y = 0x7FFFFFFF & *(unsigned int *)&n.y; > > unsigned int z = 0x7FFFFFFF & *(unsigned int *)&n.z; > > > > return (x > y) ? (x > z) ? 0 : 2 : (y > z) ? 1 : 2; > > > > For some odd reason only when using integers can it simplify the > > two inner > > ternary methods using bit 'magic'. If we use floats or use SSE the > > integermethods are about ~5% faster because this compiler generates > > a bunch of > > jumps. The method above (as well as mine) generates 1 jump. > > > > I actually eliminated all jumps but since I use one too many > > registers it > > slows it down. I think the CPU is smart enough to look ahead if you > > get down > > to one conditional ..so yeah I think if you use the stack it can > > slow things > > down slightly but you do see a gain if you use integers. I assume > > conditional jumps would be the best way, assuming the compiler can > > do it > > depth first because you need 3 conditionals  the inner two, and > > then a > > conditional move on the results of those two > > > > Asm: > > > > > > ; _n$ = edx > > > > ; 61 : unsigned int x = 0x7FFFFFFF & *(unsigned int *)&n.x; > > > > mov eax, DWORD PTR [edx] > > > > ; 62 : unsigned int y = 0x7FFFFFFF & *(unsigned int *)&n.y; > > > > mov ecx, DWORD PTR [edx+4] > > > > ; 63 : unsigned int z = 0x7FFFFFFF & *(unsigned int *)&n.z; > > > > mov edx, DWORD PTR [edx+8] > > and eax, 2147483647 ; 7fffffffH > > and ecx, 2147483647 ; 7fffffffH > > and edx, 2147483647 ; 7fffffffH > > > > ; 69 : return (x > y) ? (x > z) ? 0 : 2 : (y > z) ? 1 : 2; > > > > cmp eax, ecx > > jbe SHORT $LN3@... > > cmp edx, eax > > sbb eax, eax > > and eax, 2 ; fffffffeH > > add eax, 2 > > > > ; 70 : } > > > > ret 0 > > $LN3@...: > > > > ; 69 : return (x > y) ? (x > z) ? 0 : 2 : (y > z) ? 1 : 2; > > > > cmp edx, ecx > > sbb eax, eax > > add eax, 2 > > > > ; 70 : } > > > > ret > > > > >  > Open Source Business Conference (OSBC), March 2425, 2009, San Francisco, > CA > OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > Strategies to boost innovation and cut costs with open source > participation > Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > 
From: Sylvain G. Vignaud <vignsyl@ii...>  20090301 07:49:20

What's about something like: yx = SignBit(xy)>>31 // 1 if y > x yz = SignBit(zy)>>31 zx = SignBit(xz)>>31 zy = SignBit(yz)>>31 return (yx&yz)  ((zx&zy)<<1); 4 subs (int or float, doesn't matter), a few simple bit instructions, no jump (untested, just got back from a diner)?  Original Message  From: Matt J <mjohnson2005@...> Date: Saturday, February 28, 2009 6:17 pm Subject: Re: [Algorithms] How to get 3dvector largest coordinate index? To: Game Development Algorithms <gdalgorithmslist@...> > I did some profiling on MSVC 2009, and integer methods are ~10% > faster: > unsigned int x = 0x7FFFFFFF & *(unsigned int *)&n.x; > unsigned int y = 0x7FFFFFFF & *(unsigned int *)&n.y; > unsigned int z = 0x7FFFFFFF & *(unsigned int *)&n.z; > > return (x > y) ? (x > z) ? 0 : 2 : (y > z) ? 1 : 2; > > For some odd reason only when using integers can it simplify the > two inner > ternary methods using bit 'magic'. If we use floats or use SSE the > integermethods are about ~5% faster because this compiler generates > a bunch of > jumps. The method above (as well as mine) generates 1 jump. > > I actually eliminated all jumps but since I use one too many > registers it > slows it down. I think the CPU is smart enough to look ahead if you > get down > to one conditional ..so yeah I think if you use the stack it can > slow things > down slightly but you do see a gain if you use integers. I assume > conditional jumps would be the best way, assuming the compiler can > do it > depth first because you need 3 conditionals  the inner two, and > then a > conditional move on the results of those two > > Asm: > > > ; _n$ = edx > > ; 61 : unsigned int x = 0x7FFFFFFF & *(unsigned int *)&n.x; > > mov eax, DWORD PTR [edx] > > ; 62 : unsigned int y = 0x7FFFFFFF & *(unsigned int *)&n.y; > > mov ecx, DWORD PTR [edx+4] > > ; 63 : unsigned int z = 0x7FFFFFFF & *(unsigned int *)&n.z; > > mov edx, DWORD PTR [edx+8] > and eax, 2147483647 ; 7fffffffH > and ecx, 2147483647 ; 7fffffffH > and edx, 2147483647 ; 7fffffffH > > ; 69 : return (x > y) ? (x > z) ? 0 : 2 : (y > z) ? 1 : 2; > > cmp eax, ecx > jbe SHORT $LN3@... > cmp edx, eax > sbb eax, eax > and eax, 2 ; fffffffeH > add eax, 2 > > ; 70 : } > > ret 0 > $LN3@...: > > ; 69 : return (x > y) ? (x > z) ? 0 : 2 : (y > z) ? 1 : 2; > > cmp edx, ecx > sbb eax, eax > add eax, 2 > > ; 70 : } > > ret > 
From: Marc Hernandez <marcsh@gm...>  20090301 00:58:50

This problem felt a lot like you could somehow just do math on the conditionals and get the answer. The second best I could come up with is: (Course, conditional moves makes much of this moot, but on with the show) //I used 3 for values that can never happen for fun, always cool to go 1 past the end of an array //Replace with 0, 1, or 2 in shipping code, assert in debug static uint s_lookup[] = { /*000*/ 2, /*001*/ 2, /*010*/ 3, /*011*/ 0, /*100*/ 1, /*101*/ 3, /*110*/ 1, /*111*/ 0 } inline uint LargestCoordinate(const Vector3d &v) { uint first_bit = v.x > v.y; uint second_bit = (v.x > v.z) << 1; uint third_bit = (v.y > v.z) << 2; uint index = first_bit  second_bit  third_bit; return lookup[index]; } Then, I thought, I could just load a single uint, shift right by the index, then and off the low 2 bits: //Replace binary syntax with something to get around C's lack of syntax. (like http://cfaq.com/misc/sd28.html ) inline uint LargestCoordinate(const Vector3d &v) { uint val = 0b0001110100111010; uint rotate = (v.y > v.z) << 3  (v.x > v.z) << 2  (v.x > v.y) << 1; return ( val >> rotate ) & 0b11; } I found I needed to use the int trick also, otherwise the (float > float) statement generates a jump, blah. (Hire me!)  m h arc ernandez / these are the days of lethal perfection / 