Skip to content

Commit 1123809

Browse files
specialpointcentralchenhuacai
authored andcommitted
LoongArch: Remove obsolete mentions of vcsr
The `vcsr` only exists in the old hardware design, it isn't used in any shipped hardware from Loongson-3A5000 on. Both scalar FP and LSX/LASX instructions use the `fcsr` as their control and status registers now. For example, the RM control bit in fcsr0 is shared by FP, LSX and LASX instructions. Particularly, fcsr16 to fcsr31 are reserved for LSX/LASX now, access to these registers has no visible effect if LSX/LASX is enabled, and will cause SXD/ASXD exceptions if LSX/LASX is not enabled. So, mentions of vcsr are obsolete in the first place (it was just used for debugging), let's remove them. Reviewed-by: WANG Xuerui <[email protected]> Signed-off-by: Qi Hu <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 7fd6ef6 commit 1123809

File tree

4 files changed

+0
-14
lines changed

4 files changed

+0
-14
lines changed

arch/loongarch/include/asm/fpregdef.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,5 @@
4848
#define fcsr1 $r1
4949
#define fcsr2 $r2
5050
#define fcsr3 $r3
51-
#define vcsr16 $r16
5251

5352
#endif /* _ASM_FPREGDEF_H */

arch/loongarch/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ BUILD_FPR_ACCESS(64)
8080

8181
struct loongarch_fpu {
8282
unsigned int fcsr;
83-
unsigned int vcsr;
8483
uint64_t fcc; /* 8x8 */
8584
union fpureg fpr[NUM_FPU_REGS];
8685
};
@@ -161,7 +160,6 @@ struct thread_struct {
161160
*/ \
162161
.fpu = { \
163162
.fcsr = 0, \
164-
.vcsr = 0, \
165163
.fcc = 0, \
166164
.fpr = {{{0,},},}, \
167165
}, \

arch/loongarch/kernel/asm-offsets.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ void output_thread_fpu_defines(void)
166166

167167
OFFSET(THREAD_FCSR, loongarch_fpu, fcsr);
168168
OFFSET(THREAD_FCC, loongarch_fpu, fcc);
169-
OFFSET(THREAD_VCSR, loongarch_fpu, vcsr);
170169
BLANK();
171170
}
172171

arch/loongarch/kernel/fpu.S

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,6 @@
146146
movgr2fcsr fcsr0, \tmp0
147147
.endm
148148

149-
.macro sc_save_vcsr base, tmp0
150-
movfcsr2gr \tmp0, vcsr16
151-
EX st.w \tmp0, \base, 0
152-
.endm
153-
154-
.macro sc_restore_vcsr base, tmp0
155-
EX ld.w \tmp0, \base, 0
156-
movgr2fcsr vcsr16, \tmp0
157-
.endm
158-
159149
/*
160150
* Save a thread's fp context.
161151
*/

0 commit comments

Comments
 (0)