Comments (5)
If we are content always to assemble a SIB
byte when accessing memory, the differences between R12
and other registers vanishes. This adds one byte of code per memory access. A good trade?
We would still need to special-case SP-relative and program-relative addressing.
from mijit.
Would it be too terrible just to emit the extra byte when R12 is used?
from mijit.
It wouldn't be terrible, no. It would be hidden in a black box, and it's probably less work than e.g. making separate methods for assembling R12
-relative memory accesses. Maybe we should just do that.
Especially since we could do the same for SP
-relative addressing. I recently realized that we're going to have to assemble instructions to add constants to SP
; they could be unified too if SP
is just another register. There are monsters in push RSP
and push [RSP]
, and similarly for pop
, but I suppose it's not my problem if callers engage those monsters.
By the way, we could save way more bytes by using 8-bit immediate constants where possible. I've been ignoring that optimization until now, so I should probably rethink what is and is not worth doing. Maybe I should just ignore R12 completely until the ambient ambition level rises.
from mijit.
Based on today's work, I've added multiplication, division and conditional moves to the list of requirements. Conditional moves are needed for maximum and minimum operations, and also for absolute value.
from mijit.
Closing in favour of #8, #9 and #10.
from mijit.
Related Issues (20)
- Spin off Beetle as a separate project that depends on Mijit HOT 1
- ARM backend HOT 1
- Extend the target abstraction layer to cover optimization
- Add profiling counters HOT 3
- Write tests for high register pressure
- `optimizer::Simulation` should understand `Push` and `Pop` instructions
- Exceptions
- Rename `is_true` to `invert` in conditionals HOT 1
- Changes to trait Lower HOT 1
- Test Lower HOT 1
- Make `Action::Push` and `Action::Pop` operate on pairs of words.
- `aarch64::Assembler::mem()` should take an `enum Address` HOT 1
- Rename `code::Value` to `code::Variable`.
- Examples of bad code
- Cannot build mijit 0.1.1 with rustc 1.51 HOT 3
- Store code in a more abstract form
- Redesign JIT API: Expose EBB HOT 1
- Do not call mprotect unnecessarily
- Peephole optimize code as it is added to `Dataflow`
- Separate `new_exit()`, `new_label()` and `new_entry()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mijit.