| 491 | } |
| 492 | |
| 493 | void 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 | |
| 508 | void Assembler::LW(GPR rd, int32_t imm, GPR rs) noexcept { |
| 509 | BISCUIT_ASSERT(IsValidSigned12BitImm(imm)); |
no test coverage detected