Thursday, May 28, 2009

White Tiger is Black...


One month back when I went to Crossword, just to feel fresh n happy. As I already told in my previous post library or book shops are my favorite place. And there is no other good place in Bangalore than Crossword. As soon as I entered there was bulk amount of one book only, lying everywhere, came under new arrival and also as Crossword recommended section. Why will not somebody recommend you the book, which has shortlisted for "Man Booker Prize". Yea I am talking about "The White Tiger", author Arvind Adiga.


And I got more anxious to read that too when my close friend bought that book. Final 2-3 days before I stole some time from my schedule and just yesterday I finished reading the novel. And I have only one sentence in review for this novel. And the sentence is: "What a ****** joke"

It is a story about Balram Halwai aka munna aka white Tigher aka Country Mouse aka Ashok Sharma born in a village, son of ricksaw puller. In his journey from working in Tea shop to Owner of Taxi Company having 26 Toyata Qualis, he started his life as servant ,then philosopher, then driver, then cook, then gardener, then murderer and then entrepreneur(as author says). He says all his story in seven night starting from Laxmangarh (berth place) to Bangalore (current location) to Wen Jiabao from Beijiing by writing a letter to him.

I really felt cheated after reading that book. I didn't like the concept at all. According to me author insulted India, it's culture, hindu gods and also at the same time he compared everything with China, what he wanted to show us I didn't get. Author pointed out all the problems we have in India. He even added corruption till president level...that's shame. I don't think for any kind of corruption/illegal work you have to go till president of India, our ministers are much capable for all those thing. Author shown how landlord in village behave with villagers or with their servants. He also told so many bad stuffs about Delhi, Gurgaon, it's hotels. Author did lots of research by going all those dark area in village and even dark side of Delhi kind of city. According to him all drives who work/drive car for rich people are highly dangerous, according to him, you should not trust a single driver in India. According to him, even if a good person become driver, the whole drive community will force him to convert into Bad one.


I feel nowadays everybody wants to gain fame or money by ripping off the band-aid of India. You write/show movie with all dirty stuff about India and you will become famous. It's upto you how much famous you want to see yourself, just show that deep India's bad stuff. And I request you Mr. Author don't tell a murderer an Entrepreneur, you are unknowingly increasing the Entrepreneur number in India I don't know by twice, thrice or 10 or 100 times from actual Entrepreneur number. Even I am thinking all actual Entrepreneur are now looking for new English word. And dear Mr. Author I do accept there are lot many problems in India, things should change but for all these good things, people should educate, they should read first. According to me even novel is a good source of knowledge, as I learned many things after I started reading novels but one thing is for sure Mr. Author this book is worst and I learned nothing from this . Your novel forced me to write a proper review on it. I will never ever recommend this book to anybody.


And one more thing Mr. Author, we Hindus have 36,000,000 gods, you know why? Because we count/treat every kind of species in this world as GODs, and one way or other almost all kind of creature in this world has it's own role in nature and we worship nature, it's not that Human has copyright to be treated as GOD.

Thursday, May 21, 2009

SSE2 Vs SSSE3

As you already know that I am a bit busy with learning intel SIMD like mmx, sse2 , ssse3 etc stuff. I am enjoying SIMD and playing with all these MMX, SSE versions.While working with SSSE3 after sse2 or sse3, I thought what is the advantage of SSSE3 over SSE2? Some people even ask me why there is not a dramatic change in performance after adding SSSE3. I knew the answer but thought to do some more R&D on it.

And here is my view....

I will start with some brief intro of SSE versions and also as I am in video field I will talk about integer operations only that will be my primary concern as of now.

SSE2 instructions are an extension of the SIMD introduced with the MMX technology and the SSE extensions.The key benefits of SSE2 are that both MMX ans SSE2 instructions can work on 8 XMM (128-bit, XMM0- XMM7) register along with the MMX registers (mm0-mm7), and that SSE instructions now support 64-bit floating-point values. So there was huge change between MMX and SSE2(or SSE). Now because of XMM registers instead of playing with 8 bytes, we can play 16 bytes simultaneously. So improving the performance just by double from the MMX assembly or 16 times from the C code. There are some instructions we are missing in MMX assembly which are present in SSE2 like paddsb/w, movapd,movupd, pshufw/d ,pavgb/w etc, which are very much helpful here in video compression.

While SSSE3 (Supplemental Streaming SIMD Extension 3) is an extension of SSE3 or I should say revision of SSE3. In SSE3(13 new instructions) the most notable change is the capability to work horizontally in a register, as opposed to the more or less strictly vertical operation of all previous SSE instructions. There are instructions to add and subtract the multiple values stored within a single register have been added. But note those are not for Integer operations only floating point, that's why I am talking about SSSE3.

SSSE3 contains 16 new discrete instructions over SSE3. Each can act on 64-bit MMX or 128-bit XMM registers. Therefore, Intel's manuals has 32 new instructions.The instructions are PSIGNB/W/D, PABSB/W/D, PALIGNR, PSHUFB, PMULHRSW, PMADDUBSW, PHSUBW/D, PHSUBSW, PHADDW/D and PHADDSW.So if you these, the processing block or registers are same as SSE2, no new registers.

By using SSSE3 the only advantage in video compression side integer operations is horizontally processing. So by SSSE3 we can add/subtract the data within the registers instead of adding or subtracting with other registers. So I feel SSSE3 only removes some overheads and save some cycles by using horizontal operations if your video code is having that kind of module like SAD, SSD and all, but there are be many places where transition from MMX to SSE2 gives huge improvement in performance but transition from SSE2 to SSSE3 may not give you even noticeable change. Even there will be lots of functions where SSSE3 will not be required over SSE2 in code. As to work vertically (between two registers) we sometimes do some data manipulations by padding 0's or by shuffling data between registers, and then process the data like addition/multiplication etc., those shuffling or padding are overheads that can be avoided here in SSSE3.

I guess we should not think that each next generation of SIMD will just magically double the performance of the code same like MMX to SSE/SSE2. Function module (like DCT, SAD etc.) and data fetching to those functions matters a lot to decide which SIMD we should use .... SSE2 or SSSE3 for better performance. So before converting any new code from SSE2 to SSSE3, just stop for a moment, have a close look on the module and then choose SSE2 Vs SSSE3.

Enjoy SIMD optimization.