I got a Assembler error while compile mt19937

48 Views Asked by At

I have a C++ file test.cc as below:

#include <iostream>
#include <random>

int main()
{
    std::mt19937 rng(347 * 6007);
    std::cout << rng() << std::endl;
    return 0;
}

when I use command g++ ./test.cc -o test -O3 -march=native compile it, it failed:

[csc@fedora examples]$ g++ ./test.cc -o test -O3 -march=native
/tmp/ccvnwhuu.s: Assembler messages:
/tmp/ccvnwhuu.s:38: Error: selected processor does not support `eor3 v0.16b,v1.16b,v3.16b,v0.16b'
/tmp/ccvnwhuu.s:73: Error: selected processor does not support `eor3 v0.16b,v1.16b,v6.16b,v0.16b'

but if I use command g++ ./test.cc -o test -O3 or g++ ./test.cc -o test -march=native, it worked

Why this happened?

I'm using Linux fedora 6.5.10-200.fc38.aarch64 virtual machine with apple M1 chip(arm), and my g++ version is g++ (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)

0

There are 0 best solutions below