Comments (3)
On Tue, May 26, 2015 at 7:23 PM, JF Bastien [email protected]
wrote:
Filing this issue to capture a discussion
WebAssembly/spec#79 (comment) that
occurred in PR #79 WebAssembly/spec#79.load/store are often spec'd as having an explicit type, and as being able
to implicitly sext/zext/trunc their inputs.I'm wondering if instead load/store should:
- Be sized to N bytes, and require explicit type cast for load outputs
and store input.- Require implicit trunc for stores, and sext/zext for loads.
What happens when there is no sext/zext after loads? What is the type of
the N bytes read?This is different from some compiler IRs, including LLVM's. However, the
current stated goal for this format is to keep it simple, and expect the
macro layer to capture redundancy. It seems like separating conversion,
extension and truncation out of load/store fits the goal.Keeping this simple doesn't prevent optimization. It's pretty easy to
detect this pattern when doing instruction selection, if such an
instruction even exists on the target architecture. It does mean the IR has
lees magic, and is even easier to spec and implement in a dump interpreter.—
Reply to this email directly or view it on GitHub
WebAssembly/spec#82.
from design.
IIUC, if we formalize validation as type checking (something that I think is attractive for multiple reasons), then we'd need special 1,2,4,8-byte types as the operands/result-types of load/store ops and the only other ops that would produce/consume these types would be the sext/zext/trunc ops. Thus, it doesn't seem like we'd be gaining much composability and, as a cost, we now have these irregular ops/types in our spec. We could identify the 4-byte int type with int32 and the 8-byte int type with int64, but that feels asymmetric (or pushes us to have int8/int16, something it seems noone is keen to do). So I don't see an elegance argument. Also, having irregular int8/int16 types could actually end up complicating a dumb compiler/interpreter, depending on how it was implemented. Lastly, I think it is a good goal to minimize the requisite number of "pattern matches assumed to be done by a baseline compiler to get good performance" to a minimum, and this would add several.
from design.
If we have int8 and int16, then we should do this. If we don't, then we shouldn't. I think we can close this issue and move any further discussion to #85.
from design.
Related Issues (20)
- The function string TrimEnd() remove all simbols \n from string HOT 1
- What's the plan for dlopen / dlsym support in WebAssembly?
- Thread Proposal and Determinism / Reproducibility HOT 1
- Design Engineer
- Dead PNaCl link in FAQ HOT 2
- Partially out-of-bound writes HOT 54
- Is it possible to run tcptraceroute with wasm HOT 1
- Broken links on https://webassembly.org/docs/portability/
- Frozen proposal HOT 8
- Link in "About" sidebar is broken. HOT 1
- 64-bit Widening Multiplication HOT 5
- Proposal: FP16 value type and operations HOT 2
- Correct Compilation to WebAssembly HOT 2
- updating and add java file
- [EcmaScript] 128-bit data type for import/export (SIMD) HOT 3
- https://github.com/WebAssembly/spec/issues/1740#issue-2190883550
- Custom Wasm page sizes HOT 13
- Version 1? HOT 5
- Compact import section format HOT 5
- Add runtime instantiation to component model HOT 1
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 design.