LCD inline assembly expressions

NaN divide at by.zero
Sun Dec 23 13:00:54 UTC 2018


On Sunday, 23 December 2018 at 12:54:01 UTC, kinke wrote:
> On Sunday, 23 December 2018 at 01:27:40 UTC, NaN wrote:
>> int4 _mm_cmpgt_epi32(int4 a, int4 b) {
>>   return __asm!int4("pcmpgtd $1,$0", "=&r,r,r", a, b);
>> }
>
> This is a working variant (`r` is a GP register, `x` a vector 
> register for x86, see 
> https://llvm.org/docs/LangRef.html#supported-constraint-code-list):
>
> int4 _mm_cmpgt_epi32(int4 a, int4 b) {
>   int4 r = void;
>   __asm("pcmpgtd $1,$0; movdqa $0,$2", "x,x,*m", a, b, &r);
>   return r;
> }

Hi thanks, i was just coming here to post the solution as I 
figured it out after following the link to the llvm docs.

Is there any difference between using this vs the other method of 
doing intrinsics?




More information about the digitalmars-d-ldc mailing list