🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #52

Re: Pairwise dot product

#52
From: Paul Rubin
Date: Fri, 09 Oct 2026 22:33
20 lines
2200 bytes
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
> You mean AVX "p"arrallel instructions rather than "s"calar

Yes, maybe I had too narrow a view of what AVX does.  I thought of it
mostly as a vector extension, per its name.

> But given that the stride can be anything, vectorizing V* is not
> profitable, so gcc does not do it.  One could special-case unit stride
> to get at least that case vectorized, but the benchmark I used does
> not use unit stride.

Maybe it would also benefit at stride=2 or (especially in single
precision) stride=4.  I didn't realize stride!=1 was commonly used for
dot-product-like operations.

> You can call the BLAS routine DDOT of libopenblas or some other
> well-optimized BLAS library and probably get close to optimal code.

Yes, even better, if there's a suitable FFI.  Next thing after that
would be CUDA...
Technical Details
Message-ID: <87cxti33o8.fsf@nightsong.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <2026Oct8.175513@mips.complang.tuwien.ac.at> <87ld882afn.fsf@nightsong.com> <2026Oct9.002856@mips.complang.tuwien.ac.at> <87h5iv36p4.fsf@nightsong.com> <2026Oct9.083242@mips.complang.tuwien.ac.at>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Paul Rubin <no.email@nospam.invalid>
Newsgroups: comp.lang.forth
Subject: Re: Pairwise dot product
Date: Fri, 09 Oct 2026 15:33:11 -0700
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <87cxti33o8.fsf@nightsong.com>
References: <2026Oct8.175513@mips.complang.tuwien.ac.at>
	<87ld882afn.fsf@nightsong.com>
	<2026Oct9.002856@mips.complang.tuwien.ac.at>
	<87h5iv36p4.fsf@nightsong.com>
	<2026Oct9.083242@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 09 Oct 2026 22:33:12 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1292555"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+8GtxeXrsZesGCeg1HZsDR"; posting-host="4636a4ab62d7fdb18152433dfec605f8"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:ubk98xc3HXzCmo9GGtdGARQjVMQ=
	sha1:+gU/bvOBNk2q748t1H6re7bszR4= sha256:lB1JaEqZTPNlqh6/SJ38Q8O7H3k+k/Uijkfvv8DoMsk=
	sha1:Iu/SlWblnVZUQJg4j2VjP6vhURk= sha256:36orsufez1GCE/0WP+jR8ZarBhoIjiSNcZurjXkjxos=