Optimise sdot for POWER9

Use lxvd2x instruction instead of lxvw4x.
lxvd2x performs far better on the new POWER architecture than lxvw4x.
This commit is contained in:
Matt Brown 2017-06-14 16:43:31 +10:00
parent 32c7fe6bff
commit e0034de22d
1 changed files with 32 additions and 32 deletions

View File

@ -57,22 +57,22 @@ static float sdot_kernel_16 (long n, float *x, float *y)
"xxlxor 38, 38, 38 \n\t" "xxlxor 38, 38, 38 \n\t"
"xxlxor 39, 39, 39 \n\t" "xxlxor 39, 39, 39 \n\t"
"lxvw4x 40, 0, %2 \n\t" "lxvd2x 40, 0, %2 \n\t"
"lxvw4x 48, 0, %3 \n\t" "lxvd2x 48, 0, %3 \n\t"
"lxvw4x 41, %10, %2 \n\t" "lxvd2x 41, %10, %2 \n\t"
"lxvw4x 49, %10, %3 \n\t" "lxvd2x 49, %10, %3 \n\t"
"lxvw4x 42, %11, %2 \n\t" "lxvd2x 42, %11, %2 \n\t"
"lxvw4x 50, %11, %3 \n\t" "lxvd2x 50, %11, %3 \n\t"
"lxvw4x 43, %12, %2 \n\t" "lxvd2x 43, %12, %2 \n\t"
"lxvw4x 51, %12, %3 \n\t" "lxvd2x 51, %12, %3 \n\t"
"lxvw4x 44, %13, %2 \n\t" "lxvd2x 44, %13, %2 \n\t"
"lxvw4x %x4, %13, %3 \n\t" "lxvd2x %x4, %13, %3 \n\t"
"lxvw4x 45, %14, %2 \n\t" "lxvd2x 45, %14, %2 \n\t"
"lxvw4x %x5, %14, %3 \n\t" "lxvd2x %x5, %14, %3 \n\t"
"lxvw4x 46, %15, %2 \n\t" "lxvd2x 46, %15, %2 \n\t"
"lxvw4x %x6, %15, %3 \n\t" "lxvd2x %x6, %15, %3 \n\t"
"lxvw4x 47, %16, %2 \n\t" "lxvd2x 47, %16, %2 \n\t"
"lxvw4x %x7, %16, %3 \n\t" "lxvd2x %x7, %16, %3 \n\t"
"addi %2, %2, 128 \n\t" "addi %2, %2, 128 \n\t"
"addi %3, %3, 128 \n\t" "addi %3, %3, 128 \n\t"
@ -84,29 +84,29 @@ static float sdot_kernel_16 (long n, float *x, float *y)
"1: \n\t" "1: \n\t"
"xvmaddasp 32, 40, 48 \n\t" "xvmaddasp 32, 40, 48 \n\t"
"lxvw4x 40, 0, %2 \n\t" "lxvd2x 40, 0, %2 \n\t"
"lxvw4x 48, 0, %3 \n\t" "lxvd2x 48, 0, %3 \n\t"
"xvmaddasp 33, 41, 49 \n\t" "xvmaddasp 33, 41, 49 \n\t"
"lxvw4x 41, %10, %2 \n\t" "lxvd2x 41, %10, %2 \n\t"
"lxvw4x 49, %10, %3 \n\t" "lxvd2x 49, %10, %3 \n\t"
"xvmaddasp 34, 42, 50 \n\t" "xvmaddasp 34, 42, 50 \n\t"
"lxvw4x 42, %11, %2 \n\t" "lxvd2x 42, %11, %2 \n\t"
"lxvw4x 50, %11, %3 \n\t" "lxvd2x 50, %11, %3 \n\t"
"xvmaddasp 35, 43, 51 \n\t" "xvmaddasp 35, 43, 51 \n\t"
"lxvw4x 43, %12, %2 \n\t" "lxvd2x 43, %12, %2 \n\t"
"lxvw4x 51, %12, %3 \n\t" "lxvd2x 51, %12, %3 \n\t"
"xvmaddasp 36, 44, %x4 \n\t" "xvmaddasp 36, 44, %x4 \n\t"
"lxvw4x 44, %13, %2 \n\t" "lxvd2x 44, %13, %2 \n\t"
"lxvw4x %x4, %13, %3 \n\t" "lxvd2x %x4, %13, %3 \n\t"
"xvmaddasp 37, 45, %x5 \n\t" "xvmaddasp 37, 45, %x5 \n\t"
"lxvw4x 45, %14, %2 \n\t" "lxvd2x 45, %14, %2 \n\t"
"lxvw4x %x5, %14, %3 \n\t" "lxvd2x %x5, %14, %3 \n\t"
"xvmaddasp 38, 46, %x6 \n\t" "xvmaddasp 38, 46, %x6 \n\t"
"lxvw4x 46, %15, %2 \n\t" "lxvd2x 46, %15, %2 \n\t"
"lxvw4x %x6, %15, %3 \n\t" "lxvd2x %x6, %15, %3 \n\t"
"xvmaddasp 39, 47, %x7 \n\t" "xvmaddasp 39, 47, %x7 \n\t"
"lxvw4x 47, %16, %2 \n\t" "lxvd2x 47, %16, %2 \n\t"
"lxvw4x %x7, %16, %3 \n\t" "lxvd2x %x7, %16, %3 \n\t"
"addi %2, %2, 128 \n\t" "addi %2, %2, 128 \n\t"
"addi %3, %3, 128 \n\t" "addi %3, %3, 128 \n\t"