Commit 75fc3d85 authored by Doug Nazar's avatar Doug Nazar

neon: Enable Flush-to-zero mode for float programs

Some of the instructions are not NEON (which always uses FTZ),
but are actually VFP, which requires enabling FTZ mode.
parent 261caa09
Pipeline #65084 passed with stage
in 2 minutes and 32 seconds
......@@ -476,6 +476,7 @@ orc_compiler_neon_assemble (OrcCompiler *compiler)
int align_shift;
int var_size_shift;
int i;
int set_fpscr = FALSE;
align_var = get_align_var (compiler);
if (compiler->error) return;
......@@ -487,6 +488,13 @@ orc_compiler_neon_assemble (OrcCompiler *compiler)
orc_neon_emit_prologue (compiler);
if (orc_program_has_float (compiler)) {
set_fpscr = TRUE;
orc_arm_emit_load_imm (compiler, compiler->gp_tmpreg, 1<<24);
ORC_ASM_CODE (compiler," vmsr fpscr, %s\n", orc_arm_reg_name (compiler->gp_tmpreg));
orc_arm_emit (compiler, 0xeee10a10 | ((compiler->gp_tmpreg&0xf)<<12));
}
orc_neon_load_constants_outer (compiler);
if (compiler->program->is_2d) {
......@@ -697,6 +705,12 @@ orc_compiler_neon_assemble (OrcCompiler *compiler)
orc_neon_save_accumulators (compiler);
if (set_fpscr) {
orc_arm_emit_load_imm (compiler, compiler->gp_tmpreg, 0);
ORC_ASM_CODE (compiler," vmsr fpscr, %s\n", orc_arm_reg_name (compiler->gp_tmpreg));
orc_arm_emit (compiler, 0xeee10a10 | ((compiler->gp_tmpreg&0xf)<<12));
}
orc_neon_emit_epilogue (compiler);
orc_arm_emit_align (compiler, 4);
......
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