Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARM: 9029/1: Make iwmmxt.S support Clang's integrated assembler
commit 3c9f570 upstream. This patch replaces 6 IWMMXT instructions Clang's integrated assembler does not support in iwmmxt.S using macros, while making sure GNU assembler still emit the same instructions. This should be easier than providing full IWMMXT support in Clang. This is one of the last bits of kernel code that could be compiled but not assembled with clang. Once all of it works with IAS, we no longer need to special-case 32-bit Arm in Kbuild, or turn off CONFIG_IWMMXT when build-testing. "Intel Wireless MMX Technology - Developer Guide - August, 2002" should be referenced for the encoding schemes of these extensions. Link: ClangBuiltLinux/linux#975 Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Suggested-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Tested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Jian Cai <jiancai@google.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
- Loading branch information
Showing
2 changed files
with
92 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
|
||
#ifndef __IWMMXT_H__ | ||
#define __IWMMXT_H__ | ||
|
||
.irp b, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 | ||
.set .LwR\b, \b | ||
.set .Lr\b, \b | ||
.endr | ||
|
||
.set .LwCSSF, 0x2 | ||
.set .LwCASF, 0x3 | ||
.set .LwCGR0, 0x8 | ||
.set .LwCGR1, 0x9 | ||
.set .LwCGR2, 0xa | ||
.set .LwCGR3, 0xb | ||
|
||
.macro wldrd, reg:req, base:req, offset:req | ||
.inst 0xedd00100 | (.L\reg << 12) | (.L\base << 16) | (\offset >> 2) | ||
.endm | ||
|
||
.macro wldrw, reg:req, base:req, offset:req | ||
.inst 0xfd900100 | (.L\reg << 12) | (.L\base << 16) | (\offset >> 2) | ||
.endm | ||
|
||
.macro wstrd, reg:req, base:req, offset:req | ||
.inst 0xedc00100 | (.L\reg << 12) | (.L\base << 16) | (\offset >> 2) | ||
.endm | ||
|
||
.macro wstrw, reg:req, base:req, offset:req | ||
.inst 0xfd800100 | (.L\reg << 12) | (.L\base << 16) | (\offset >> 2) | ||
.endm | ||
|
||
#ifdef __clang__ | ||
|
||
#define wCon c1 | ||
|
||
.macro tmrc, dest:req, control:req | ||
mrc p1, 0, \dest, \control, c0, 0 | ||
.endm | ||
|
||
.macro tmcr, control:req, src:req | ||
mcr p1, 0, \src, \control, c0, 0 | ||
.endm | ||
#endif | ||
|
||
#endif |