Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add riscv64 support #5

Conversation

sunmin89
Copy link
Contributor

@sunmin89 sunmin89 commented Jun 25, 2023

测试要求:

Host OS 建议是 较新版本的 Ubuntu,我的是Ubuntu 18.04.

  1. 安装交叉编译器
sudo apt install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu cpp-riscv64-linux-gnu
mkdir build
cd build
CROSS=riscv64-linux-gnu- ../configure --target=riscv64-linux-gcc --enable-unit-tests
make -j16
  1. 编译 riscv-gnu-toolchain
git clone git@github.com:riscv-collab/riscv-gnu-toolchain.git
cd riscv-gnu-toolchain
mkdir build
cd build 
export RISCV=/home/sunmin/bins/riscv-gnu-toolchain-bin-rvv
../configure --prefix=$RISCV --with-arch=rv64gcv --with-abi=lp64d
make linux -j28
  1. 编译 qemu
git clone https://github.com/qemu/qemu
cd qemu
git checkout remotes/origin/staging-7.2

./configure  --enable-kvm --enable-system --enable-sdl --enable-opengl --target-list="riscv64-softmmu,riscv64-linux-user"
make -j28

#设定 qemu 环境变量
export PATH=/home/sunmin/aosp-out/qemu/qemu/build:$PATH

sunmin@plct:~/rvv/libvpx/build-riscv64$ which qemu-riscv64
/home/sunmin/aosp-out/qemu/qemu/build/qemu-riscv64

sunmin@t5820:~/aosp-out/qemu/qemu$ qemu-riscv64 --version
qemu-riscv64 version 7.2.3 (v7.2.3)
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
  1. 在 qemu 虚拟环境中运行 libvpx 自带的测试程序
qemu-riscv64 -cpu rv64 -L $RISCV/sysroot ./test_libvpx
[==========] Running 10187 tests from 141 test suites.
[----------] Global test environment set-up.
[----------] 1 test from ByteAlignmentTest
[ RUN      ] ByteAlignmentTest.SwitchByteAlignment
../test/webm_video_source.h:43: Failure
Expected: (vpx_ctx_->file) != (nullptr), actual: NULL vs (nullptr)
Input file open failed. Filename: vp90-2-02-size-lf-1920x1080.webm
../test/byte_alignment_test.cc:132: Failure

Close issue #2

@sunmin89 sunmin89 changed the title libvpx[riscv]: Add riscv64 support. close libvpx[riscv]: Add riscv64 support Jun 25, 2023
@sunmin89 sunmin89 marked this pull request as ready for review June 25, 2023 06:34
@sunmin89 sunmin89 requested a review from unicornx June 25, 2023 06:35
@unicornx unicornx self-assigned this Jun 26, 2023
@unicornx unicornx changed the title libvpx[riscv]: Add riscv64 support Add riscv64 support Jun 26, 2023
@unicornx
Copy link
Contributor

更新了 pr 的 title 因为所在的 repo 和 工作已经明确了 仓库以及 ARCH

@unicornx
Copy link
Contributor

  • 目前暂时不清楚 rv 上是否有需要支持 runtime cpu detect 的需求,所以我建议在没有确定之前不要做相关改动,pr 中 vpx_ports 和 systemdependent.c 的相关改动目前都用不上,可以都先不要,以后确定了再加。
  • check_add_cxxflags -march=rv64gcv 这个检测似乎不起作用。

configure Outdated
@@ -284,6 +286,8 @@ ARCH_EXT_LIST="
vsx

${ARCH_EXT_LIST_LOONGSON}

rvv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议参考 LOONGSON 定义一个 ARCH_EXT_LIST_RISCV

configure Outdated
@@ -675,6 +679,11 @@ process_toolchain() {
check_add_cxxflags -Wno-psabi
fi

if enabled riscv64; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用了 TAB 键,需要替换为空格

@sunmin89 sunmin89 force-pushed the riscv64_android_optimization branch 2 times, most recently from e69cfae to e09c865 Compare June 26, 2023 10:20
@unicornx unicornx merged commit d085883 into aosp-riscv:riscv64_android_optimization Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants