Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Refactor - lduw to hor64 #496

Merged
merged 2 commits into from
Aug 3, 2023
Merged

Refactor - lduw to hor64 #496

merged 2 commits into from
Aug 3, 2023

Conversation

Lichtso
Copy link

@Lichtso Lichtso commented Aug 3, 2023

It makes more sense for the lduw (load upper word immediate) instruction introduced in #486 to be an arithmetic class instruction as it resembles or64 reg, imm the most, just that it is a high-operand version of it. This also empties the load immediate BPF instruction class in SBPFv2.


In the LLVM backend, the instruction info just needs to be adjusted slightly (marked as bold):
https://github.com/solana-labs/llvm-project/blob/7b8db05b564faffb522434b73b7082662171f94a/llvm/lib/Target/SBF/SBFInstrInfo.td#L337

first instructionsecond instruction
opdstsrcoffsetimmopdstsrcoffsetimm
before0x18reg000..320x0000032..64
after0xB4reg000..320xF7reg0032..64

@Lichtso Lichtso requested a review from alessandrod August 3, 2023 12:25
@codecov-commenter
Copy link

Codecov Report

Merging #496 (cbe0cd9) into main (42e5b3b) will decrease coverage by 0.01%.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##             main     #496      +/-   ##
==========================================
- Coverage   89.63%   89.63%   -0.01%     
==========================================
  Files          23       23              
  Lines       10105    10104       -1     
==========================================
- Hits         9058     9057       -1     
  Misses       1047     1047              
Files Changed Coverage Δ
src/disassembler.rs 93.36% <0.00%> (ø)
src/ebpf.rs 79.59% <ø> (ø)
src/assembler.rs 98.82% <100.00%> (-0.01%) ⬇️
src/interpreter.rs 97.67% <100.00%> (ø)
src/jit.rs 92.45% <100.00%> (ø)
src/static_analysis.rs 65.82% <100.00%> (ø)
src/verifier.rs 97.50% <100.00%> (ø)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants