|
From: Paul M. <pa...@sa...> - 2004-09-08 03:45:40
|
I wrote: > > I don't think so, at least not in scalar pipelines (SIMD ones maybe). > > PaulM, what's the deal on ppc? > > There is no single instruction, but I believe it can be done in a few > integer instructions without branches using some tricks with the carry > bit (I'm sure x86 could do something similar). There are altivec > instructions for signed, unsigned and floating point min and max. Thinking about this a bit more, what I could do on PPC is to use a conditional trap instruction. PPC has instructions that compare a register with either a register or a constant and generate a trap if a specified condition is met (signed or unsigned <, <=, ==, >=, >, or !=). We would then need a SIGTRAP handler to handle the (uncommon) error case. Paul. |