MCPcopy Create free account
hub / github.com/OFFTKP/felix86 / LUI

Method LUI

external/biscuit/src/assembler.cpp:493–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493void Assembler::LUI(GPR rd, uint32_t imm) noexcept {
494 if (IsOptimizationEnabled(Optimization::AutoCompress)) {
495 // Sign-extend the bottom 6 bits to check if the 20 bits we are using LUI on are 6 sign-extended bits
496 uint32_t sign_extended = static_cast<uint32_t>(static_cast<int32_t>(imm << 26) >> 26);
497 if ((sign_extended & 0x000FFFFF) == (imm & 0x000FFFFF)) {
498 if (rd != x0 && rd != x2 && imm != 0) {
499 C_LUI(rd, imm & 0x3F);
500 return;
501 }
502 }
503 }
504
505 EmitUType(m_buffer, imm, rd, 0b0110111);
506}
507
508void Assembler::LW(GPR rd, int32_t imm, GPR rs) noexcept {
509 BISCUIT_ASSERT(IsValidSigned12BitImm(imm));

Calls 1

EmitUTypeFunction · 0.85

Tested by

no test coverage detected