From: Guy Steele <[email-masked]>
Date: Wed, 20 May 92 18:03:53 EDT

Proposal for reduction instrinsics for HPF

Guy L. Steele Jr.
Thinking Machines Corporation
Version of May 20, 1992

Just as we have the correpondences:

	operator/intrinsic	reduction intrinsic

		+			SUM, COUNT
		*			PRODUCT
		.AND.			ALL
		.OR.			ANY
		MAX			MAXVAL
		MIN			MINVAL

it would be useful to have reduction versions of certain
other operators and intrinsics in the language that happenintrinsics-reduction-proposal, version 2
to be associative and commutative:

				    proposed
	operator/intrinsic	reduction intrinsic

		IAND			AND
		IOR			OR
		IEOR			EOR
		.NEQV.			PARITY

Thus

	AND( (/ 7,3,10 /) )  yields 2
	 OR( (/ 7,3,10 /) )  yields 15
	EOR( (/ 7,3,10 /) )  yields 14

      LOGICAL T,F
      PARAMETER (T = .TRUE., F = .FALSE. )      !just for conciseness

      PARITY( (/ T,F,F,T,T,F,F,F,T,T /) )  yields .TRUE.
      PARITY( (/ T,F,F,T,T,F,F,F,T,F /) )  yields .FALSE.

Some of these are particularly valuable if corresponding
parallel-prefix intrinsics are also defined (see separate proposal).