Commit dd6d29a6 authored by Jiaxun Yang's avatar Jiaxun Yang Committed by Thomas Bogendoerfer

MIPS: Implement microMIPS MT ASE helpers

Implement various microMIPS MT ASE helpers accroading to:

MIPS® Architecture for Programmers
Volume IV-f: The MIPS® MT Module for the microMIPS32 Architecture

Fixes build error:
{standard input}:2616: Error: branch to a symbol in another ISA mode

This make MT ASE available on microMIPS as well.

Boot tested on M5150 with microMIPS enabled on M5150.
Signed-off-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 74efddad
......@@ -216,27 +216,33 @@
* Temporary until all gas have MT ASE support
*/
.macro DMT reg=0
.word 0x41600bc1 | (\reg << 16)
insn_if_mips 0x41600bc1 | (\reg << 16)
insn32_if_mm 0x0000057C | (\reg << 21)
.endm
.macro EMT reg=0
.word 0x41600be1 | (\reg << 16)
insn_if_mips 0x41600be1 | (\reg << 16)
insn32_if_mm 0x0000257C | (\reg << 21)
.endm
.macro DVPE reg=0
.word 0x41600001 | (\reg << 16)
insn_if_mips 0x41600001 | (\reg << 16)
insn32_if_mm 0x0000157C | (\reg << 21)
.endm
.macro EVPE reg=0
.word 0x41600021 | (\reg << 16)
insn_if_mips 0x41600021 | (\reg << 16)
insn32_if_mm 0x0000357C | (\reg << 21)
.endm
.macro MFTR rt=0, rd=0, u=0, sel=0
.word 0x41000000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
.macro MFTR rs=0, rt=0, u=0, sel=0
insn_if_mips 0x41000000 | (\rt << 16) | (\rs << 11) | (\u << 5) | (\sel)
insn32_if_mm 0x0000000E | (\rt << 21) | (\rs << 16) | (\u << 10) | (\sel << 4)
.endm
.macro MTTR rt=0, rd=0, u=0, sel=0
.word 0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
.macro MTTR rt=0, rs=0, u=0, sel=0
insn_if_mips 0x41800000 | (\rt << 16) | (\rs << 11) | (\u << 5) | (\sel)
insn32_if_mm 0x00000006 | (\rt << 21) | (\rs << 16) | (\u << 10) | (\sel << 4)
.endm
#ifdef TOOLCHAIN_SUPPORTS_MSA
......
This diff is collapsed.
......@@ -1452,6 +1452,15 @@ static inline int mm_insn_16bit(u16 insn)
* the ENC encodings.
*/
/* Instructions with 1 register operand */
#define _ASM_MACRO_1R(OP, R1, ENC) \
".macro " #OP " " #R1 "\n\t" \
_ASM_SET_PARSE_R \
"parse_r __" #R1 ", \\" #R1 "\n\t" \
ENC \
_ASM_UNSET_PARSE_R \
".endm\n\t"
/* Instructions with 1 register operand & 1 immediate operand */
#define _ASM_MACRO_1R1I(OP, R1, I2, ENC) \
".macro " #OP " " #R1 ", " #I2 "\n\t" \
......
......@@ -95,8 +95,8 @@ int vpe_run(struct vpe *v)
* We don't pass the memsize here, so VPE programs need to be
* compiled with DFLT_STACK_SIZE and DFLT_HEAP_SIZE defined.
*/
mttgpr(7, 0);
mttgpr(6, v->ntcs);
mttgpr($7, 0);
mttgpr($6, v->ntcs);
/* set up VPE1 */
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment