MMX Comparison Instructions 62215

Recently, I just finish my implementation on MMX image constant
addition. During my implementation, there are several things under my
consideration.

I am processing my image row by row. If my image width is not 8 byte
boundary, says 34 bytes.

Hence, I will use the following MMX register
mm0 = x|x|x|x|x|x|x|x where x is the constant to be added

to perform addition for 4 times (32 byte)

For the remaining byte (34 byte - 32 byte = 2 byte), I will use the
following register
mm1 = 0|0|0|0|0|0|x|x

to perform the last addition in that particular row.

For result 35th to 40th byte, since 0 are added to them, they are
totally remain unchanged

However, when performing thresholding (Packed Compare for Equal/ Packed
Compare for Greater Than), things goes different.

Of course, I still for the first 34 byte, I still can perform PCMPEQB
or PCMPGTB for 4 times using
mm0 = x|x|x|x|x|x|x|x where x is the threshold to be compared.

However,  how about for the remaining byte which is not 8 byte
boundary. How can I ignore the 35th to 40th byte? Is there any way

source = 6|5|4|3|2|1|4|3

PCMPGTB

mm1   = ?|?|?|?|?|?|3|3

will result

source = 6|5|4|3|2|1|ff|0

Comparison is only done on the last two byte.

Is there any optimized way I can achieve that?

Thank you.

yccheok

0
spamtrap2 (1627)
6/8/2006 5:11:22 PM
comp.lang.asm.x86 4917 articles. 11 followers. Post Follow

0 Replies
299 Views

Similar Articles

[PageSpeed] 4
Reply:
Similar Artilces:

MMX register to SSE register #2
Hello, I need to move a value from a MMX to a SSE register. I found two options. The first one is using the instructions movq2dq %mm0, %xmm0. The second one is moving the value from %mm0 to memory and then from memory to %xmm0. For example: movq %mm0, -16(%rsp) movq -16(%rsp), %xmm0 The last one is generated by gcc. I was doing some test and movq2dq is significantly slower that the second option and I was wondering why, because then... what is the usefulness of the instruction? Any idea? Thank you much. _m256 <user@nospicedham.compgroups.net/> wrote: > >The last one i...

SIMPLE NUMBER COMPARISON
Hello gurus... I must have looked at this too long and something simple has stopped making sense. I am trying to compare 2 numbers to each to check if one is >= to the other, but the weirdest thing keeps happening. If the number is any more than 1 digit it does not work. For example, the script sees 12 as being smaller than 7 because (it seems) it's only comparing the first digit. Below is the function that is doing the checking. Any thoughts? Thanks all. <script language="javascript"> function checkTest() { var error_string = ""; if (window.document.f...

Technical Instruction Position
Sorry for the cross posting and I hope that I am not breaking any protocol... I am recruiting for a NY client that is seeking a Senior Technical Instructor to join their R&D organization. In this role, the Senior Technical Instructor will design and deliver courses for their 1,500-person R&D organization. These courses include tools, technologies, and methodologies used by the 10 different development groups. During slow periods you will be called on to provide high-end consulting services to the internal development groups. This client is a top-tier financial services firm that re...

x86 instruction size length
Does anyone have any links to documentation that provides details about the length of each instruction in assembly? I want to know why a particular instruction takes a specific number of bytes e.g why does movl %esi,%ebx takes 2 bytes. Any help would be greatly appreciated thanks RS On Thu, 6 Jan 2005 06:26:29 +0000 (UTC) "ronjon" <spamtrap@crayne.org> wrote: :Does anyone have any links to documentation that provides details about :the length of each instruction in assembly? The Intel programmers reference manuals, which can be downloaded from the Intel site, have this i...

MMX Assembler
I have this code in mmx assembler, but I don't know exactly how it works, it is something related with matrix (esi=row number). What does this means? mov ebx,[matrix] mov ebx,[ebx+esi*4] mov WORD PTR [ebx+ecx*2] Thank you!!! Carl "Carlos Focus" <focussupermolon@ono.com> writes: > I have this code in mmx assembler, but I don't know exactly how it works, it > is something related with matrix (esi=row number). What does this means? > > mov ebx,[matrix] > mov ebx,[ebx+esi*4] > mov WORD PTR [ebx+ecx*2] That's not MMX code. It's just ordinar...

Another MacBook Air comparison
Whole article: <http://www.appleinsider.com/articles/08/01/22/how_the_macbook_air_stacks_up _against_other_ultra_light_notebooks.html> Or to cut to the chase: <http://images.appleinsider.com/macbookair-compare-chart-080121.jpg> Seems Apple has done well with their trade offs though, of course, it depends on what is important to the user which is the better product. -- Teachers open the door but you must walk through it yourself. In article <C3BBA0F7.A3A85%CSMA@gallopinginsanity.com>, Snit <CSMA@gallopinginsanity.com> wrote: > Whole article: > <http:/...

mmx.exe as encountered a problem and as to close
Hi, since yesterday I have this message everytime I try to open Sql Server "Enterprise manager"; I reinstalled the outfit completely without success any solution thanks Fernand Fernand St-Georges wrote: > Hi, > since yesterday I have this message everytime I try to open Sql Server > "Enterprise manager"; I reinstalled the outfit completely without success > > any solution > > thanks > > Fernand If it's MMC.exe (not MMX.exe) then there's a couple of things to look at: 1) Can you start MMC.exe separately (through Start -> Run)?...

Histogram Comparison #2
Hi, I am trying to compare histograms of two indexed images. I load the images like this: img=imread('large.jpg'); templ=imread('template.jpg'); [img map_img]=rgb2ind(img,32); [templ map_templ]=rgb2ind(templ,32); pick_region = struct('x',0,'y',0,'Value',0); I=imhist(img,map_img); M=imhist(templ,map_img); My problem is that I`m not getting the results I am expecting since the color of bin number 12(for example) in I does not corespond to the color of bin number 12 in M. Is there any way to make sure that both histograms are spread accross the same colors...

Array and List comparison
I have question about the data-structures that we use commonly. I am a bit confused which to use on what situation (or which one will be better). What are advantageous and disadvantages of Arrays and Lists. please give some example we will use one over the other (like on operations searching, insertion, etc... on structures like sorted list, binary tree, etc... on memory considerations, efficiency of algorithm) Thank you for your help. Pavo Pavo said: > I have question about the data-structures that we use commonly. I am a > bit confused which to use on what situation (or which ...

Differentiate the numbers as either data or instructions
Hi, How is a processor able to differentiate the numbers as either data or instructions ? Thx in advans, Karthik Balaguru "karthikbalaguru" <karthikbalaguru79@gmail.com> wrote in message news:1192956657.375752.263790@t8g2000prg.googlegroups.com... > Hi, > > How is a processor able to differentiate the numbers as either data or > instructions ? > > Thx in advans, > Karthik Balaguru Some processors have separate data and instruction buses, and some protection mechanisms to generate exceptions, but other than that, it cant differentiate between the tw...

List Comparison
Dear experts, I want to compare two lists containing sublists and make out of them 3 result lists. The comparison applies to the first two elements of the sublists. list1 = {{1, aa, 565}, {1, bb, 566}, { 1, cc, 546}, {2, dd, 56}, {2, ff, 56}, {2, ss, 5}} list2 = {{1, aa, 34}, {1, bb, 66}, {1, cc, 5443}, {2, dd, 76}, {2, ff, 87}, {2, mm, 87}} Result ONE should be: If the FIRST element AND the SECOND elements of the sublists are equal, then prepend the THIRD elements from list2. result1={{1, aa, 565, 34}, {1, bb, 566, 66}, { 1, cc, 546, 5443}, {2, dd, 56, 76}, {2, ff...

Why, warning: comparison between signed and unsigned integer expressions?
Hello all experts. If I compile the following code (small example) I get "warning: comparison between signed and unsigned integer expressions". void test(void) { uint8_t a; uint32_t i; a = 10; for(i = 0; i < (a + 1); i++) { } } But the following code doesn't give that warning: void test(void) { uint8_t a; uint32_t i; a = 10; for(i = 0; i < (uint32_t)(a + 1); i++) { } } What is going on here? Why does the compiler think (a + 1) is signed? hi, On 05/29/2012 08:15 AM, Lox wrote: &...

What's Faster: Dual 233mhz Pentium MMX or Pentium II 233mhz
I have two old machines and wonder which one is faster, the dual processor Pentium 233 MMX or the single-cpu Pentium II 233mhz. -- Aaron Clausen mightymartianca@hotmail.com "AC" <mightymartianca@hotmail.com> wrote in message news:1cf4e973.0406241828.78736a93@posting.google.com... > I have two old machines and wonder which one is faster, the dual > processor Pentium 233 MMX or the single-cpu Pentium II 233mhz. > > -- > Aaron Clausen > mightymartianca@hotmail.com Depends what you are running, Apps and OS. Mike. --- Outgoing...

Learning MMX
Hi, I would like to get familiar with the x86 MMX extensions. For this purpose I'm looking for some (relatively simple) programming tasks (examples, university assignments...) in order to get some practical experience in this area. Any hints? Thank you. Chris ...

OK to use MMX registers as temporary storage?
Hi all, I'm coding a routine and I'm using all of the registers. I need to do a division which means I am going to have to free up EAX and EDX. Is it possible for me to simply MOVD them into the MMX registers without causing any problems? I am not doing any floating point math nor MMX operations in my routine. But I recall that MMX registers have to be dealt with carefully. Thanks. "A" <questioner_x@MUNGED.microcosmotalk.com> wrote in message news:4b01dadb$0$5083$9a6e19ea@unlimited.newshosting.com... > > Hi all, > > I'm coding ...

Dynamic Power Consumption Estimates/Comparison
Hi, I am currently comparing soft IP's for use in our next ASIC product. For the initial comparison, I will use power consumption estimates from the supplier (mW/MHz). The issue is that some vendors quote for 90nm, some 130nm and some of 180nm. Does anybody have a very rough rule of thumb for relative dynamic power consumption for different technologies. e.g. On average, 0.5mA/MHz @ 130nm => 4 * 0.5mA/MHz @ 180nm. Thanks for any comments. Steven On Oct 16, 10:54=A0am, moogyd <moo...@yahoo.co.uk> wrote: > Hi, > > I am currently comparing soft IP's for use in our...

Re: Comparison in IF clause #8 1551907
I think you should buy 2**0 of this bumper sticker... There are 10 types of people in the world. Those who understand binary, and those who don't. Paul Choate DDS Data Extraction (916) 654-2160 > -----Original Message----- > From: toby dunn [mailto:tobydunn@hotmail.com] > Sent: Tuesday, March 21, 2006 12:12 PM > To: Choate, Paul@DDS; SAS-L@LISTSERV.UGA.EDU > Subject: Re: Comparison in IF clause > > O you just have to love bit representation. I have a book that covers the > math....perhaps the original poster would benifit from it: "Write Great > Code Vo...

About MMX\SSE2 PSADBW instruction ?
Hi, i have try to optimize a simple loop like : for(uj = 0 ; uj < VEC_SIZE ; uj++) res+=abs(pvec1[uj]-pvec2[uj]); where pvec1 and 2 are char* with >=0 values i have write a function with inline assembly code which use psadbw, it seems to be slower than the C loop, but i don't know how explain it....and how correct it..... all advice are wellcome ... with i_size the number of SSE2 vector in pvec1 and 2 (ie VEC_SIZE/16) inline int sad_sse2(char* ps1, char* ps2, int i_size) { int res; int i_vector_size = i_size; __asm { mov eax, DWORD PTR [ps1] mov ebx, DWORD PTR [ps2]...

Array#uniq
I am confused about "Array#uniq". In http://groups.google.com/group/comp.lang.ruby/msg/e57b80fbcd61aaab it is described, that one has to redefine "eql?" and "hash", if one needs an own "Array#uniq" interpretation. I made tests with the result, that neither "eql?" nor "hash" is called. What went wrong here? >>>>> code >>>>> class String alias :org_hash :hash alias :org_eql? :eql? def hash puts 'String#hash called' self.org_hash end def eql?(other) puts 'String#e...

How to include a string into a regex comparison?
Hi, I don't get solving the following issue (sure it's easy but I cannot do= it): valid_content_type =3D "application/auth-policy+xml" received_content_type =3D "application/auth-policy+xml;charset=3DISO-8859-1= " received_content_type =3D~ /^application\/auth\-policy\+xml;?/ =3D> 0 received_content_type =3D~ /^#{received_content_type};?/ =3D> nil How to fix it? Thanks a lot. --=20 I=C3=B1aki Baz Castillo <ibc@aliax.net> 2009/7/31 I=C3=B1aki Baz Castillo <ibc@aliax.net>: > Hi, I don't get solving the following issue (sure it&...

Managing MMX registers
Hallo, can anyone help me managing data to and from the MMX registers? For example, how can I fill an MMX register with some bits of my choice or initialize a block of memory and then use this block (wich starting address and how do I set the lenght?) for reading and writing from and to the MMX registers. Can I have an example of this? If possible I would like to have it in Linux assembly syntax. Thank you. ...

MMX
Hi, I'm learning assembly programming and I need to make a simple task as soon as posible. The formulation task is: int countchr(char *str, char c); Count the occurences of c in str using MMX. I've alredy done the task in x86 but i have to do it in MMX and i don't know how to manage it. Here is the x86 code: section .text global countchr countchr: push ebp mov ebp, esp mov edx, [ebp+8] mov ecx, 0 lop1: mov al,[edx] test al,al jz fin cmp al, [ebp+12] jne no add ecx, 1 no: inc edx jmp lop1 fin: mov eax, ecx mov esp, ebp pop ebp ret ...

MMX questions.
Hi, I am new to asm. Currently I am using MMX to optimze some of my image processing codes. There is an operation needed but I don't know if there is a way to accomplish it. The operation is that I need to copy mm0 to mm2 only when their corresponding values in mm1(mask) is NOT zero. mm0 120 34 20 25 3 40 60 110 source mm1 ff 0 0 ff ff ff 0 ff mask mm2 22 33 15 123 4 55 98 120 mm3 120 33 15 25 3 40 98 110 desired output Any suggestion is appreciated. Thanks, Chi Jason Chi wrote: >...

Help:multiple comparison for Kruskal-Wallis Test
Dear all, Could anyone please kindly supply some code or procedure options for multiple comparison for KRUSKAL-WALLIS TEST(one -way nonparametric equivalent for ANOVA) after the H0 is rejected? Thank you very much If you wish to do pairwise comparisons, the easiest thing is to use where statements to select the particular pairs of groups to compare. For complex comparisons, I usually create indicator variables to use one at a time in npar1way. Of course, one needs to control for the type I error rate using a Bonferroni or Sidak correction. Paul R. Swank, Ph.D. Professor, Developmental Ped...

Computer Source Code for STUDY HALL
Computer Source Code for STUDY HALL - Computer-Assisted Instruction By Rev. Bill McGinnis, Director - LoveAllPeople.org HTML version of this message at http://www.loveallpeople.org/studyhallsourcecode.html This page provides the computer source code for the program STUDY HALL - CAI, version 4.0. Full details about Study Hall are found at http://studyhall-cai.com STUDY HALL is a system for developing and running Computer-Assisted Instruction. It is the least expensive, least complicated, most widely-usable way for you to create and use Computer-Assisted Instruction. STUDY HA...