File: zmov.go

package info (click to toggle)
golang-github-mmcloughlin-avo 0.0~git20200523.4439b6b-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,304 kB
  • sloc: xml: 71,029; asm: 13,138; sh: 179; makefile: 35
file content (72 lines) | stat: -rw-r--r-- 2,907 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Code generated by command: avogen -output zmov.go mov. DO NOT EDIT.

package build

import (
	"go/types"

	"github.com/mmcloughlin/avo/operand"
)

func (c *Context) mov(a, b operand.Op, an, bn int, t *types.Basic) {
	switch {
	case (t.Info()&types.IsInteger) != 0 && an == 1 && bn == 1:
		c.MOVB(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 1 && bn == 4:
		c.MOVBLSX(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 1 && bn == 4:
		c.MOVBLZX(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 1 && bn == 8:
		c.MOVBQSX(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 1 && bn == 8:
		c.MOVBQZX(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 1 && bn == 2:
		c.MOVBWSX(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 1 && bn == 2:
		c.MOVBWZX(a, b)
	case (t.Info()&types.IsInteger) != 0 && an == 4 && bn == 4:
		c.MOVL(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 4 && bn == 8:
		c.MOVLQSX(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 4 && bn == 8:
		c.MOVLQZX(a, b)
	case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 16:
		c.MOVOU(a, b)
	case (t.Info()&types.IsInteger) != 0 && an == 4 && bn == 16:
		c.MOVQ(a, b)
	case (t.Info()&types.IsInteger) != 0 && an == 8 && bn == 8:
		c.MOVQ(a, b)
	case (t.Info()&types.IsInteger) != 0 && an == 8 && bn == 16:
		c.MOVQ(a, b)
	case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 4:
		c.MOVQ(a, b)
	case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 8:
		c.MOVQ(a, b)
	case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 16:
		c.MOVQ(a, b)
	case (t.Info()&types.IsFloat) != 0 && an == 8 && bn == 16:
		c.MOVSD(a, b)
	case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 8:
		c.MOVSD(a, b)
	case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 16:
		c.MOVSD(a, b)
	case (t.Info()&types.IsFloat) != 0 && an == 4 && bn == 16:
		c.MOVSS(a, b)
	case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 4:
		c.MOVSS(a, b)
	case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 16:
		c.MOVSS(a, b)
	case (t.Info()&types.IsInteger) != 0 && an == 2 && bn == 2:
		c.MOVW(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 2 && bn == 4:
		c.MOVWLSX(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 2 && bn == 4:
		c.MOVWLZX(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 2 && bn == 8:
		c.MOVWQSX(a, b)
	case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 2 && bn == 8:
		c.MOVWQZX(a, b)
	default:
		c.adderrormessage("could not deduce mov instruction")
	}
}