mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 13:04:25 -04:00
feat(compiler): Add support for targeting WebAssembly.
The working principle is similar as before with x86, but instead of outputting .asm, it outputs .wat. This can be compiled into .wasm by using the wat2wasm assembler.
This commit is contained in:
27
compiler/featureset_macros.go
Normal file
27
compiler/featureset_macros.go
Normal file
@ -0,0 +1,27 @@
|
||||
package compiler
|
||||
|
||||
type FeatureSetMacros struct {
|
||||
FeatureSet
|
||||
}
|
||||
|
||||
func (p *FeatureSetMacros) HasOp(instruction string) bool {
|
||||
_, ok := p.Opcode(instruction)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (p *FeatureSetMacros) GetOp(instruction string) int {
|
||||
v, _ := p.Opcode(instruction)
|
||||
return v
|
||||
}
|
||||
|
||||
func (p *FeatureSetMacros) Stereo(unitType string) bool {
|
||||
return p.SupportsParamValue(unitType, "stereo", 1)
|
||||
}
|
||||
|
||||
func (p *FeatureSetMacros) Mono(unitType string) bool {
|
||||
return p.SupportsParamValue(unitType, "stereo", 0)
|
||||
}
|
||||
|
||||
func (p *FeatureSetMacros) StereoAndMono(unitType string) bool {
|
||||
return p.Stereo(unitType) && p.Mono(unitType)
|
||||
}
|
Reference in New Issue
Block a user