externvoid read_msa_wr_b(unsigned idx, union fpureg *to); externvoid read_msa_wr_h(unsigned idx, union fpureg *to); externvoid read_msa_wr_w(unsigned idx, union fpureg *to); externvoid read_msa_wr_d(unsigned idx, union fpureg *to);
/** * read_msa_wr() - Read a single MSA vector register * @idx: The index of the vector register to read * @to: The FPU register union to store the registers value in * @fmt: The format of the data in the vector register * * Read the value of MSA vector register idx into the FPU register * union to, using the format fmt.
*/ staticinlinevoid read_msa_wr(unsigned idx, union fpureg *to, enum msa_2b_fmt fmt)
{ switch (fmt) { case msa_fmt_b:
read_msa_wr_b(idx, to); break;
case msa_fmt_h:
read_msa_wr_h(idx, to); break;
case msa_fmt_w:
read_msa_wr_w(idx, to); break;
case msa_fmt_d:
read_msa_wr_d(idx, to); break;
default:
BUG();
}
}
externvoid write_msa_wr_b(unsigned idx, union fpureg *from); externvoid write_msa_wr_h(unsigned idx, union fpureg *from); externvoid write_msa_wr_w(unsigned idx, union fpureg *from); externvoid write_msa_wr_d(unsigned idx, union fpureg *from);
/** * write_msa_wr() - Write a single MSA vector register * @idx: The index of the vector register to write * @from: The FPU register union to take the registers value from * @fmt: The format of the data in the vector register * * Write the value from the FPU register union from into MSA vector * register idx, using the format fmt.
*/ staticinlinevoid write_msa_wr(unsigned idx, union fpureg *from, enum msa_2b_fmt fmt)
{ switch (fmt) { case msa_fmt_b:
write_msa_wr_b(idx, from); break;
case msa_fmt_h:
write_msa_wr_h(idx, from); break;
case msa_fmt_w:
write_msa_wr_w(idx, from); break;
case msa_fmt_d:
write_msa_wr_d(idx, from); break;
default:
BUG();
}
}
staticinlinevoid enable_msa(void)
{ if (cpu_has_msa) {
set_c0_config5(MIPS_CONF5_MSAEN);
enable_fpu_hazard();
}
}
staticinlinevoid disable_msa(void)
{ if (cpu_has_msa) {
clear_c0_config5(MIPS_CONF5_MSAEN);
disable_fpu_hazard();
}
}
staticinlineint is_msa_enabled(void)
{ if (!cpu_has_msa) return 0;
return read_c0_config5() & MIPS_CONF5_MSAEN;
}
staticinlineint thread_msa_context_live(void)
{ /* * Check cpu_has_msa only if it's a constant. This will allow the * compiler to optimise out code for CPUs without MSA without adding * an extra redundant check for CPUs with MSA.
*/ if (__builtin_constant_p(cpu_has_msa) && !cpu_has_msa) return 0;
return test_thread_flag(TIF_MSA_CTX_LIVE);
}
staticinlinevoid save_msa(struct task_struct *t)
{ if (cpu_has_msa)
_save_msa(t);
}
staticinlinevoid restore_msa(struct task_struct *t)
{ if (cpu_has_msa)
_restore_msa(t);
}
staticinlinevoid init_msa_upper(void)
{ /* * Check cpu_has_msa only if it's a constant. This will allow the * compiler to optimise out code for CPUs without MSA without adding * an extra redundant check for CPUs with MSA.
*/ if (__builtin_constant_p(cpu_has_msa) && !cpu_has_msa) return;
_init_msa_upper();
}
#ifndef TOOLCHAIN_SUPPORTS_MSA /* * Define assembler macros using .word for the c[ft]cmsa instructions in order * to allow compilation with toolchains that do not support MSA. Once all * toolchains in use support MSA these can be removed.
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.