[Bug 27901] GLSL cos/sin functions broken on Mesa R600 driver

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jun 8 09:36:57 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=27901

--- Comment #21 from Conn Clark <conn.o.clark at gmail.com> 2010-06-08 09:36:57 PDT ---
On Tue, Jun 8, 2010 at 9:25 AM, Conn Clark <conn.o.clark at gmail.com> wrote:
> On Tue, Jun 8, 2010 at 9:09 AM,  <bugzilla-daemon at freedesktop.org> wrote:
>> https://bugs.freedesktop.org/show_bug.cgi?id=27901
>>
>> --- Comment #19 from Conn Clark <conn.o.clark at gmail.com> 2010-06-08 09:09:49 PDT ---
>> On Tue, Jun 8, 2010 at 5:53 AM,  <bugzilla-daemon at freedesktop.org> wrote:
>>> https://bugs.freedesktop.org/show_bug.cgi?id=27901
>>>
>>> --- Comment #18 from Andre Maasikas <amaasikas at gmail.com> 2010-06-08 05:53:36 PDT ---
>>> dont' have much net this week to review/test:(
>>> but i'm ok with it if you make last mul conditional on r700 as
>>> it has -1..1 range it seems, also amd shader analyzer gives this difference:
>>>
>>> RV610 hd2400
>>>
>>> ; --------  Disassembly --------------------
>>> 00 ALU: ADDR(32) CNT(8)
>>>      0  y: MULADD      R123.y,  R0.x,  (0x3E22F983, 0.1591549367f).x,
>>>  0.5
>>>         z: MOV         R0.z,  0.0f
>>>         w: MOV         R0.w,  1.0f
>>>      1  x: FRACT       ____,  PV0.y
>>>      2  z: MULADD      R123.z,  PV1.x,  (0x40C90FDB, 6.283185482f).y,
>>> -(0x40490FDB, 3.141592741f).x
>>>      3  t: SIN         R0.x,  PV2.z
>>> 01 EXP_DONE: PIX0, R0.xzzw
>>> END_OF_PROGRAM
>>>
>>> 4870 RV770
>>> ; --------  Disassembly --------------------
>>> 00 ALU: ADDR(32) CNT(10)
>>>      0  y: MOV         R0.y,  0.0f
>>>         z: MOV         R0.z,  1.0f
>>>         w: MULADD      R123.w,  R0.x,  (0x3E22F983, 0.1591549367f).x,
>>>  0.5
>>>      1  y: FRACT       ____,  PV0.w
>>>      2  x: MULADD      R123.x,  PV1.y,  (0x40C90FDB, 6.283185482f).y,
>>> -(0x40490FDB, 3.141592741f).x
>>>      3  z: MUL         ____,  PV2.x,  (0x3E22F983, 0.1591549367f).x
>>>      4  t: SIN         R0.x,  PV3.z
>>> 01 EXP_DONE: PIX0, R0.xyyz
>>> END_OF_PROGRAM
>>>
>>> --
>>> Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
>>> ------- You are receiving this mail because: -------
>>> You are the assignee for the bug.
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>>
>> This is very very strange that amd would change the instruction. I
>> wonder if it is a bug in their code....   Perhaps we need someone with
>> an r700 to run the sin and cos tests in piglit . The proposed patch
>> passes on my rs780 (rv610) .
>>
>> --
>> Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
>> ------- You are receiving this mail because: -------
>> You are the assignee for the bug.
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>
>
> Nope Andre, is right.
>
>
> the evergreen docs describe the sine function as follows
>
> Scalar sine. Input must be normalized from radians by dividing by
> 2*PI. The valid input
> domain is [-256, +256], which corresponds to an un-normalized input
> domain [-512*PI,
> +512*PI]. Out-of-range input results in float 0.
>
>
> while the r600 describes the sine function as follows
>
> Scalar sine. Valid input domain [-PI, +PI].
>
>
> --
>
> Conn O. Clark
>
> Observation: In formal computer science advances are made
> by standing on the shoulders of giants. Linux has proved
> that if there are enough of you, you can advance just as
> far by stepping on each others toes.
>

I guess I'll modify Alain's patch tonight. If r700 has a valid range
-256 to 256 we can get away with just using a FRACT instruction with
2*PI.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the dri-devel mailing list