loongson-community / linux-stable

Linux kernel source tree for Loongson
Other
67 stars 21 forks source link

在 loongson3A3000 上编译不过去呀? #19

Closed suijingfeng closed 4 years ago

suijingfeng commented 4 years ago
  AS      arch/mips/loongson64/loongson-3/loongson3-memset.o
arch/mips/loongson64/loongson-3/loongson3-memset.S: Assembler messages:
arch/mips/loongson64/loongson-3/loongson3-memset.S:102: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+0*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:102: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+1*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:102: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+2*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:102: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+3*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:102: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+4*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:102: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+5*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:102: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+6*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:102: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+7*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:118: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+0*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:118: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+1*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:118: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+2*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:118: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+3*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:118: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+4*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:118: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+5*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:118: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+6*16)($4)'
arch/mips/loongson64/loongson-3/loongson3-memset.S:118: Error: opcode not supported on this processor: loongson3a (mips64r2) `gssq $5,$5,(-128+7*16)($4)'
scripts/Makefile.build:403: recipe for target 'arch/mips/loongson64/loongson-3/loongson3-memset.o' failed
make[3]: *** [arch/mips/loongson64/loongson-3/loongson3-memset.o] Error 1
scripts/Makefile.build:544: recipe for target 'arch/mips/loongson64/loongson-3' failed
make[2]: *** [arch/mips/loongson64/loongson-3] Error 2
scripts/Makefile.build:544: recipe for target 'arch/mips/loongson64' failed
make[1]: *** [arch/mips/loongson64] Error 2
make[1]: *** 正在等待未完成的任务....
Makefile:1047: recipe for target 'arch/mips' failed
make: *** [arch/mips] Error 2
make: *** 正在等待未完成的任务....
make: *** wait: 没有子进程。 停止。
FlyGoat commented 4 years ago

是什么工具链?

另 最新的代码可以从这里拿

http://dev.lemote.com:8000/cgit/linux-official.git/

suijingfeng commented 4 years ago

谢谢: $ gcc -v 输出如下参数

使用内建 specs。
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/mips64el-redhat-linux/4.9.4/lto-wrapper
目标:mips64el-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-arch=loongson3a --with-fix-loongson3-llsc --enable-languages=c,c++,objc,obj-c++,fortran,go,lto --enable-plugin --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.4/obj-mips64el-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.4/obj-mips64el-redhat-linux/cloog-install --enable-gnu-indirect-function --with-long-double-128 --build=mips64el-redhat-linux
线程模型:posix
gcc 版本 4.9.4 20160726 (Red Hat 4.9.4-14) (GCC) 
FlyGoat commented 4 years ago

不应该不支持march=loongson3a啊。 这是我自用的交叉链: https://musl.cc/mips64el-linux-musl-cross.tgz 这个网站也有提供native链 可以试试:-)

suijingfeng commented 4 years ago

验证了,使用你给的连接的交叉编译器,可以编译过运行, gssq 是存四字节的指令, ftp://ftp.loongnix.org/doc/01user%20manual/loongson3a/ 连接里面的文档 Loongson3A processor user manual_P2_V1.3.pdf 说

gsSQ     存四字    GS464

是 GS464的,这可能是loongson自定义的指令, mip64r2 没有 ?

这里说 https://hev.cc/2573.html/comment-page-1

有的文档说loongson3a3000 实现的是两组64位的SSE, 有的文档有说实现的是两组128位的,我弄不太清楚 :(

但是我在x86上使用intrinsic作实验的时候发现,使用SSE不一定就快,因为有时需要将数据从内存加载到 SSE寄存器运算,算完了在放回内存有开销, 我有个疑问就是您对memcpy 和 memset 优化确定比使用普通寄存器快吗?