Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-12 Thread tournier.elie
I found on PCC website that it was imported in OpenBSD and NetBSD system so
the license should be compatible.
I think I will use it as a base for add, multiply, absolute value, negate,
convert to/from single precision, and comparison functions.

Tomorrow, I will make a draft of my proposal for GSoC in which I will
resume everything.

2016-03-11 22:00 GMT+01:00 Ian Romanick :

> On 03/10/2016 03:09 PM, Dylan Baker wrote:
> > Quoting Marek Olšák (2016-03-10 06:57:57)
> >> On Thu, Mar 10, 2016 at 3:30 PM, tournier.elie 
> wrote:
> >>> First, thank you all for your answers.
> >>>
> >>> So if I summarize what was said, we need
> >>> Ian:
> >>>  - add
> >>>  - negate
> >>>  - absolute value
> >>>  - multiply
> >>>  - reciprocal
> >>>  - convert to single precision
> >>>  - convert from single precision
> >>> Roland:
> >>>  - sqrt
> >>>  - comparaison (< / == / >)
> >>>  - floor/ceil
> >>> I will contact Pat Brown (His name appear in the contact field in [1])
> to
> >>> know if we need the function below for implement gpu_shader_fp64.
> >>>  - pow
> >>>  - exp
> >>>  - log
> >>>
> >>> About the license
> >>>
> >>> Like I mentioned in the project description, there are quite a few
> >>> existing C implementations of these functions.  Finding one of those
> >>> that you can understand and that has a compatible license is probably
> >>> the best place to start.
> >>>
> >>> Main Mesa code is under MIT license.
> >>> If I chose to use a GNU GPL license file like Linux kernel [3], my
> code must
> >>> be under GNU GPL and probably all the project too. Am I right?
> >>>
> >>> [1] https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt
> >>> [2] http://www.mesa3d.org/license.html
> >>> [3]
> >>>
> https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/arch/arm/nwfpe/softfloat.c
> >>
> >> You can't use GNU GPL for this project.
> >>
> >> The kernel as a whole is licensed under GNU GPL, but some source files
> >> aren't. The file you linked doesn't mention GNU GPL. Somebody needs to
> >> verify that the file you linked can be legally re-licensed under the
> >> MIT license. If not, I think you have to forget the contents of the
> >> file immediately, but I'm not a lawyer.
> >>
> >> Marek
> >> ___
> >> mesa-dev mailing list
> >> mesa-dev@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
> > Most BSD style licenses are legally compatible, as long as none of the
> > developers object. One of the BSD kernels should have a softfloat
> > implementation that would be license compatible.
>
> Yes, and there are a couple C compilers that have compatible licenses.
> Portable C Compiler (PCC) being one.  LLVM might also support some
> devices that lack floating-point hardware.
>
>
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
>
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-11 Thread Ian Romanick
On 03/10/2016 03:09 PM, Dylan Baker wrote:
> Quoting Marek Olšák (2016-03-10 06:57:57)
>> On Thu, Mar 10, 2016 at 3:30 PM, tournier.elie  
>> wrote:
>>> First, thank you all for your answers.
>>>
>>> So if I summarize what was said, we need
>>> Ian:
>>>  - add
>>>  - negate
>>>  - absolute value
>>>  - multiply
>>>  - reciprocal
>>>  - convert to single precision
>>>  - convert from single precision
>>> Roland:
>>>  - sqrt
>>>  - comparaison (< / == / >)
>>>  - floor/ceil
>>> I will contact Pat Brown (His name appear in the contact field in [1]) to
>>> know if we need the function below for implement gpu_shader_fp64.
>>>  - pow
>>>  - exp
>>>  - log
>>>
>>> About the license
>>>
>>> Like I mentioned in the project description, there are quite a few
>>> existing C implementations of these functions.  Finding one of those
>>> that you can understand and that has a compatible license is probably
>>> the best place to start.
>>>
>>> Main Mesa code is under MIT license.
>>> If I chose to use a GNU GPL license file like Linux kernel [3], my code must
>>> be under GNU GPL and probably all the project too. Am I right?
>>>
>>> [1] https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt
>>> [2] http://www.mesa3d.org/license.html
>>> [3]
>>> https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/arch/arm/nwfpe/softfloat.c
>>
>> You can't use GNU GPL for this project.
>>
>> The kernel as a whole is licensed under GNU GPL, but some source files
>> aren't. The file you linked doesn't mention GNU GPL. Somebody needs to
>> verify that the file you linked can be legally re-licensed under the
>> MIT license. If not, I think you have to forget the contents of the
>> file immediately, but I'm not a lawyer.
>>
>> Marek
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> Most BSD style licenses are legally compatible, as long as none of the
> developers object. One of the BSD kernels should have a softfloat
> implementation that would be license compatible.

Yes, and there are a couple C compilers that have compatible licenses.
Portable C Compiler (PCC) being one.  LLVM might also support some
devices that lack floating-point hardware.


> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 




signature.asc
Description: OpenPGP digital signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-10 Thread Connor Abbott
On Thu, Mar 10, 2016 at 9:30 AM, tournier.elie  wrote:
> First, thank you all for your answers.
>
> So if I summarize what was said, we need
> Ian:
>  - add
>  - negate
>  - absolute value
>  - multiply
>  - reciprocal
>  - convert to single precision
>  - convert from single precision
> Roland:
>  - sqrt
>  - comparaison (< / == / >)
>  - floor/ceil

One thing to note is that since Intel hw doesn't support reciprocal,
sqrt, rsqrt, or floor/ceil/truncate for doubles, our fp64
implementation (not merged yet, but soon will be) already includes
routines for emulating those things:
https://github.com/Igalia/mesa/blob/i965-fp64/src/compiler/nir/nir_lower_double_ops.c
and I suspect that since we're using the GLSL precision rules and
relying on the presence of 32-bit floating point operations (which
basically all GPU's support), it's a lot simpler than most other
softfloat libraries. To use this, you'd have to port it from NIR to
GLSL, but that shouldn't be too difficult. After that, the only thing
you'd need to implement would be add, multiply, absolute value,
negate, convert to/from single precision, and comparison.

> I will contact Pat Brown (His name appear in the contact field in [1]) to
> know if we need the function below for implement gpu_shader_fp64.
>  - pow
>  - exp
>  - log
>
> About the license
>
> Like I mentioned in the project description, there are quite a few
> existing C implementations of these functions.  Finding one of those
> that you can understand and that has a compatible license is probably
> the best place to start.
>
> Main Mesa code is under MIT license.
> If I chose to use a GNU GPL license file like Linux kernel [3], my code must
> be under GNU GPL and probably all the project too. Am I right?
>
> [1] https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt
> [2] http://www.mesa3d.org/license.html
> [3]
> https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/arch/arm/nwfpe/softfloat.c
>
> 2016-03-10 2:18 GMT+01:00 Roland Scheidegger :
>>
>> Am 09.03.2016 um 23:51 schrieb Ian Romanick:
>> > On 03/09/2016 02:25 AM, tournier.elie wrote:
>> >> Hi everyone.
>> >>
>> >> My name is Elie TOURNIER, I am enrolled in a French Engineering school
>> >> (Telecom Physique Strasbourg) specialized in Medical ICT.
>> >> I'm interested in implementing "Soft" double precision floating point
>> >> support [1].
>> >> Taking this subject seem to be a good way to get my feet wet in the
>> >> Mesa
>> >> code and discover how some of its components works.
>> >>
>> >> I come to you in order to become know but also to retrieve valuable
>> >> information for the success of this project.
>> >>
>> >> I would like to know more about the following things to understand your
>> >> requirements :
>> >> 1- "/Each double precision value would be stored in a uvec2/" The IEEE
>> >> double precision floating point standard representation requires a 64
>> >> bit: 1 for sign, 11 for exponent and the others for fraction [2].
>> >> -> How double precision value must be stored?
>> >
>> > As Emil mentioned, on GLSL 1.30, a uvec2 consists of two, 32-bit
>> > unsigned integers.  Each double precision value would be stored in a
>> > uvec2.
>> >
>> >> 2- Where can I find |GL_ARB_gpu_shader_fp64 |documentation|?
>> >> |
>> >>
>> >>
>> >> This is my first exposure to Mesa. Please excuse me if I am asking
>> >> basic
>> >> questions.
>> >
>> > For this particular project, you wouldn't need Mesa at all for quite
>> > some time.  All of the initial project should be done in "raw" GLSL
>> > 1.30, and any OpenGL implementation capable of GLSL 1.30 can be used.
>> > You would implement (and test!) a library of functions like 'uvec2
>> > addDouble(uvec2 a, uvec2 b)' that would provide all of the required
>> > double precision operations.
>> >
>> > The set of required functions should be pretty small.  I think:
>> >
>> >  - add
>> >  - negate
>> >  - absolute value
>> >  - multiply
>> >  - reciprocal
>> >  - convert to single precision
>> >  - convert from single precision
>> >  - pow (maybe?)
>> >  - exp (maybe?)
>> >  - log (maybe?)
>>
>> I don't think you need exp/log. At least glsl dosen't require it, though
>> the project isn't clear about it.
>> (pow all hw I know of with exactly one exception (that would be intel
>> graphics...) implements it as log2/mul/exp2 even for f32 anyway).
>> I think though you need sqrt (or rsqrt). And some functions for
>> rounding, plus comparison operations. Maybe min/max too (albeit if you
>> have comparisons you can emulate them of course).
>>
>> Roland
>>
>>
>> >
>> > I think everything else could be implemented using those functions.
>> >
>> > Like I mentioned in the project description, there are quite a few
>> > existing C implementations of these functions.  Finding one of those
>> > that you can understand and that has a compatible license is probably
>> > the best place to start.
>> >
>> >> Please point me to the right 

Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-10 Thread Dylan Baker
Quoting Marek Olšák (2016-03-10 06:57:57)
> On Thu, Mar 10, 2016 at 3:30 PM, tournier.elie  
> wrote:
> > First, thank you all for your answers.
> >
> > So if I summarize what was said, we need
> > Ian:
> >  - add
> >  - negate
> >  - absolute value
> >  - multiply
> >  - reciprocal
> >  - convert to single precision
> >  - convert from single precision
> > Roland:
> >  - sqrt
> >  - comparaison (< / == / >)
> >  - floor/ceil
> > I will contact Pat Brown (His name appear in the contact field in [1]) to
> > know if we need the function below for implement gpu_shader_fp64.
> >  - pow
> >  - exp
> >  - log
> >
> > About the license
> >
> > Like I mentioned in the project description, there are quite a few
> > existing C implementations of these functions.  Finding one of those
> > that you can understand and that has a compatible license is probably
> > the best place to start.
> >
> > Main Mesa code is under MIT license.
> > If I chose to use a GNU GPL license file like Linux kernel [3], my code must
> > be under GNU GPL and probably all the project too. Am I right?
> >
> > [1] https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt
> > [2] http://www.mesa3d.org/license.html
> > [3]
> > https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/arch/arm/nwfpe/softfloat.c
> 
> You can't use GNU GPL for this project.
> 
> The kernel as a whole is licensed under GNU GPL, but some source files
> aren't. The file you linked doesn't mention GNU GPL. Somebody needs to
> verify that the file you linked can be legally re-licensed under the
> MIT license. If not, I think you have to forget the contents of the
> file immediately, but I'm not a lawyer.
> 
> Marek
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Most BSD style licenses are legally compatible, as long as none of the
developers object. One of the BSD kernels should have a softfloat
implementation that would be license compatible.


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-10 Thread Ian Romanick
On 03/10/2016 06:30 AM, tournier.elie wrote:
> First, thank you all for your answers.
> 
> So if I summarize what was said, we need
> Ian:
>  - add
>  - negate
>  - absolute value
>  - multiply
>  - reciprocal
>  - convert to single precision
>  - convert from single precision
> Roland:
>  - sqrt

Reciprocal sqrt (rsqrt) is probably more useful.  You can then get sqrt
using reciprocal and rqsrt.

>  - comparaison (< / == / >)
>  - floor/ceil
> I will contact Pat Brown (His name appear in the contact field in [1])
> to know if we need the function below for implement gpu_shader_fp64.

Don't contact Pat.  He's a busy guy, and he probably won't respond. :)

We have to have some sort of implementation of every function in the
extension.  That's not the part that's under debate.  The part that is
under debate is whether specific operations are needed to implement the
functions.  For example, as Roland mentioned, you can implement pow
using exp and log.

>  - pow
>  - exp
>  - log

I looked back at the spec, and there are no pow, exponent, or logarithm
related functions.  I guess we get of easy there.  It may still be
interesting to eventually implement these, but that would be a much,
much, much later step.

> About the license
> 
> /Like I mentioned in the project description, there are quite a few
> existing C implementations of these functions.  Finding one of those
> that you can understand and that has a compatible license is probably
> the best place to start./
> 
> Main Mesa code is under MIT license.
> If I chose to use a GNU GPL license file like Linux kernel [3], my code
> must be under GNU GPL and probably all the project too. Am I right?
> 
> [1] https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt
> [2] http://www.mesa3d.org/license.html
> [3]
> https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/arch/arm/nwfpe/softfloat.c
> 
> 2016-03-10 2:18 GMT+01:00 Roland Scheidegger  >:
> 
> Am 09.03.2016 um 23:51 schrieb Ian Romanick:
> > On 03/09/2016 02:25 AM, tournier.elie wrote:
> >> Hi everyone.
> >>
> >> My name is Elie TOURNIER, I am enrolled in a French Engineering
> school
> >> (Telecom Physique Strasbourg) specialized in Medical ICT.
> >> I'm interested in implementing "Soft" double precision floating point
> >> support [1].
> >> Taking this subject seem to be a good way to get my feet wet in
> the Mesa
> >> code and discover how some of its components works.
> >>
> >> I come to you in order to become know but also to retrieve valuable
> >> information for the success of this project.
> >>
> >> I would like to know more about the following things to
> understand your
> >> requirements :
> >> 1- "/Each double precision value would be stored in a uvec2/" The
> IEEE
> >> double precision floating point standard representation requires a 64
> >> bit: 1 for sign, 11 for exponent and the others for fraction [2].
> >> -> How double precision value must be stored?
> >
> > As Emil mentioned, on GLSL 1.30, a uvec2 consists of two, 32-bit
> > unsigned integers.  Each double precision value would be stored in
> a uvec2.
> >
> >> 2- Where can I find |GL_ARB_gpu_shader_fp64 |documentation|?
> >> |
> >>
> >>
> >> This is my first exposure to Mesa. Please excuse me if I am
> asking basic
> >> questions.
> >
> > For this particular project, you wouldn't need Mesa at all for quite
> > some time.  All of the initial project should be done in "raw" GLSL
> > 1.30, and any OpenGL implementation capable of GLSL 1.30 can be used.
> > You would implement (and test!) a library of functions like 'uvec2
> > addDouble(uvec2 a, uvec2 b)' that would provide all of the required
> > double precision operations.
> >
> > The set of required functions should be pretty small.  I think:
> >
> >  - add
> >  - negate
> >  - absolute value
> >  - multiply
> >  - reciprocal
> >  - convert to single precision
> >  - convert from single precision
> >  - pow (maybe?)
> >  - exp (maybe?)
> >  - log (maybe?)
> 
> I don't think you need exp/log. At least glsl dosen't require it, though
> the project isn't clear about it.
> (pow all hw I know of with exactly one exception (that would be intel
> graphics...) implements it as log2/mul/exp2 even for f32 anyway).
> I think though you need sqrt (or rsqrt). And some functions for
> rounding, plus comparison operations. Maybe min/max too (albeit if you
> have comparisons you can emulate them of course).
> 
> Roland
> 
> 
> >
> > I think everything else could be implemented using those functions.
> >
> > Like I mentioned in the project description, there are quite a few
> > existing C implementations of these functions.  Finding one 

Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-10 Thread Marek Olšák
On Thu, Mar 10, 2016 at 3:30 PM, tournier.elie  wrote:
> First, thank you all for your answers.
>
> So if I summarize what was said, we need
> Ian:
>  - add
>  - negate
>  - absolute value
>  - multiply
>  - reciprocal
>  - convert to single precision
>  - convert from single precision
> Roland:
>  - sqrt
>  - comparaison (< / == / >)
>  - floor/ceil
> I will contact Pat Brown (His name appear in the contact field in [1]) to
> know if we need the function below for implement gpu_shader_fp64.
>  - pow
>  - exp
>  - log
>
> About the license
>
> Like I mentioned in the project description, there are quite a few
> existing C implementations of these functions.  Finding one of those
> that you can understand and that has a compatible license is probably
> the best place to start.
>
> Main Mesa code is under MIT license.
> If I chose to use a GNU GPL license file like Linux kernel [3], my code must
> be under GNU GPL and probably all the project too. Am I right?
>
> [1] https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt
> [2] http://www.mesa3d.org/license.html
> [3]
> https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/arch/arm/nwfpe/softfloat.c

You can't use GNU GPL for this project.

The kernel as a whole is licensed under GNU GPL, but some source files
aren't. The file you linked doesn't mention GNU GPL. Somebody needs to
verify that the file you linked can be legally re-licensed under the
MIT license. If not, I think you have to forget the contents of the
file immediately, but I'm not a lawyer.

Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-10 Thread tournier.elie
First, thank you all for your answers.

So if I summarize what was said, we need
Ian:
 - add
 - negate
 - absolute value
 - multiply
 - reciprocal
 - convert to single precision
 - convert from single precision
Roland:
 - sqrt
 - comparaison (< / == / >)
 - floor/ceil
I will contact Pat Brown (His name appear in the contact field in [1]) to
know if we need the function below for implement gpu_shader_fp64.
 - pow
 - exp
 - log

About the license




*Like I mentioned in the project description, there are quite a few
existing C implementations of these functions.  Finding one of those that
you can understand and that has a compatible license is probably the best
place to start.*

Main Mesa code is under MIT license.
If I chose to use a GNU GPL license file like Linux kernel [3], my code
must be under GNU GPL and probably all the project too. Am I right?

[1] https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt
[2] http://www.mesa3d.org/license.html
[3]
https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/arch/arm/nwfpe/softfloat.c

2016-03-10 2:18 GMT+01:00 Roland Scheidegger :

> Am 09.03.2016 um 23:51 schrieb Ian Romanick:
> > On 03/09/2016 02:25 AM, tournier.elie wrote:
> >> Hi everyone.
> >>
> >> My name is Elie TOURNIER, I am enrolled in a French Engineering school
> >> (Telecom Physique Strasbourg) specialized in Medical ICT.
> >> I'm interested in implementing "Soft" double precision floating point
> >> support [1].
> >> Taking this subject seem to be a good way to get my feet wet in the Mesa
> >> code and discover how some of its components works.
> >>
> >> I come to you in order to become know but also to retrieve valuable
> >> information for the success of this project.
> >>
> >> I would like to know more about the following things to understand your
> >> requirements :
> >> 1- "/Each double precision value would be stored in a uvec2/" The IEEE
> >> double precision floating point standard representation requires a 64
> >> bit: 1 for sign, 11 for exponent and the others for fraction [2].
> >> -> How double precision value must be stored?
> >
> > As Emil mentioned, on GLSL 1.30, a uvec2 consists of two, 32-bit
> > unsigned integers.  Each double precision value would be stored in a
> uvec2.
> >
> >> 2- Where can I find |GL_ARB_gpu_shader_fp64 |documentation|?
> >> |
> >>
> >>
> >> This is my first exposure to Mesa. Please excuse me if I am asking basic
> >> questions.
> >
> > For this particular project, you wouldn't need Mesa at all for quite
> > some time.  All of the initial project should be done in "raw" GLSL
> > 1.30, and any OpenGL implementation capable of GLSL 1.30 can be used.
> > You would implement (and test!) a library of functions like 'uvec2
> > addDouble(uvec2 a, uvec2 b)' that would provide all of the required
> > double precision operations.
> >
> > The set of required functions should be pretty small.  I think:
> >
> >  - add
> >  - negate
> >  - absolute value
> >  - multiply
> >  - reciprocal
> >  - convert to single precision
> >  - convert from single precision
> >  - pow (maybe?)
> >  - exp (maybe?)
> >  - log (maybe?)
>
> I don't think you need exp/log. At least glsl dosen't require it, though
> the project isn't clear about it.
> (pow all hw I know of with exactly one exception (that would be intel
> graphics...) implements it as log2/mul/exp2 even for f32 anyway).
> I think though you need sqrt (or rsqrt). And some functions for
> rounding, plus comparison operations. Maybe min/max too (albeit if you
> have comparisons you can emulate them of course).
>
> Roland
>
>
> >
> > I think everything else could be implemented using those functions.
> >
> > Like I mentioned in the project description, there are quite a few
> > existing C implementations of these functions.  Finding one of those
> > that you can understand and that has a compatible license is probably
> > the best place to start.
> >
> >> Please point me to the right resources so that I can better understand
> >> the project. I would also be happy to fix a bug to familiarize myself
> >> with the source code. Any suggestions on bugs that are relevant to the
> >> project will be of great help.
> >>
> >> Regards,
> >> Elie
> >>
> >> [1]
> >>
> http://www.x.org/wiki/SummerOfCodeIdeas/#softdoubleprecisionfloatingpointsupport
> >> [2] http://steve.hollasch.net/cgindex/coding/ieeefloat.html#storage
> >>
> >> PS: If you have any questions, please don't hesitate to contact me.
> >>
> >>
> >> ___
> >> mesa-dev mailing list
> >> mesa-dev@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org

Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-09 Thread Roland Scheidegger
Am 09.03.2016 um 23:51 schrieb Ian Romanick:
> On 03/09/2016 02:25 AM, tournier.elie wrote:
>> Hi everyone.
>>
>> My name is Elie TOURNIER, I am enrolled in a French Engineering school
>> (Telecom Physique Strasbourg) specialized in Medical ICT.
>> I'm interested in implementing "Soft" double precision floating point
>> support [1].
>> Taking this subject seem to be a good way to get my feet wet in the Mesa
>> code and discover how some of its components works.
>>
>> I come to you in order to become know but also to retrieve valuable
>> information for the success of this project.
>>
>> I would like to know more about the following things to understand your
>> requirements :
>> 1- "/Each double precision value would be stored in a uvec2/" The IEEE
>> double precision floating point standard representation requires a 64
>> bit: 1 for sign, 11 for exponent and the others for fraction [2].
>> -> How double precision value must be stored?
> 
> As Emil mentioned, on GLSL 1.30, a uvec2 consists of two, 32-bit
> unsigned integers.  Each double precision value would be stored in a uvec2.
> 
>> 2- Where can I find |GL_ARB_gpu_shader_fp64 |documentation|?
>> |
>>
>>
>> This is my first exposure to Mesa. Please excuse me if I am asking basic
>> questions.
> 
> For this particular project, you wouldn't need Mesa at all for quite
> some time.  All of the initial project should be done in "raw" GLSL
> 1.30, and any OpenGL implementation capable of GLSL 1.30 can be used.
> You would implement (and test!) a library of functions like 'uvec2
> addDouble(uvec2 a, uvec2 b)' that would provide all of the required
> double precision operations.
> 
> The set of required functions should be pretty small.  I think:
> 
>  - add
>  - negate
>  - absolute value
>  - multiply
>  - reciprocal
>  - convert to single precision
>  - convert from single precision
>  - pow (maybe?)
>  - exp (maybe?)
>  - log (maybe?)

I don't think you need exp/log. At least glsl dosen't require it, though
the project isn't clear about it.
(pow all hw I know of with exactly one exception (that would be intel
graphics...) implements it as log2/mul/exp2 even for f32 anyway).
I think though you need sqrt (or rsqrt). And some functions for
rounding, plus comparison operations. Maybe min/max too (albeit if you
have comparisons you can emulate them of course).

Roland


> 
> I think everything else could be implemented using those functions.
> 
> Like I mentioned in the project description, there are quite a few
> existing C implementations of these functions.  Finding one of those
> that you can understand and that has a compatible license is probably
> the best place to start.
> 
>> Please point me to the right resources so that I can better understand
>> the project. I would also be happy to fix a bug to familiarize myself 
>> with the source code. Any suggestions on bugs that are relevant to the
>> project will be of great help.
>>
>> Regards,
>> Elie
>>
>> [1]
>> http://www.x.org/wiki/SummerOfCodeIdeas/#softdoubleprecisionfloatingpointsupport
>> [2] http://steve.hollasch.net/cgindex/coding/ieeefloat.html#storage
>>
>> PS: If you have any questions, please don't hesitate to contact me.
>>
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-09 Thread Ian Romanick
On 03/09/2016 02:25 AM, tournier.elie wrote:
> Hi everyone.
> 
> My name is Elie TOURNIER, I am enrolled in a French Engineering school
> (Telecom Physique Strasbourg) specialized in Medical ICT.
> I'm interested in implementing "Soft" double precision floating point
> support [1].
> Taking this subject seem to be a good way to get my feet wet in the Mesa
> code and discover how some of its components works.
> 
> I come to you in order to become know but also to retrieve valuable
> information for the success of this project.
> 
> I would like to know more about the following things to understand your
> requirements :
> 1- "/Each double precision value would be stored in a uvec2/" The IEEE
> double precision floating point standard representation requires a 64
> bit: 1 for sign, 11 for exponent and the others for fraction [2].
> -> How double precision value must be stored?

As Emil mentioned, on GLSL 1.30, a uvec2 consists of two, 32-bit
unsigned integers.  Each double precision value would be stored in a uvec2.

> 2- Where can I find |GL_ARB_gpu_shader_fp64 |documentation|?
> |
> 
> 
> This is my first exposure to Mesa. Please excuse me if I am asking basic
> questions.

For this particular project, you wouldn't need Mesa at all for quite
some time.  All of the initial project should be done in "raw" GLSL
1.30, and any OpenGL implementation capable of GLSL 1.30 can be used.
You would implement (and test!) a library of functions like 'uvec2
addDouble(uvec2 a, uvec2 b)' that would provide all of the required
double precision operations.

The set of required functions should be pretty small.  I think:

 - add
 - negate
 - absolute value
 - multiply
 - reciprocal
 - convert to single precision
 - convert from single precision
 - pow (maybe?)
 - exp (maybe?)
 - log (maybe?)

I think everything else could be implemented using those functions.

Like I mentioned in the project description, there are quite a few
existing C implementations of these functions.  Finding one of those
that you can understand and that has a compatible license is probably
the best place to start.

> Please point me to the right resources so that I can better understand
> the project. I would also be happy to fix a bug to familiarize myself 
> with the source code. Any suggestions on bugs that are relevant to the
> project will be of great help.
> 
> Regards,
> Elie
> 
> [1]
> http://www.x.org/wiki/SummerOfCodeIdeas/#softdoubleprecisionfloatingpointsupport
> [2] http://steve.hollasch.net/cgindex/coding/ieeefloat.html#storage
> 
> PS: If you have any questions, please don't hesitate to contact me.
> 
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-09 Thread Emil Velikov
Hello Elie,

On 9 March 2016 at 10:25, tournier.elie  wrote:
> Hi everyone.
>
> My name is Elie TOURNIER, I am enrolled in a French Engineering school
> (Telecom Physique Strasbourg) specialized in Medical ICT.
> I'm interested in implementing "Soft" double precision floating point
> support [1].
> Taking this subject seem to be a good way to get my feet wet in the Mesa
> code and discover how some of its components works.
>
> I come to you in order to become know but also to retrieve valuable
> information for the success of this project.
>
> I would like to know more about the following things to understand your
> requirements :
> 1- "Each double precision value would be stored in a uvec2" The IEEE double
> precision floating point standard representation requires a 64 bit: 1 for
> sign, 11 for exponent and the others for fraction [2].
> -> How double precision value must be stored?
As one cannot assume the presence of doubles, one will need to return
the value as a two "unsigned" values. uvec2 the GLSL data type that
represents that. I believe one should at least basic understanding of
GLSL for this project.

https://www.opengl.org/wiki/Data_Type_(GLSL)

> 2- Where can I find GL_ARB_gpu_shader_fp64 documentation?
>
https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt

>
> This is my first exposure to Mesa. Please excuse me if I am asking basic
> questions.
>
> Please point me to the right resources so that I can better understand the
> project. I would also be happy to fix a bug to familiarize myself  with the
> source code. Any suggestions on bugs that are relevant to the project will
> be of great help.
>
First I would suggest that you rebuild mesa master based on your
distribution's recommended method. You should be comfortable doing
this and using the final package.

Skim though the git history, see if any of that make sense, is too
easy/hard, etc.

Past that you should demonstrate your ability to understand code,
using git and getting to know the procedure of creating patches,
submission and review. See http://mesa3d.org/devinfo.html for some of
the bits.

On the question of "what patches" - I would start with something easy.
From resolving build warnings to tackling/skimming through the bugs
lists - depending on your hardware. I believe we ought to have a list
of simple contributions somewhere, but I cannot find it atm.

https://bugs.freedesktop.org/buglist.cgi?action=wrap_status=NEW=Drivers%2FDRI%2Fnouveau
https://bugs.freedesktop.org/buglist.cgi?action=wrap_status=NEW=Drivers%2FDRI%2Fi965

Last but not least, do come around in #dri-devel at FreeNode. Try to
get the feel what people are talking about and ping prospective
mentors.

I believe that's enough information to keep you busy for a bit, if not
do follow up. Be that here or on IRC.

Regards,
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [GSoC2016] Interested in implementing "Soft" double precision floating point support

2016-03-09 Thread tournier.elie
Hi everyone.

My name is Elie TOURNIER, I am enrolled in a French Engineering school
(Telecom Physique Strasbourg) specialized in Medical ICT.
I'm interested in implementing "Soft" double precision floating point
support [1].
Taking this subject seem to be a good way to get my feet wet in the Mesa
code and discover how some of its components works.

I come to you in order to become know but also to retrieve valuable
information for the success of this project.

I would like to know more about the following things to understand your
requirements :
1- "*Each double precision value would be stored in a uvec2*" The IEEE
double precision floating point standard representation requires a 64 bit:
1 for sign, 11 for exponent and the others for fraction [2].
-> How double precision value must be stored?
2- Where can I find GL_ARB_gpu_shader_fp64 documentation?


This is my first exposure to Mesa. Please excuse me if I am asking basic
questions.

Please point me to the right resources so that I can better understand the
project. I would also be happy to fix a bug to familiarize myself  with the
source code. Any suggestions on bugs that are relevant to the project will
be of great help.

Regards,
Elie

[1]
http://www.x.org/wiki/SummerOfCodeIdeas/#softdoubleprecisionfloatingpointsupport
[2] http://steve.hollasch.net/cgindex/coding/ieeefloat.html#storage

PS: If you have any questions, please don't hesitate to contact me.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev