mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 06:40:08 +01:00
nak/sm20: Call copy_alu_src_if_fabs() first
Since an FAbs or FNegAbs modifier is going to force the source out to a register no matter what, we should do this first. That way we avoid the unnecessary source swaps or other evictions when we have to evict the source anyway because it has a modifier. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34675>
This commit is contained in:
parent
c26273109f
commit
ca296bf0a9
1 changed files with 4 additions and 4 deletions
|
|
@ -585,11 +585,11 @@ impl SM20Op for OpFFma {
|
|||
fn legalize(&mut self, b: &mut LegalizeBuilder) {
|
||||
use RegFile::GPR;
|
||||
let [src0, src1, src2] = &mut self.srcs;
|
||||
swap_srcs_if_not_reg(src0, src1, GPR);
|
||||
b.copy_alu_src_if_not_reg(src0, GPR, SrcType::F32);
|
||||
b.copy_alu_src_if_fabs(src0, GPR, SrcType::F32);
|
||||
b.copy_alu_src_if_fabs(src1, GPR, SrcType::F32);
|
||||
b.copy_alu_src_if_fabs(src2, GPR, SrcType::F32);
|
||||
swap_srcs_if_not_reg(src0, src1, GPR);
|
||||
b.copy_alu_src_if_not_reg(src0, GPR, SrcType::F32);
|
||||
if src1.as_imm_not_f20().is_some()
|
||||
&& (self.saturate
|
||||
|| self.rnd_mode != FRndMode::NearestEven
|
||||
|
|
@ -680,10 +680,10 @@ impl SM20Op for OpFMul {
|
|||
fn legalize(&mut self, b: &mut LegalizeBuilder) {
|
||||
use RegFile::GPR;
|
||||
let [src0, src1] = &mut self.srcs;
|
||||
swap_srcs_if_not_reg(src0, src1, GPR);
|
||||
b.copy_alu_src_if_not_reg(src0, GPR, SrcType::F32);
|
||||
b.copy_alu_src_if_fabs(src0, GPR, SrcType::F32);
|
||||
b.copy_alu_src_if_fabs(src1, GPR, SrcType::F32);
|
||||
swap_srcs_if_not_reg(src0, src1, GPR);
|
||||
b.copy_alu_src_if_not_reg(src0, GPR, SrcType::F32);
|
||||
if src1.as_imm_not_f20().is_some()
|
||||
&& self.rnd_mode != FRndMode::NearestEven
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue