File: simd-dispatch

package info (click to toggle)
wtdbg2 2.5-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 119,728 kB
  • sloc: ansic: 27,655; perl: 1,212; makefile: 125; sh: 83
file content (20 lines) | stat: -rwxr-xr-x 452 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

PKG=wtdbg2
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BASE=$(realpath ${DIR}/../lib/$PKG/$(basename "$0"))

function test_and_run () {
	if grep -q "$1" /proc/cpuinfo && [ -x "${BASE}-$1" ]; then
		cmd="${BASE}-$1"
		shift
		# echo "${cmd}" "$@"
		"${cmd}" "$@"
		exit
	fi
}

for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 sse mmx ; do test_and_run ${SIMD} "$@" ; done

# fallback to plain option
$BASE-plain "$@"