Xref: utzoo comp.lang.c:7070 comp.unix.wizards:6412 Path: utzoo!mnetor!uunet!hsi!aati!fish From: fish@aati.UUCP (William G. Fish) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Faster C Message-ID: <473@aati.UUCP> Date: 4 Feb 88 21:15:07 GMT Organization: Analysis & Technology, New London, CT Lines: 31 Keywords: 4.1bsd, performance, 11/750 I wish to make the following C code run as fast as possible under 4.1 BSD on a VAX 11/750. I've seen VAX instructions such as movc3 and cmpc3 make code run 10 to 50 times faster. Are there any CISC instructions that can be used in this case? scan(in, out, c, C, S) register short *in; register float *out; register c; int C, S; { register sample; register peak; register s; for (s = 0; s < S; s++, c += C) { out[s] = sample = in[c]; /* short to float conversion */ if (sample < 0) sample = -sample; /* absolute value */ if (peak < sample) peak = sample; /* peak detection */ } return peak; } -- Bill Fish Analysis & Technology 321 River Road 153 Williams Street Mystic, CT 06355 New London, CT 06320 (203) 536-3301 (evenings) (203) 444-7722 (days) (203) 536-0137 (2nd line) ihnp4!{hsi,rayssd}!aati!fish