| PLEX86 | ||
|
Linux without the GNU toolchain 5106Linux without the GNU toolchain 5107 On Thu, 13 Oct 2005 20:24:53 +0200, Peter T. Breuer But what else would you need to... Peter T. Breuer I do not know about strcmp(), but in the distant past, I rewrote strncpy() because I had to do many copys of long strings (8192 bytes) that were not necessarily word aligned an DEC PDP-11-45 machines. So I made it copy the first 1, 2, or 3 bytes by byte copying, then did word copies for most of the strings, and then copied the last 0, 1, 2, or 3 bytes if there were any. Since I needed to do this a lot, the change was worth it back then. Machine had no hardware string copy instruction. I do not know the current implimentation or the current useage patterns, so perhaps the code actually does this now. Alternatively, if such copies are not done much (my guess is that they are not), the overhead of that local optimization may be such that it does not pay off to have it as the standard function anyway. I do not know the instruction set of the Intel *86 machines (though I used to know their 8086 (I think it was) and they may have a hardware instruction to copy strings. They might have one to compare strings (but IMAO, it would be stupid to have one of those in hardware). I used to work in a department where they designed microprocessors and the rest of us wrote compilers and optimizers. The hardware guys always wanted to put in new fancy instructions that we found made no sense and our compiler did not generate them and the optimizer did not use them either. Usually they gobbled up 3 integer registers and this spoiled register allocation and resulted in slower end for programs using the special instructions. In every case I can remember, the hardware types would have been better off to use the chip area for more cache and not wasted it for silly instructions. -- .~. Jean-David Beyer Registered Linux User 85642. V PGP-Key: 9A2FC99A Registered Machine 241939. ^^-^^ 08:00:00 up 5 days, 6:21, 3 users, load average: 4.34, 4.21, 4.12
|
||||
Linux without the GNU toolchain 5107 Linux groups from Newsgroups The #1 Usenet Provider on the Internet
|
||||