From: Mark Rutland Date: Wed, 3 Jun 2026 11:06:19 +0000 (+0100) Subject: arm64: fpsimd: Use assembler for SVE instructions X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=f27fe9aa2d06e01687c3871fb28492ccbab11e4c;p=thirdparty%2Fkernel%2Flinux.git arm64: fpsimd: Use assembler for SVE instructions Historically we supported assemblers which could not assemble SVE instructions. We dropped support for such assemblers in commit: 118c40b7b503 ("kbuild: require gcc-8 and binutils-2.30") Since that commit, all supported assemblers (binutils and LLVM) are capable of assembling SVE instructions, and there's no need for us to manually encode SVE instructions. Rely on the assembler to encode SVE instructions, and remove the manual encoding. The various _sve_ macros are kept for now, and will be cleaned up in subsequent patches. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Reviewed-by: Vladimir Murzin Cc: Catalin Marinas Cc: Fuad Tabba Cc: James Morse Cc: Marc Zyngier Cc: Oliver Upton Cc: Will Deacon Signed-off-by: Will Deacon --- diff --git a/arch/arm64/include/asm/fpsimdmacros.h b/arch/arm64/include/asm/fpsimdmacros.h index adf33d2da40c3..4ba23e493cb69 100644 --- a/arch/arm64/include/asm/fpsimdmacros.h +++ b/arch/arm64/include/asm/fpsimdmacros.h @@ -99,85 +99,54 @@ .endif .endm -/* SVE instruction encodings for non-SVE-capable assemblers */ -/* (pre binutils 2.28, all kernel capable clang versions support SVE) */ +/* Deprecated macros for SVE instructions */ /* STR (vector): STR Z\nz, [X\nxbase, #\offset, MUL VL] */ .macro _sve_str_v nz, nxbase, offset=0 - _sve_check_zreg \nz - _check_general_reg \nxbase - _check_num (\offset), -0x100, 0xff - .inst 0xe5804000 \ - | (\nz) \ - | ((\nxbase) << 5) \ - | (((\offset) & 7) << 10) \ - | (((\offset) & 0x1f8) << 13) + .arch_extension sve + str z\nz, [X\nxbase, #\offset, MUL VL] .endm /* LDR (vector): LDR Z\nz, [X\nxbase, #\offset, MUL VL] */ .macro _sve_ldr_v nz, nxbase, offset=0 - _sve_check_zreg \nz - _check_general_reg \nxbase - _check_num (\offset), -0x100, 0xff - .inst 0x85804000 \ - | (\nz) \ - | ((\nxbase) << 5) \ - | (((\offset) & 7) << 10) \ - | (((\offset) & 0x1f8) << 13) + .arch_extension sve + ldr z\nz, [X\nxbase, #\offset, MUL VL] .endm /* STR (predicate): STR P\np, [X\nxbase, #\offset, MUL VL] */ .macro _sve_str_p np, nxbase, offset=0 - _sve_check_preg \np - _check_general_reg \nxbase - _check_num (\offset), -0x100, 0xff - .inst 0xe5800000 \ - | (\np) \ - | ((\nxbase) << 5) \ - | (((\offset) & 7) << 10) \ - | (((\offset) & 0x1f8) << 13) + .arch_extension sve + str p\np, [X\nxbase, #\offset, MUL VL] .endm /* LDR (predicate): LDR P\np, [X\nxbase, #\offset, MUL VL] */ .macro _sve_ldr_p np, nxbase, offset=0 - _sve_check_preg \np - _check_general_reg \nxbase - _check_num (\offset), -0x100, 0xff - .inst 0x85800000 \ - | (\np) \ - | ((\nxbase) << 5) \ - | (((\offset) & 7) << 10) \ - | (((\offset) & 0x1f8) << 13) + .arch_extension sve + ldr p\np, [x\nxbase, #\offset, MUL VL] .endm /* RDVL X\nx, #\imm */ .macro _sve_rdvl nx, imm - _check_general_reg \nx - _check_num (\imm), -0x20, 0x1f - .inst 0x04bf5000 \ - | (\nx) \ - | (((\imm) & 0x3f) << 5) + .arch_extension sve + rdvl x\nx, #\imm .endm /* RDFFR (unpredicated): RDFFR P\np.B */ .macro _sve_rdffr np - _sve_check_preg \np - .inst 0x2519f000 \ - | (\np) + .arch_extension sve + rdffr p\np\().b .endm /* WRFFR P\np.B */ .macro _sve_wrffr np - _sve_check_preg \np - .inst 0x25289000 \ - | ((\np) << 5) + .arch_extension sve + wrffr p\np\().b .endm /* PFALSE P\np.B */ .macro _sve_pfalse np - _sve_check_preg \np - .inst 0x2518e400 \ - | (\np) + .arch_extension sve + pfalse p\np\().b .endm /* SME instruction encodings for non-SME-capable assemblers */