NO

Author Topic: SSE intrinsics : _mm_storel_pi function  (Read 4168 times)

Offline PaoloC13

  • Member
  • *
  • Posts: 44
SSE intrinsics : _mm_storel_pi function
« on: December 26, 2020, 10:49:45 PM »
Hi,
I'm having an issue with the _mm_storel_pi function, from the xmmintrin.h header.
I've an open source library's header that calls this function, but it is undeclared.
I see the _mm_storel_pi declaration in xmmintrin.h is commented out.

Any tip to overcome this stop?

Offline John Z

  • Member
  • *
  • Posts: 860
Re: SSE intrinsics : _mm_storel_pi function
« Reply #1 on: December 27, 2020, 11:11:10 AM »
Hi,

This will not be much help, but it probably indicates that the function is not yet implemented within Pelles C libraries.

John Z

Offline PaoloC13

  • Member
  • *
  • Posts: 44
Re: SSE intrinsics : _mm_storel_pi function
« Reply #2 on: January 21, 2021, 12:40:57 AM »
I don't know how to get around this problem, maybe I should implement a function with the corresponding asm instructions?

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: SSE intrinsics : _mm_storel_pi function
« Reply #3 on: January 21, 2021, 01:06:23 PM »
Include <intrin.h>
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline PaoloC13

  • Member
  • *
  • Posts: 44
Re: SSE intrinsics : _mm_storel_pi function
« Reply #4 on: January 21, 2021, 10:45:21 PM »
Hi frankie
I tried to include <intrin.h>, but the compiler still can't find the _mm_storel_pi function, which I found in <xmmintrin.h> where it's commented out:

/* void __cdecl _mm_storel_pi(__m64 *, __m128); */

Where am I wrong?

Thanks

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: SSE intrinsics : _mm_storel_pi function
« Reply #5 on: January 22, 2021, 04:17:12 AM »
Pelles C don't have that

With MS cl
Code: [Select]
#include <intrin.h>
void foo(void)
{
__m128 m128 = {0};
__m64 m64;
_mm_storel_pi(&m64, m128);
}
Code: [Select]
_foo:
00000000  53                       push ebx
00000001  8BDC                     mov ebx, esp
00000003  83EC08                   sub esp, 8h
00000006  83E4F0                   and esp, -10h
00000009  83C404                   add esp, 4h
0000000C  55                       push ebp
0000000D  8B6B04                   mov ebp, dword ptr [ebx+4h]
00000010  896C2404                 mov dword ptr [esp+4h], ebp
00000014  8BEC                     mov ebp, esp
00000016  83EC20                   sub esp, 20h
00000019  33C0                     xor eax, eax
0000001B  8945E0                   mov dword ptr [ebp-20h], eax
0000001E  8945E4                   mov dword ptr [ebp-1Ch], eax
00000021  8945E8                   mov dword ptr [ebp-18h], eax
00000024  8945EC                   mov dword ptr [ebp-14h], eax
00000027  0F2845E0                 movaps xmm0, xmmword ptr [ebp-20h]
0000002B  0F1345F8                 movlps qword ptr [ebp-8h], xmm0
0000002F  8BE5                     mov esp, ebp
00000031  5D                       pop ebp
00000032  8BE3                     mov esp, ebx
00000034  5B                       pop ebx
00000035  C3                       ret
Code: [Select]
foo:
00000000  4057                     push rdi
00000002  4883EC20                 sub rsp, 20h
00000006  488D442410               lea rax, [rsp+10h]
0000000B  488BF8                   mov rdi, rax
0000000E  33C0                     xor eax, eax
00000010  B910000000               mov ecx, 10h
00000015  F3AA                     rep stosb
00000017  0F28442410               movaps xmm0, xmmword ptr [rsp+10h]
0000001C  0F130424                 movlps qword ptr [rsp], xmm0
00000020  4883C420                 add rsp, 20h
00000024  5F                       pop rdi
00000025  C3                       ret
« Last Edit: January 22, 2021, 09:42:11 AM by TimoVJL »
May the source be with you

Offline PaoloC13

  • Member
  • *
  • Posts: 44
Re: SSE intrinsics : _mm_storel_pi function
« Reply #6 on: January 27, 2021, 04:26:15 PM »
Hi TimoVJL,
thanks for the help.
As soon as I have time I'll try to build the function with the inline assembler.