diff options
author | 2023-03-15 13:36:40 +0800 | |
---|---|---|
committer | 2023-06-02 14:13:39 +0000 | |
commit | e7dd044ecf428701c3cf5c07ca6540ec38d2c3c2 (patch) | |
tree | 12e14f84327248c3c86f161232435c36c4143742 /compiler/utils/assembler_test_base.h | |
parent | f6886c25e059591dd617dd22556b2da20696878f (diff) |
Add assembler for riscv64, part 3.
Implement branches, literals and jump tables.
Fix some FP instructions.
Test: m test-art-host-gtest
Bug: 283082089
Signed-off-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Wendong Wang <wangwd@xcvmbyte.com>
Signed-off-by: Cao Xia <caoxia@eswincomputing.com>
Change-Id: Ib21d01b7cc0988e0a82a079fc039db3d5fcbfa14
Diffstat (limited to 'compiler/utils/assembler_test_base.h')
-rw-r--r-- | compiler/utils/assembler_test_base.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/utils/assembler_test_base.h b/compiler/utils/assembler_test_base.h index 8b76643e98..fb950f8237 100644 --- a/compiler/utils/assembler_test_base.h +++ b/compiler/utils/assembler_test_base.h @@ -142,8 +142,15 @@ class AssemblerTestBase : public testing::Test { InstructionSet isa = GetIsa(); switch (isa) { case InstructionSet::kRiscv64: - // TODO: Support compression (RV32C) in assembler and tests (add `c` to `-march=`). - return {FindTool("clang"), "--compile", "-target", "riscv64-linux-gnu", "-march=rv64imafd"}; + // TODO(riscv64): Support compression (RV32C) in assembler and tests (add `c` to `-march=`). + return {FindTool("clang"), + "--compile", + "-target", + "riscv64-linux-gnu", + "-march=rv64imafd", + // Force the assembler to fully emit branch instructions instead of leaving + // offsets unresolved with relocation information for the linker. + "-mno-relax"}; case InstructionSet::kX86: return {FindTool("clang"), "--compile", "-target", "i386-linux-gnu"}; case InstructionSet::kX86_64: @@ -167,6 +174,7 @@ class AssemblerTestBase : public testing::Test { "--disassemble", "--no-print-imm-hex", "--no-show-raw-insn", + "--mattr=+F,+D", // Disassemble "F" and "D" Standard Extensions. "-M", "no-aliases"}; default: |