Re: [Mesa-dev] [PATCH] nv50/ir: Add mul and mod constant optimizations

2019-07-23 Thread Karol Herbst
yeah.. I am not quite sure myself about it. But skipping on the div emulation seems like a good idea in general. But it's also not common enough to actually care all that much about it. On Tue, Jul 23, 2019 at 5:18 PM Ilia Mirkin wrote: > > On Tue, Jul 23, 2019 at 11:15 AM Karol Herbst wrote: >

Re: [Mesa-dev] [PATCH] nv50/ir: Add mul and mod constant optimizations

2019-07-23 Thread Ilia Mirkin
On Tue, Jul 23, 2019 at 11:15 AM Karol Herbst wrote: > > On Tue, Jul 23, 2019 at 4:50 PM Ilia Mirkin wrote: > > > > You handle 1/n but not 1%n? TBH, the 1/n code isn't 100% obvious to > > me... 1/n = |n|-1 > 0 ? i forget how SLCT works, but I can't > > think of a way to finish that

Re: [Mesa-dev] [PATCH] nv50/ir: Add mul and mod constant optimizations

2019-07-23 Thread Karol Herbst
On Tue, Jul 23, 2019 at 4:50 PM Ilia Mirkin wrote: > > You handle 1/n but not 1%n? TBH, the 1/n code isn't 100% obvious to > me... 1/n = |n|-1 > 0 ? i forget how SLCT works, but I can't > think of a way to finish that expression in terms of |n|-1 and n. And > what about n == 0. I'd just as

Re: [Mesa-dev] [PATCH] nv50/ir: Add mul and mod constant optimizations

2019-07-23 Thread Ilia Mirkin
You handle 1/n but not 1%n? TBH, the 1/n code isn't 100% obvious to me... 1/n = |n|-1 > 0 ? i forget how SLCT works, but I can't think of a way to finish that expression in terms of |n|-1 and n. And what about n == 0. I'd just as soon drop that case. On Tue, Jul 23, 2019 at 10:20 AM Mark

[Mesa-dev] [PATCH] nv50/ir: Add mul and mod constant optimizations

2019-07-23 Thread Mark Menzynski
Optimizations for 0/n, 1/n and 0%n. No changes in shader db tests, because it is never used here, but it should become handy. Signed-off-by: Mark Menzynski --- .../nouveau/codegen/nv50_ir_peephole.cpp | 30 +-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git