This patch has the most basic instruction codegen for 32 and 64 bit int/fp.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lgtm, with a few comments:
lib/Target/WebAssembly/WebAssemblyInstrFloat.td | ||
---|---|---|
24 ↗ | (On Diff #29702) | This should use ftrunc, rather than frint. Since WebAssembly doesn't expose floating-point exceptions, frint should map to the nearestint operator, similar to fnearbyint. |
39 ↗ | (On Diff #29702) | WebAssembly's current min and max operators return NaN if either operand is NaN, so they aren't the same as LLVM's fminnum and fmaxnum. (Actual minNum and maxNum operators are being considered as possible future features.) It's fine to just defer defining these for now. The NEON backends have similar instructions and will serve as examples of how to utilize them, when we're ready. |
lib/Target/WebAssembly/WebAssemblyInstrFormats.td | ||
33 ↗ | (On Diff #29702) | It's common and nice to prefix multiclass def names with an underscore, since they are concatenated onto the end of the instruction names they expand into. ADD_I32 will be nicer than ADDI32, especially as we add more opcodes where the concatenation can lead to ambiguous-looking names. |