2 Replies Latest reply on Jun 9, 2009 2:34 AM by edward_yang

    gcc x86 intrinsics not working?

    edward_yang

      Hi, it appears that openCC does not support gcc's x86 intrinsics. For example, the follow short program would compile under gcc 4.2 or 4.3 but not openCC 4.2.2:

       

      #include <stdio.h>
      #include <arpa/inet.h>
      //#include <xmmintrin.h>

      #define LOADDQU __builtin_ia32_loaddqu
      #define PCMPEQB __builtin_ia32_pcmpeqb128
      #define PMOVMSKB __builtin_ia32_pmovmskb128

      typedef uint8_t v128b_t __attribute__ ((vector_size (16)));

      int main(int argc, char** argv)
      {
      register v128b_t input_set1, input_set2;
      uint32_t dimem = (uint32_t)*argv[1];
      dimem |= (dimem<<8);
      dimem |= (dimem<<16);

      __asm__ ("movddup %1, %0\n\t"
      "movsldup %0, %0"
      : "=&x"(input_set1) : "m"(dimem));

      input_set2 = LOADDQU(argv[2]);
      input_set1 = PCMPEQB(input_set1, input_set2);
      dimem = PMOVMSKB(input_set1);

      printf("compare result: %04x\n", dimem);
      }

       

      When trying to compile this using openCC, the following error message occurs:

       

      ### Assertion failure at line 6468 of ../../be/cg/x8664/expand.cxx:
      ### Compiler Error in file cmp1x16.cc during Code_Expansion phase:
      ### Exp_Intrinsic_Op: unsupported intrinsic ((null))
      openCC INTERNAL ERROR: /opt/x86_open64-4.2.2.1/lib/gcc-lib/x86_64-open64-linux/4.2.2.1/be returned non-zero status 1

       

      Is this normal, or did I install the compiler correctly? Thanks.

       

        • gcc x86 intrinsics not working?
          ganesan.namasivayam

          Hi Edward,

          open64 supports x86 instruction, if I comment the following statement your code compiles thro.

          input_set2 = LOADDQU(argv[2]);

          input_set1 = PCMPEQB(input_set1, input_set2);

          /* em = PMOVMSKB(input_set1, input_set2);  */ <=========

          I guess, there could be bug in compiler for the intrinsic PMOVMSKB. But, needs to be investigated further

           

          Regards,

          Ganesan


          The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors. Links to third party sites are for convenience only, and no endorsement is implied