@@ -83,10 +83,12 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
8383 base::CPU cpu;
8484 if (cpu.has_fpu ()) supported_ |= 1u << FPU;
8585 if (cpu.has_rvv ()) supported_ |= 1u << RISCV_SIMD;
86+ #ifdef V8_COMPRESS_POINTERS
8687 if (cpu.riscv_mmu () == base::CPU::RV_MMU_MODE::kRiscvSV57 ) {
8788 FATAL (" SV57 is not supported" );
8889 UNIMPLEMENTED ();
8990 }
91+ #endif
9092 // Set a static value on whether SIMD is supported.
9193 // This variable is only used for certain archs to query SupportWasmSimd128()
9294 // at runtime in builtins using an extern ref. Other callers should use
@@ -1086,25 +1088,21 @@ void Assembler::GeneralLi(Register rd, int64_t imm) {
10861088
10871089void Assembler::li_ptr (Register rd, int64_t imm) {
10881090 base::CPU cpu;
1089- if (cpu.riscv_mmu () != base::CPU::RV_MMU_MODE::kRiscvSV57 ) {
1090- // Initialize rd with an address
1091- // Pointers are 48 bits
1092- // 6 fixed instructions are generated
1093- DCHECK_EQ ((imm & 0xfff0000000000000ll ), 0 );
1094- int64_t a6 = imm & 0x3f ; // bits 0:5. 6 bits
1095- int64_t b11 = (imm >> 6 ) & 0x7ff ; // bits 6:11. 11 bits
1096- int64_t high_31 = (imm >> 17 ) & 0x7fffffff ; // 31 bits
1097- int64_t high_20 = ((high_31 + 0x800 ) >> 12 ); // 19 bits
1098- int64_t low_12 = high_31 & 0xfff ; // 12 bits
1099- lui (rd, (int32_t )high_20);
1100- addi (rd, rd, low_12); // 31 bits in rd.
1101- slli (rd, rd, 11 ); // Space for next 11 bis
1102- ori (rd, rd, b11); // 11 bits are put in. 42 bit in rd
1103- slli (rd, rd, 6 ); // Space for next 6 bits
1104- ori (rd, rd, a6); // 6 bits are put in. 48 bis in rd
1105- } else {
1106- FATAL (" SV57 is not supported" );
1107- }
1091+ // Initialize rd with an address
1092+ // Pointers are 48 bits
1093+ // 6 fixed instructions are generated
1094+ DCHECK_EQ ((imm & 0xfff0000000000000ll ), 0 );
1095+ int64_t a6 = imm & 0x3f ; // bits 0:5. 6 bits
1096+ int64_t b11 = (imm >> 6 ) & 0x7ff ; // bits 6:11. 11 bits
1097+ int64_t high_31 = (imm >> 17 ) & 0x7fffffff ; // 31 bits
1098+ int64_t high_20 = ((high_31 + 0x800 ) >> 12 ); // 19 bits
1099+ int64_t low_12 = high_31 & 0xfff ; // 12 bits
1100+ lui (rd, (int32_t )high_20);
1101+ addi (rd, rd, low_12); // 31 bits in rd.
1102+ slli (rd, rd, 11 ); // Space for next 11 bis
1103+ ori (rd, rd, b11); // 11 bits are put in. 42 bit in rd
1104+ slli (rd, rd, 6 ); // Space for next 6 bits
1105+ ori (rd, rd, a6); // 6 bits are put in. 48 bis in rd
11081106}
11091107
11101108void Assembler::li_constant (Register rd, int64_t imm) {
0 commit comments