ctors: include implicit inputs/outputs
This commit is contained in:
23
internal/gen/avotypes.go
Normal file
23
internal/gen/avotypes.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package gen
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
pkg = "github.com/mmcloughlin/avo"
|
||||
instType = "avo.Instruction"
|
||||
operandType = "operand.Op"
|
||||
)
|
||||
|
||||
// implicitRegister returns avo syntax for the given implicit register type (from Opcodes XML).
|
||||
func implicitRegister(t string) string {
|
||||
r := strings.Replace(t, "mm", "", 1) // handles the "xmm0" type
|
||||
return fmt.Sprintf("reg.%s", strings.ToUpper(r))
|
||||
}
|
||||
|
||||
// checkername returns the name of the function that checks an operand of type t.
|
||||
func checkername(t string) string {
|
||||
return "operand.Is" + strings.Title(t)
|
||||
}
|
||||
Reference in New Issue
Block a user