diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 06:52:15 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 06:52:15 +0800 |
| commit | aa7c85ca71859aab15bdf1e6dc1ea3a5aa5d1e28 (patch) | |
| tree | 20d94c4debfe4900e362c6c7f8443bcfbd58ec28 /backend/unittests/Target/RISCVCodeGenTest.cpp | |
| parent | d62f022c92fcc3ebe2269273628943a0089683fd (diff) | |
| download | rcc-project-aa7c85ca71859aab15bdf1e6dc1ea3a5aa5d1e28.tar.gz rcc-project-aa7c85ca71859aab15bdf1e6dc1ea3a5aa5d1e28.tar.xz | |
[Support] Split APInt and APFloat ownership
Diffstat (limited to 'backend/unittests/Target/RISCVCodeGenTest.cpp')
| -rw-r--r-- | backend/unittests/Target/RISCVCodeGenTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/backend/unittests/Target/RISCVCodeGenTest.cpp b/backend/unittests/Target/RISCVCodeGenTest.cpp index c5fc10a..1bc3361 100644 --- a/backend/unittests/Target/RISCVCodeGenTest.cpp +++ b/backend/unittests/Target/RISCVCodeGenTest.cpp @@ -347,8 +347,8 @@ void testClassification(TestContext &Context) { return; const std::array<std::uint64_t, 1> SingleWords{0x3f800000U}; const std::array<std::uint64_t, 1> DoubleWords{0x3ff0000000000000ULL}; - auto SingleBits = rcc::FloatingPointBits::create(rcc::FloatSemantics::IEEESingle, SingleWords); - auto DoubleBits = rcc::FloatingPointBits::create(rcc::FloatSemantics::IEEEDouble, DoubleWords); + auto SingleBits = rcc::APFloat::create(rcc::FloatSemantics::IEEESingle, SingleWords); + auto DoubleBits = rcc::APFloat::create(rcc::FloatSemantics::IEEEDouble, DoubleWords); Context.expect(SingleBits.has_value() && DoubleBits.has_value(), "floating constant payloads must be constructible"); if (!SingleBits || !DoubleBits) @@ -875,7 +875,7 @@ void testAtomicCompareExchangeLegalization(TestContext &Context) { if (!AddressDefinition || !AddressDefinition->addDef(*Address) || !AddressDefinition->build()) return; const auto BuildConstant = [&](rcc::Register Destination, std::uint64_t Value) -> bool { - auto Immediate = rcc::IntegerImmediate::fromUnsigned(8, Value); + auto Immediate = rcc::APInt::fromUnsigned(8, Value); auto Pending = Builder.buildInstr(rcc::opcode(rcc::GenericOpcode::G_CONSTANT)); return Immediate && Pending && Pending->addDef(Destination) && Pending->addIntegerImmediate(std::move(*Immediate)) && Pending->build(); @@ -1013,7 +1013,7 @@ void testConstantExtensionPreservesLiveSource(TestContext &Context) { auto Source = (*Function)->registerInfo().createVirtualRegister(*I32); auto Extended = (*Function)->registerInfo().createVirtualRegister(*I64); auto PreservedUse = (*Function)->registerInfo().createVirtualRegister(*I32); - auto Immediate = rcc::IntegerImmediate::fromUnsigned(32, 7); + auto Immediate = rcc::APInt::fromUnsigned(32, 7); if (!Source || !Extended || !PreservedUse || !Immediate) return; @@ -1060,7 +1060,7 @@ void testIntegerCompareReusesConstantExtension(TestContext &Context) { rcc::MachineInstr *Compare = Function->firstBlock()->firstInstruction(); const rcc::Register *Right = Compare->operandAt(3)->getIf<rcc::Register>(); auto WideRight = Function->registerInfo().createVirtualRegister(*I64); - auto Immediate = rcc::IntegerImmediate::fromUnsigned(32, 0); + auto Immediate = rcc::APInt::fromUnsigned(32, 0); if (Right == nullptr || !WideRight || !Immediate) return; |
