1#!/bin/sh 2# Copyright 2019 Google LLC 3# 4# This source code is licensed under the BSD-style license found in the 5# LICENSE file in the root directory of this source tree. 6 7#################################### Scalar ################################### 8### Microkernels without unrolling 9tools/xngen src/f32-spmm/scalar.c.in -D MR=1 -D NR=1 -D UNROLL=1 -o src/f32-spmm/gen/1x1-minmax-scalar.c 10tools/xngen src/f32-spmm/scalar.c.in -D MR=2 -D NR=1 -D UNROLL=1 -o src/f32-spmm/gen/2x1-minmax-scalar.c 11tools/xngen src/f32-spmm/scalar.c.in -D MR=4 -D NR=1 -D UNROLL=1 -o src/f32-spmm/gen/4x1-minmax-scalar.c 12tools/xngen src/f32-spmm/scalar.c.in -D MR=8 -D NR=1 -D UNROLL=1 -o src/f32-spmm/gen/8x1-minmax-scalar.c 13tools/xngen src/f32-spmm/scalar.c.in -D MR=8 -D NR=2 -D UNROLL=1 -o src/f32-spmm/gen/8x2-minmax-scalar.c 14tools/xngen src/f32-spmm/scalar.c.in -D MR=8 -D NR=4 -D UNROLL=1 -o src/f32-spmm/gen/8x4-minmax-scalar.c 15### Microkernels with software pipelining 16tools/xngen src/f32-spmm/scalar-pipelined.c.in -D MR=1 -D NR=1 -o src/f32-spmm/gen/1x1-minmax-scalar-pipelined.c 17tools/xngen src/f32-spmm/scalar-pipelined.c.in -D MR=2 -D NR=1 -o src/f32-spmm/gen/2x1-minmax-scalar-pipelined.c 18tools/xngen src/f32-spmm/scalar-pipelined.c.in -D MR=4 -D NR=1 -o src/f32-spmm/gen/4x1-minmax-scalar-pipelined.c 19tools/xngen src/f32-spmm/scalar-pipelined.c.in -D MR=8 -D NR=1 -o src/f32-spmm/gen/8x1-minmax-scalar-pipelined.c 20 21################################### ARM NEON ################################## 22### Microkernels without unrolling 23tools/xngen src/f32-spmm/neon.c.in -D MR=4 -D NR=1 -D UNROLL=1 -D FMA=0 -o src/f32-spmm/gen/4x1-minmax-neon.c 24tools/xngen src/f32-spmm/neon.c.in -D MR=8 -D NR=1 -D UNROLL=1 -D FMA=0 -o src/f32-spmm/gen/8x1-minmax-neon.c 25tools/xngen src/f32-spmm/neon.c.in -D MR=12 -D NR=1 -D UNROLL=1 -D FMA=0 -o src/f32-spmm/gen/12x1-minmax-neon.c 26tools/xngen src/f32-spmm/neon.c.in -D MR=16 -D NR=1 -D UNROLL=1 -D FMA=0 -o src/f32-spmm/gen/16x1-minmax-neon.c 27tools/xngen src/f32-spmm/neon.c.in -D MR=32 -D NR=1 -D UNROLL=1 -D FMA=0 -o src/f32-spmm/gen/32x1-minmax-neon.c 28 29tools/xngen src/f32-spmm/neon.c.in -D MR=4 -D NR=1 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/4x1-minmax-neonfma.c 30tools/xngen src/f32-spmm/neon.c.in -D MR=8 -D NR=1 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/8x1-minmax-neonfma.c 31tools/xngen src/f32-spmm/neon.c.in -D MR=12 -D NR=1 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/12x1-minmax-neonfma.c 32tools/xngen src/f32-spmm/neon.c.in -D MR=16 -D NR=1 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/16x1-minmax-neonfma.c 33tools/xngen src/f32-spmm/neon.c.in -D MR=32 -D NR=1 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/32x1-minmax-neonfma.c 34 35### Microkernels with 2X unrolling 36tools/xngen src/f32-spmm/neon.c.in -D MR=4 -D NR=1 -D UNROLL=2 -D FMA=0 -o src/f32-spmm/gen/4x1-minmax-neon-x2.c 37tools/xngen src/f32-spmm/neon.c.in -D MR=8 -D NR=1 -D UNROLL=2 -D FMA=0 -o src/f32-spmm/gen/8x1-minmax-neon-x2.c 38tools/xngen src/f32-spmm/neon.c.in -D MR=16 -D NR=1 -D UNROLL=2 -D FMA=0 -o src/f32-spmm/gen/16x1-minmax-neon-x2.c 39tools/xngen src/f32-spmm/neon.c.in -D MR=32 -D NR=1 -D UNROLL=2 -D FMA=0 -o src/f32-spmm/gen/32x1-minmax-neon-x2.c 40 41tools/xngen src/f32-spmm/neon.c.in -D MR=4 -D NR=1 -D UNROLL=2 -D FMA=1 -o src/f32-spmm/gen/4x1-minmax-neonfma-x2.c 42tools/xngen src/f32-spmm/neon.c.in -D MR=8 -D NR=1 -D UNROLL=2 -D FMA=1 -o src/f32-spmm/gen/8x1-minmax-neonfma-x2.c 43tools/xngen src/f32-spmm/neon.c.in -D MR=16 -D NR=1 -D UNROLL=2 -D FMA=1 -o src/f32-spmm/gen/16x1-minmax-neonfma-x2.c 44tools/xngen src/f32-spmm/neon.c.in -D MR=32 -D NR=1 -D UNROLL=2 -D FMA=1 -o src/f32-spmm/gen/32x1-minmax-neonfma-x2.c 45 46### Microkernels for blocks of output channels 47tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=4 -D NR=2 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/4x2-minmax-neonfma.c 48tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=8 -D NR=2 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/8x2-minmax-neonfma.c 49tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=12 -D NR=2 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/12x2-minmax-neonfma.c 50tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=16 -D NR=2 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/16x2-minmax-neonfma.c 51tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=32 -D NR=2 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/32x2-minmax-neonfma.c 52tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=4 -D NR=4 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/4x4-minmax-neonfma.c 53tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=8 -D NR=4 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/8x4-minmax-neonfma.c 54tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=12 -D NR=4 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/12x4-minmax-neonfma.c 55tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=16 -D NR=4 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/16x4-minmax-neonfma.c 56tools/xngen src/f32-spmm/neon-blocked.c.in -D MR=32 -D NR=4 -D UNROLL=1 -D FMA=1 -o src/f32-spmm/gen/32x4-minmax-neonfma.c 57 58### Microkernels with software pipelining 59tools/xngen src/f32-spmm/neon-pipelined.c.in -D MR=4 -D NR=1 -D FMA=0 -o src/f32-spmm/gen/4x1-minmax-neon-pipelined.c 60tools/xngen src/f32-spmm/neon-pipelined.c.in -D MR=8 -D NR=1 -D FMA=0 -o src/f32-spmm/gen/8x1-minmax-neon-pipelined.c 61tools/xngen src/f32-spmm/neon-pipelined.c.in -D MR=16 -D NR=1 -D FMA=0 -o src/f32-spmm/gen/16x1-minmax-neon-pipelined.c 62tools/xngen src/f32-spmm/neon-pipelined.c.in -D MR=32 -D NR=1 -D FMA=0 -o src/f32-spmm/gen/32x1-minmax-neon-pipelined.c 63 64tools/xngen src/f32-spmm/neon-pipelined.c.in -D MR=4 -D NR=1 -D FMA=1 -o src/f32-spmm/gen/4x1-minmax-neonfma-pipelined.c 65tools/xngen src/f32-spmm/neon-pipelined.c.in -D MR=8 -D NR=1 -D FMA=1 -o src/f32-spmm/gen/8x1-minmax-neonfma-pipelined.c 66tools/xngen src/f32-spmm/neon-pipelined.c.in -D MR=16 -D NR=1 -D FMA=1 -o src/f32-spmm/gen/16x1-minmax-neonfma-pipelined.c 67tools/xngen src/f32-spmm/neon-pipelined.c.in -D MR=32 -D NR=1 -D FMA=1 -o src/f32-spmm/gen/32x1-minmax-neonfma-pipelined.c 68 69################################### x86 SSE ################################### 70### Microkernels without unrolling 71tools/xngen src/f32-spmm/sse.c.in -D MR=4 -D NR=1 -D UNROLL=1 -o src/f32-spmm/gen/4x1-minmax-sse.c 72tools/xngen src/f32-spmm/sse.c.in -D MR=8 -D NR=1 -D UNROLL=1 -o src/f32-spmm/gen/8x1-minmax-sse.c 73tools/xngen src/f32-spmm/sse.c.in -D MR=16 -D NR=1 -D UNROLL=1 -o src/f32-spmm/gen/16x1-minmax-sse.c 74tools/xngen src/f32-spmm/sse.c.in -D MR=32 -D NR=1 -D UNROLL=1 -o src/f32-spmm/gen/32x1-minmax-sse.c 75 76################################### WASM SIMD ################################### 77### Microkernels without unrolling. 78tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=4 -D NR=1 -D X86=0 -D UNROLL=1 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-arm.c 79tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=8 -D NR=1 -D X86=0 -D UNROLL=1 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-arm.c 80tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=16 -D NR=1 -D X86=0 -D UNROLL=1 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-arm.c 81tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=32 -D NR=1 -D X86=0 -D UNROLL=1 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-arm.c 82tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=4 -D NR=1 -D X86=1 -D UNROLL=1 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-x86.c 83tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=8 -D NR=1 -D X86=1 -D UNROLL=1 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-x86.c 84tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=16 -D NR=1 -D X86=1 -D UNROLL=1 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-x86.c 85tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=32 -D NR=1 -D X86=1 -D UNROLL=1 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-x86.c 86 87### Microkernels with 2X unrolling 88tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=4 -D NR=1 -D X86=0 -D UNROLL=2 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-arm-x2.c 89tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=8 -D NR=1 -D X86=0 -D UNROLL=2 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-arm-x2.c 90tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=16 -D NR=1 -D X86=0 -D UNROLL=2 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-arm-x2.c 91tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=32 -D NR=1 -D X86=0 -D UNROLL=2 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-arm-x2.c 92tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=4 -D NR=1 -D X86=1 -D UNROLL=2 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-x86-x2.c 93tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=8 -D NR=1 -D X86=1 -D UNROLL=2 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-x86-x2.c 94tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=16 -D NR=1 -D X86=1 -D UNROLL=2 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-x86-x2.c 95tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=32 -D NR=1 -D X86=1 -D UNROLL=2 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-x86-x2.c 96 97### Microkernels with 4X unrolling 98tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=4 -D NR=1 -D X86=0 -D UNROLL=4 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-arm-x4.c 99tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=8 -D NR=1 -D X86=0 -D UNROLL=4 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-arm-x4.c 100tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=16 -D NR=1 -D X86=0 -D UNROLL=4 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-arm-x4.c 101tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=32 -D NR=1 -D X86=0 -D UNROLL=4 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-arm-x4.c 102tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=4 -D NR=1 -D X86=1 -D UNROLL=4 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-x86-x4.c 103tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=8 -D NR=1 -D X86=1 -D UNROLL=4 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-x86-x4.c 104tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=16 -D NR=1 -D X86=1 -D UNROLL=4 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-x86-x4.c 105tools/xngen src/f32-spmm/wasmsimd.c.in -D MR=32 -D NR=1 -D X86=1 -D UNROLL=4 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-x86-x4.c 106 107### Microkernels with software pipelining 108tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=4 -D NR=1 -D X86=0 -D UNROLL=1 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-arm-pipelined.c 109tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=8 -D NR=1 -D X86=0 -D UNROLL=1 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-arm-pipelined.c 110tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=16 -D NR=1 -D X86=0 -D UNROLL=1 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-arm-pipelined.c 111tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=32 -D NR=1 -D X86=0 -D UNROLL=1 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-arm-pipelined.c 112tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=4 -D NR=1 -D X86=1 -D UNROLL=1 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-x86-pipelined.c 113tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=8 -D NR=1 -D X86=1 -D UNROLL=1 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-x86-pipelined.c 114tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=16 -D NR=1 -D X86=1 -D UNROLL=1 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-x86-pipelined.c 115tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=32 -D NR=1 -D X86=1 -D UNROLL=1 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-x86-pipelined.c 116 117### Microkernels with software pipelining and 2X unrolling 118tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=4 -D NR=1 -D X86=0 -D UNROLL=2 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-arm-pipelined-x2.c 119tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=8 -D NR=1 -D X86=0 -D UNROLL=2 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-arm-pipelined-x2.c 120tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=16 -D NR=1 -D X86=0 -D UNROLL=2 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-arm-pipelined-x2.c 121tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=32 -D NR=1 -D X86=0 -D UNROLL=2 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-arm-pipelined-x2.c 122tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=4 -D NR=1 -D X86=1 -D UNROLL=2 -o src/f32-spmm/gen/4x1-minmax-wasmsimd-x86-pipelined-x2.c 123tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=8 -D NR=1 -D X86=1 -D UNROLL=2 -o src/f32-spmm/gen/8x1-minmax-wasmsimd-x86-pipelined-x2.c 124tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=16 -D NR=1 -D X86=1 -D UNROLL=2 -o src/f32-spmm/gen/16x1-minmax-wasmsimd-x86-pipelined-x2.c 125tools/xngen src/f32-spmm/wasmsimd-pipelined.c.in -D MR=32 -D NR=1 -D X86=1 -D UNROLL=2 -o src/f32-spmm/gen/32x1-minmax-wasmsimd-x86-pipelined-x2.c 126 127################################## Unit tests ################################# 128tools/generate-spmm-test.py --spec test/f32-spmm-minmax.yaml --output test/f32-spmm-minmax.cc 129