Comments (4)
there is absolutely no guarantee, that they won't throw
Could you please prove your statement?
Up to my knowledge, correct input is guaranteed by our unit tests suite.
Why are we using it?
This method is a GPROF bottleneck, so we remove exception handling code to optimize more aggressively.
from mipt-mips.
This will fail to compile:
auto is_in_RF( const Instr& instr, size_t src_index) const noexcept
{
static_assert(noexcept(instr.get_src( src_index)), "instr.get_src( src_index) may throw");
const auto reg_num = instr.get_src( src_index);
return get_entry( reg_num).current_stage.is_in_RF();
}
And this too
void RegisterStage::inc() noexcept
{
static_assert(noexcept(value + 1_lt), "Latency::operator +() is not noexcept too");
value = value + 1_lt;
}
So we are relying on some implicit thoughts about operations behaviour
from mipt-mips.
I don't get it. Why should we add these static assertions?
We are relying on some implicit thoughts about operations behaviour
These thoughts are explicit, since they are defined in unit tests.
Please correct me if I'm wrong.
I suspect you are trying to sell me "defensive programming" paradigm, where each function or procedure assumes the inputs may be incorrect.
MIPT-V does not use it. Instead, we prove there are no chances to generate these incorrect inputs.
from mipt-mips.
Ok, I understood, thanks for answer
from mipt-mips.
Related Issues (20)
- System calls should flush pipeline HOT 3
- Verify correctness of read-after-write behavior
- Make statistic dump better
- Support BSS and SBSS sections in ELF loader
- SLLI/SRLI/SRAI should ignore shamt bits which exceed register size
- External register writes should flush pipeline
- Use const std::array& here
- Fold RISC-V B instruction testing
- Implement ALU as a template class HOT 6
- Add code prefetching algorithms
- Deliver unit tests for JSON output
- assert() is always ignored HOT 1
- RISCV32 Physical memory mapping ? HOT 1
- Wrong "bfp" and "pack" instruction encoding on branch "ooo_window". HOT 2
- Build failing due to specifying template argument in ctor HOT 1
- Build fail: instr_#name not autogenerated HOT 1
- Update rori instruction according to specification HOT 1
- Update bseti instruction according to specification
- Adopt Clang-Format
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 mipt-mips.