summaryrefslogtreecommitdiff
path: root/arch/loongarch/include/asm/fpregdef.h
diff options
context:
space:
mode:
authorWANG Xuerui <git@xen0n.name>2023-06-29 15:58:43 +0300
committerHuacai Chen <chenhuacai@loongson.cn>2023-06-29 15:58:43 +0300
commit38bb46f94544c5385bc35aa2bfc776dcf53a7b5d (patch)
treea9874bea832ce2e5665ce63c8214d55bb938fde0 /arch/loongarch/include/asm/fpregdef.h
parent24da0249d950bbf97a8513daf414b48548b8bbe9 (diff)
downloadlinux-38bb46f94544c5385bc35aa2bfc776dcf53a7b5d.tar.xz
LoongArch: Prepare for assemblers with proper FCSR class support
The GNU assembler (as of 2.40) mis-treats FCSR operands as GPRs, but the LLVM IAS does not. Probe for this and refer to FCSRs as "$fcsrNN" if support is present. Signed-off-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm/fpregdef.h')
-rw-r--r--arch/loongarch/include/asm/fpregdef.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/loongarch/include/asm/fpregdef.h b/arch/loongarch/include/asm/fpregdef.h
index b6be527831dd..e56610ae8592 100644
--- a/arch/loongarch/include/asm/fpregdef.h
+++ b/arch/loongarch/include/asm/fpregdef.h
@@ -40,6 +40,7 @@
#define fs6 $f30
#define fs7 $f31
+#ifndef CONFIG_AS_HAS_FCSR_CLASS
/*
* Current binutils expects *GPRs* at FCSR position for the FCSR
* operation instructions, so define aliases for those used.
@@ -48,5 +49,11 @@
#define fcsr1 $r1
#define fcsr2 $r2
#define fcsr3 $r3
+#else
+#define fcsr0 $fcsr0
+#define fcsr1 $fcsr1
+#define fcsr2 $fcsr2
+#define fcsr3 $fcsr3
+#endif
#endif /* _ASM_FPREGDEF_H */