...
Source file src/pkg/cmd/asm/internal/arch/s390x.go
1
2
3
4
5
6
7
8
9 package arch
10
11 import (
12 "cmd/internal/obj"
13 "cmd/internal/obj/s390x"
14 )
15
16 func jumpS390x(word string) bool {
17 switch word {
18 case "BC",
19 "BCL",
20 "BEQ",
21 "BGE",
22 "BGT",
23 "BL",
24 "BLE",
25 "BLEU",
26 "BLT",
27 "BLTU",
28 "BNE",
29 "BR",
30 "BVC",
31 "BVS",
32 "CMPBEQ",
33 "CMPBGE",
34 "CMPBGT",
35 "CMPBLE",
36 "CMPBLT",
37 "CMPBNE",
38 "CMPUBEQ",
39 "CMPUBGE",
40 "CMPUBGT",
41 "CMPUBLE",
42 "CMPUBLT",
43 "CMPUBNE",
44 "CALL",
45 "JMP":
46 return true
47 }
48 return false
49 }
50
51
52
53 func IsS390xCMP(op obj.As) bool {
54 switch op {
55 case s390x.ACMP, s390x.ACMPU, s390x.ACMPW, s390x.ACMPWU:
56 return true
57 }
58 return false
59 }
60
61
62
63 func IsS390xNEG(op obj.As) bool {
64 switch op {
65 case s390x.ANEG, s390x.ANEGW:
66 return true
67 }
68 return false
69 }
70
71 func s390xRegisterNumber(name string, n int16) (int16, bool) {
72 switch name {
73 case "AR":
74 if 0 <= n && n <= 15 {
75 return s390x.REG_AR0 + n, true
76 }
77 case "F":
78 if 0 <= n && n <= 15 {
79 return s390x.REG_F0 + n, true
80 }
81 case "R":
82 if 0 <= n && n <= 15 {
83 return s390x.REG_R0 + n, true
84 }
85 case "V":
86 if 0 <= n && n <= 31 {
87 return s390x.REG_V0 + n, true
88 }
89 }
90 return 0, false
91 }
92
View as plain text