llvm-project
08d50655 - [LoongArch] Select [X]VSAT for vector clamps to narrower ranges

Commit
1 day ago
[LoongArch] Select [X]VSAT for vector clamps to narrower ranges [x]vsat.{b/h/w/d} clamps each element to [-2^imm, 2^imm - 1], and [x]vsat.{bu/hu/wu/du} to [0, 2^(imm + 1) - 1]. Select them for smin/smax pairs and umin with such constant bounds, so that e.g. ``` lu12i.w $a0, -8 vreplgr2vr.w $vr1, $a0 vmax.w $vr0, $vr0, $vr1 vldi $vr1, -2433 vmin.w $vr0, $vr0, $vr1 ``` becomes: ``` vsat.w $vr0, $vr0, 15 ``` A umin whose bound fits in uimm5 still uses a single [x]vmini. Assisted-By: LLM
Author
Parents
Loading