September 18, 2018
On Friday, 7 September 2018 at 10:53:25 UTC, Sobaya wrote:
> On Friday, 7 September 2018 at 10:17:47 UTC, Nicholas Wilson wrote:
>> On Friday, 7 September 2018 at 06:45:32 UTC, Sobaya wrote:
>>>[...]
>>
>> You're missing an "m" in "nvvm", dunno if that will fix it.
>>
>>> [...]
>>
>> I'll be adding these to DCompute soon (probably Sunday), LLVM7.0 has just been released and I've been waiting on that to do testing.
>
> I understand about the release.
>
> But missing "m" is just my typo here. I wrote "llvm.nvvm.cos" correctly on my code, and error occurred.

I'm waiting for the update. How's your progress?

Still it doesn't work well in my environment.

If you know temporary solution for use "cos" or "sin", I want to try it.

Thank you.
September 18, 2018
On Tuesday, 18 September 2018 at 00:25:33 UTC, Sobaya wrote:
> On Friday, 7 September 2018 at 10:53:25 UTC, Sobaya wrote:
>> On Friday, 7 September 2018 at 10:17:47 UTC, Nicholas Wilson wrote:
>>> On Friday, 7 September 2018 at 06:45:32 UTC, Sobaya wrote:
>>>>[...]
>>>
>>> You're missing an "m" in "nvvm", dunno if that will fix it.
>>>
>>>> [...]
>>>
>>> I'll be adding these to DCompute soon (probably Sunday), LLVM7.0 has just been released and I've been waiting on that to do testing.
>>
>> I understand about the release.
>>
>> But missing "m" is just my typo here. I wrote "llvm.nvvm.cos" correctly on my code, and error occurred.
>
> I'm waiting for the update. How's your progress?
>
> Still it doesn't work well in my environment.
>
> If you know temporary solution for use "cos" or "sin", I want to try it.
>
> Thank you.

Sorry you need to add a size for the argument "llvm.nvvm.cos.f32" for float or copy what is done in ldc/intrinsics.di with a template for "llvm.nvvm.cos.f#"


September 18, 2018
On Tuesday, 18 September 2018 at 00:25:33 UTC, Sobaya wrote:
> I'm waiting for the update. How's your progress?

I t appears I have broke SPIR-V completely somewhere along the line, I may release a v0.2 with out it, hopefully within the week.
September 18, 2018
On Tuesday, 18 September 2018 at 01:39:51 UTC, Nicholas Wilson wrote:
> On Tuesday, 18 September 2018 at 00:25:33 UTC, Sobaya wrote:
>> I'm waiting for the update. How's your progress?
>
> I t appears I have broke SPIR-V completely somewhere along the line, I may release a v0.2 with out it, hopefully within the week.

I declared like:

pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
T cos(T)(T val)
    if (__traits(isFloating, T));

It also doesn't work.
September 19, 2018
On Tuesday, 18 September 2018 at 06:25:33 UTC, Sobaya wrote:
> On Tuesday, 18 September 2018 at 01:39:51 UTC, Nicholas Wilson wrote:
>> On Tuesday, 18 September 2018 at 00:25:33 UTC, Sobaya wrote:
>>> I'm waiting for the update. How's your progress?
>>
>> I t appears I have broke SPIR-V completely somewhere along the line, I may release a v0.2 with out it, hopefully within the week.
>
> I declared like:
>
> pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
> T cos(T)(T val)
>     if (__traits(isFloating, T));
>
> It also doesn't work.

 pragma(LDC_intrinsic, "llvm.nvvm.cos.f#") // note the # in place of 32
T cos(T)(T val)
     if (__traits(isFloating, T));
(Just don't use real with it.)

OR

pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
 float cos(float val)
September 19, 2018
On Wednesday, 19 September 2018 at 00:11:13 UTC, Nicholas Wilson wrote:
> On Tuesday, 18 September 2018 at 06:25:33 UTC, Sobaya wrote:
>> On Tuesday, 18 September 2018 at 01:39:51 UTC, Nicholas Wilson wrote:
>>> On Tuesday, 18 September 2018 at 00:25:33 UTC, Sobaya wrote:
>>>> I'm waiting for the update. How's your progress?
>>>
>>> I t appears I have broke SPIR-V completely somewhere along the line, I may release a v0.2 with out it, hopefully within the week.
>>
>> I declared like:
>>
>> pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
>> T cos(T)(T val)
>>     if (__traits(isFloating, T));
>>
>> It also doesn't work.
>
>  pragma(LDC_intrinsic, "llvm.nvvm.cos.f#") // note the # in place of 32
> T cos(T)(T val)
>      if (__traits(isFloating, T));
> (Just don't use real with it.)
>
> OR
>
> pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
>  float cos(float val)

And if they don't work, use

>  pragma(LDC_intrinsic, "llvm.cos.f#") // note the # in place of 32
> T cos(T)(T val)
>      if (__traits(isFloating, T));
> (Just don't use real with it.)
>
September 20, 2018
On Wednesday, 19 September 2018 at 00:22:44 UTC, Nicholas Wilson wrote:
> On Wednesday, 19 September 2018 at 00:11:13 UTC, Nicholas Wilson wrote:
>> On Tuesday, 18 September 2018 at 06:25:33 UTC, Sobaya wrote:
>>> On Tuesday, 18 September 2018 at 01:39:51 UTC, Nicholas Wilson wrote:
>>>> On Tuesday, 18 September 2018 at 00:25:33 UTC, Sobaya wrote:
>>>>> I'm waiting for the update. How's your progress?
>>>>
>>>> I t appears I have broke SPIR-V completely somewhere along the line, I may release a v0.2 with out it, hopefully within the week.
>>>
>>> I declared like:
>>>
>>> pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
>>> T cos(T)(T val)
>>>     if (__traits(isFloating, T));
>>>
>>> It also doesn't work.
>>
>>  pragma(LDC_intrinsic, "llvm.nvvm.cos.f#") // note the # in place of 32
>> T cos(T)(T val)
>>      if (__traits(isFloating, T));
>> (Just don't use real with it.)
>>
>> OR
>>
>> pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
>>  float cos(float val)
>
> And if they don't work, use
>
>>  pragma(LDC_intrinsic, "llvm.cos.f#") // note the # in place of 32
>> T cos(T)(T val)
>>      if (__traits(isFloating, T));
>> (Just don't use real with it.)

"llvm.nvvm.cos.f#" and "llvm.nvvm.cos.f32" don't work.

And when I use "llvm.cos.f#", Another error occurred in linking.

LLVM ERROR: Cannot select: 0xe0d4798: f32 = fcos ConstantFP:f32<0.000000e+00>
  0xe0b9db0: f32 = ConstantFP<0.000000e+00>


September 20, 2018
On Thursday, 20 September 2018 at 05:16:04 UTC, Sobaya wrote:
> On Wednesday, 19 September 2018 at 00:22:44 UTC, Nicholas Wilson wrote:
>> On Wednesday, 19 September 2018 at 00:11:13 UTC, Nicholas Wilson wrote:
>>> On Tuesday, 18 September 2018 at 06:25:33 UTC, Sobaya wrote:
>>>> On Tuesday, 18 September 2018 at 01:39:51 UTC, Nicholas Wilson wrote:
>>>>> On Tuesday, 18 September 2018 at 00:25:33 UTC, Sobaya wrote:
>>>>>> I'm waiting for the update. How's your progress?
>>>>>
>>>>> I t appears I have broke SPIR-V completely somewhere along the line, I may release a v0.2 with out it, hopefully within the week.
>>>>
>>>> I declared like:
>>>>
>>>> pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
>>>> T cos(T)(T val)
>>>>     if (__traits(isFloating, T));
>>>>
>>>> It also doesn't work.
>>>
>>>  pragma(LDC_intrinsic, "llvm.nvvm.cos.f#") // note the # in place of 32
>>> T cos(T)(T val)
>>>      if (__traits(isFloating, T));
>>> (Just don't use real with it.)
>>>
>>> OR
>>>
>>> pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
>>>  float cos(float val)
>>
>> And if they don't work, use
>>
>>>  pragma(LDC_intrinsic, "llvm.cos.f#") // note the # in place of 32
>>> T cos(T)(T val)
>>>      if (__traits(isFloating, T));
>>> (Just don't use real with it.)
>
> "llvm.nvvm.cos.f#" and "llvm.nvvm.cos.f32" don't work.
>
> And when I use "llvm.cos.f#", Another error occurred in linking.
>
> LLVM ERROR: Cannot select: 0xe0d4798: f32 = fcos ConstantFP:f32<0.000000e+00>
>   0xe0b9db0: f32 = ConstantFP<0.000000e+00>

Hmm, I can reproduce. Will look into it.
September 20, 2018
On Thursday, 20 September 2018 at 12:43:02 UTC, Nicholas Wilson wrote:
> Hmm, I can reproduce. Will look into it.

pragma(LDC_intrinsic, "llvm.nvvm.cos.approx.f")
float cos(float val);

does work but is an approximation.
September 25, 2018
On Thursday, 20 September 2018 at 12:48:14 UTC, Nicholas Wilson wrote:
> On Thursday, 20 September 2018 at 12:43:02 UTC, Nicholas Wilson wrote:
>> Hmm, I can reproduce. Will look into it.
>
> pragma(LDC_intrinsic, "llvm.nvvm.cos.approx.f")
> float cos(float val);
>
> does work but is an approximation.

It works for me.

I'll use it currently.

Thanks!