MIPS: assume at as source/dest of MSA copy/insert instructions
Assuming at ($1) as the source or destination register of copy or
insert instructions:
- Simplifies the macros providing those instructions for toolchains
without MSA support.
- Avoids an unnecessary move instruction when at is used as the source
or destination register anyway.
- Is sufficient for the uses to be introduced in the kernel by a
subsequent patch.
Note that due to a patch ordering snafu on my part this also fixes the
currently broken build with MSA support enabled. The build has been
broken since commit c9017757c5
"MIPS: init upper 64b of vector
registers when MSA is first used", which this patch should have
preceeded.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9161/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
631afc65e8
commit
f23ce3883a
|
@ -227,35 +227,35 @@
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro copy_u_w rd, ws, n
|
.macro copy_u_w ws, n
|
||||||
.set push
|
.set push
|
||||||
.set mips32r2
|
.set mips32r2
|
||||||
.set msa
|
.set msa
|
||||||
copy_u.w \rd, $w\ws[\n]
|
copy_u.w $1, $w\ws[\n]
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro copy_u_d rd, ws, n
|
.macro copy_u_d ws, n
|
||||||
.set push
|
.set push
|
||||||
.set mips64r2
|
.set mips64r2
|
||||||
.set msa
|
.set msa
|
||||||
copy_u.d \rd, $w\ws[\n]
|
copy_u.d $1, $w\ws[\n]
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro insert_w wd, n, rs
|
.macro insert_w wd, n
|
||||||
.set push
|
.set push
|
||||||
.set mips32r2
|
.set mips32r2
|
||||||
.set msa
|
.set msa
|
||||||
insert.w $w\wd[\n], \rs
|
insert.w $w\wd[\n], $1
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro insert_d wd, n, rs
|
.macro insert_d wd, n
|
||||||
.set push
|
.set push
|
||||||
.set mips64r2
|
.set mips64r2
|
||||||
.set msa
|
.set msa
|
||||||
insert.d $w\wd[\n], \rs
|
insert.d $w\wd[\n], $1
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
#else
|
#else
|
||||||
|
@ -320,40 +320,36 @@
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro copy_u_w rd, ws, n
|
.macro copy_u_w ws, n
|
||||||
.set push
|
.set push
|
||||||
.set noat
|
.set noat
|
||||||
SET_HARDFLOAT
|
SET_HARDFLOAT
|
||||||
.insn
|
.insn
|
||||||
.word COPY_UW_MSA_INSN | (\n << 16) | (\ws << 11)
|
.word COPY_UW_MSA_INSN | (\n << 16) | (\ws << 11)
|
||||||
move \rd, $1
|
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro copy_u_d rd, ws, n
|
.macro copy_u_d ws, n
|
||||||
.set push
|
.set push
|
||||||
.set noat
|
.set noat
|
||||||
SET_HARDFLOAT
|
SET_HARDFLOAT
|
||||||
.insn
|
.insn
|
||||||
.word COPY_UD_MSA_INSN | (\n << 16) | (\ws << 11)
|
.word COPY_UD_MSA_INSN | (\n << 16) | (\ws << 11)
|
||||||
move \rd, $1
|
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro insert_w wd, n, rs
|
.macro insert_w wd, n
|
||||||
.set push
|
.set push
|
||||||
.set noat
|
.set noat
|
||||||
SET_HARDFLOAT
|
SET_HARDFLOAT
|
||||||
move $1, \rs
|
|
||||||
.word INSERT_W_MSA_INSN | (\n << 16) | (\wd << 6)
|
.word INSERT_W_MSA_INSN | (\n << 16) | (\wd << 6)
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro insert_d wd, n, rs
|
.macro insert_d wd, n
|
||||||
.set push
|
.set push
|
||||||
.set noat
|
.set noat
|
||||||
SET_HARDFLOAT
|
SET_HARDFLOAT
|
||||||
move $1, \rs
|
|
||||||
.word INSERT_D_MSA_INSN | (\n << 16) | (\wd << 6)
|
.word INSERT_D_MSA_INSN | (\n << 16) | (\wd << 6)
|
||||||
.set pop
|
.set pop
|
||||||
.endm
|
.endm
|
||||||
|
|
Loading…
Reference in New Issue