From: Tobias Klausmann <tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
To: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
Cc: "nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
"mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 2/4] nvc0/ir: Handle reverse subop for OP_EXTBF when folding constant expressions
Date: Thu, 29 May 2014 21:53:56 +0200 [thread overview]
Message-ID: <53879054.9090405@mni.thm.de> (raw)
In-Reply-To: <CAKb7UvgLpfeM6HL7skM-OXCYjNz8=uD=1fhQb5xLndszw3u0zQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Tested with:
MESA_EXTENSION_OVERRIDE=GL_ARB_gpu_shader5 ./shader_runner
../tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldReverse.shader_test
-> green output, so this should be ok
the test was not change though...
On 29.05.2014 21:47, Ilia Mirkin wrote:
> Can you verify that you tested how the HW handles this, as well as
> exactly how you did it (i.e. how did you modify the code + piglit
> test, what the results were, etc)
>
> On Thu, May 29, 2014 at 3:43 PM, Tobias Klausmann
> <tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@public.gmane.org> wrote:
>> Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
>> ---
>> src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 14 ++++++++++++--
>> 1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
>> index 58092f4..93f7c2a 100644
>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
>> @@ -529,8 +529,18 @@ ConstantFolding::expr(Instruction *i,
>> lshift = 32 - width - offset;
>> }
>> switch (i->dType) {
>> - case TYPE_S32: res.data.s32 = (a->data.s32 << lshift) >> rshift; break;
>> - case TYPE_U32: res.data.u32 = (a->data.u32 << lshift) >> rshift; break;
>> + case TYPE_S32: {
>> + res.data.s32 = (res.data.s32 << lshift) >> rshift;
>> + if (i->subOp == NV50_IR_SUBOP_EXTBF_REV)
>> + res.data.s32 = util_bitreverse(res.data.s32);
>> + break;
>> + }
>> + case TYPE_U32: {
>> + res.data.u32 = (res.data.u32 << lshift) >> rshift;
>> + if (i->subOp == NV50_IR_SUBOP_EXTBF_REV)
>> + res.data.u32 = util_bitreverse(res.data.u32);
>> + break;
>> + }
>> default:
>> return;
>> }
>> --
>> 1.8.4.5
>>
next prev parent reply other threads:[~2014-05-29 19:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 19:43 Add constant folding for new opcodes Tobias Klausmann
2014-05-29 19:43 ` [PATCH 1/4] nvc0/ir: clear subop when folding constant expressions Tobias Klausmann
2014-05-29 19:43 ` [PATCH 2/4] nvc0/ir: Handle reverse subop for OP_EXTBF " Tobias Klausmann
2014-05-29 19:47 ` Ilia Mirkin
[not found] ` <CAKb7UvgLpfeM6HL7skM-OXCYjNz8=uD=1fhQb5xLndszw3u0zQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-29 19:53 ` Tobias Klausmann [this message]
[not found] ` <53879054.9090405-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
2014-05-29 19:56 ` Ilia Mirkin
[not found] ` <1401392636-17704-1-git-send-email-tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
2014-05-29 19:43 ` [PATCH 3/4] nvc0/ir: Handle OP_POPCNT " Tobias Klausmann
2014-05-29 19:53 ` Ilia Mirkin
2014-05-29 19:43 ` [PATCH 4/4] nvc0/ir: Handle OP_BFIND " Tobias Klausmann
2014-05-29 19:58 ` Ilia Mirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53879054.9090405@mni.thm.de \
--to=tobias.johannes.klausmann-aqjdnwhu20eelga04laivw@public.gmane.org \
--cc=imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org \
--cc=mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.