1 // Do not edit. Bootstrap copy of /usr/local/google/buildbot/src/android/build-tools/out/obj/go/src/cmd/compile/internal/amd64/prog.go 2 3 //line /usr/local/google/buildbot/src/android/build-tools/out/obj/go/src/cmd/compile/internal/amd64/prog.go:1 4 // Copyright 2013 The Go Authors. All rights reserved. 5 // Use of this source code is governed by a BSD-style 6 // license that can be found in the LICENSE file. 7 8 package amd64 9 10 import ( 11 "bootstrap/compile/internal/gc" 12 "bootstrap/internal/obj" 13 "bootstrap/internal/obj/x86" 14 ) 15 16 const ( 17 LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite 18 RightRdwr uint32 = gc.RightRead | gc.RightWrite 19 ) 20 21 // This table gives the basic information about instruction 22 // generated by the compiler and processed in the optimizer. 23 // See opt.h for bit definitions. 24 // 25 // Instructions not generated need not be listed. 26 // As an exception to that rule, we typically write down all the 27 // size variants of an operation even if we just use a subset. 28 // 29 // The table is formatted for 8-space tabs. 30 var progtable = [x86.ALAST]obj.ProgInfo{ 31 obj.ATYPE: {gc.Pseudo | gc.Skip, 0, 0, 0}, 32 obj.ATEXT: {gc.Pseudo, 0, 0, 0}, 33 obj.AFUNCDATA: {gc.Pseudo, 0, 0, 0}, 34 obj.APCDATA: {gc.Pseudo, 0, 0, 0}, 35 obj.AUNDEF: {gc.Break, 0, 0, 0}, 36 obj.AUSEFIELD: {gc.OK, 0, 0, 0}, 37 obj.ACHECKNIL: {gc.LeftRead, 0, 0, 0}, 38 obj.AVARDEF: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, 39 obj.AVARKILL: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, 40 41 // NOP is an internal no-op that also stands 42 // for USED and SET annotations, not the Intel opcode. 43 obj.ANOP: {gc.LeftRead | gc.RightWrite, 0, 0, 0}, 44 x86.AADCL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 45 x86.AADCQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 46 x86.AADCW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 47 x86.AADDB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 48 x86.AADDL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 49 x86.AADDW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 50 x86.AADDQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 51 x86.AADDSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, 52 x86.AADDSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, 53 x86.AANDB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 54 x86.AANDL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 55 x86.AANDQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 56 x86.AANDW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 57 obj.ACALL: {gc.RightAddr | gc.Call | gc.KillCarry, 0, 0, 0}, 58 x86.ACDQ: {gc.OK, AX, AX | DX, 0}, 59 x86.ACQO: {gc.OK, AX, AX | DX, 0}, 60 x86.ACWD: {gc.OK, AX, AX | DX, 0}, 61 x86.ACLD: {gc.OK, 0, 0, 0}, 62 x86.ASTD: {gc.OK, 0, 0, 0}, 63 x86.ACMPB: {gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 64 x86.ACMPL: {gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 65 x86.ACMPQ: {gc.SizeQ | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 66 x86.ACMPW: {gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 67 x86.ACOMISD: {gc.SizeD | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 68 x86.ACOMISS: {gc.SizeF | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 69 x86.ACVTSD2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 70 x86.ACVTSD2SQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 71 x86.ACVTSD2SS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 72 x86.ACVTSL2SD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 73 x86.ACVTSL2SS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 74 x86.ACVTSQ2SD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 75 x86.ACVTSQ2SS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 76 x86.ACVTSS2SD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 77 x86.ACVTSS2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 78 x86.ACVTSS2SQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 79 x86.ACVTTSD2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 80 x86.ACVTTSD2SQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 81 x86.ACVTTSS2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 82 x86.ACVTTSS2SQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 83 x86.ADECB: {gc.SizeB | RightRdwr, 0, 0, 0}, 84 x86.ADECL: {gc.SizeL | RightRdwr, 0, 0, 0}, 85 x86.ADECQ: {gc.SizeQ | RightRdwr, 0, 0, 0}, 86 x86.ADECW: {gc.SizeW | RightRdwr, 0, 0, 0}, 87 x86.ADIVB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, 88 x86.ADIVL: {gc.SizeL | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, 89 x86.ADIVQ: {gc.SizeQ | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, 90 x86.ADIVW: {gc.SizeW | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, 91 x86.ADIVSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, 92 x86.ADIVSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, 93 x86.AIDIVB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, 94 x86.AIDIVL: {gc.SizeL | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, 95 x86.AIDIVQ: {gc.SizeQ | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, 96 x86.AIDIVW: {gc.SizeW | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, 97 x86.AIMULB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, 98 x86.AIMULL: {gc.SizeL | gc.LeftRead | gc.ImulAXDX | gc.SetCarry, 0, 0, 0}, 99 x86.AIMULQ: {gc.SizeQ | gc.LeftRead | gc.ImulAXDX | gc.SetCarry, 0, 0, 0}, 100 x86.AIMULW: {gc.SizeW | gc.LeftRead | gc.ImulAXDX | gc.SetCarry, 0, 0, 0}, 101 x86.AINCB: {gc.SizeB | RightRdwr, 0, 0, 0}, 102 x86.AINCL: {gc.SizeL | RightRdwr, 0, 0, 0}, 103 x86.AINCQ: {gc.SizeQ | RightRdwr, 0, 0, 0}, 104 x86.AINCW: {gc.SizeW | RightRdwr, 0, 0, 0}, 105 x86.AJCC: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 106 x86.AJCS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 107 x86.AJEQ: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 108 x86.AJGE: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 109 x86.AJGT: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 110 x86.AJHI: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 111 x86.AJLE: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 112 x86.AJLS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 113 x86.AJLT: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 114 x86.AJMI: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 115 x86.AJNE: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 116 x86.AJOC: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 117 x86.AJOS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 118 x86.AJPC: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 119 x86.AJPL: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 120 x86.AJPS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, 121 obj.AJMP: {gc.Jump | gc.Break | gc.KillCarry, 0, 0, 0}, 122 x86.ALEAL: {gc.LeftAddr | gc.RightWrite, 0, 0, 0}, 123 x86.ALEAQ: {gc.LeftAddr | gc.RightWrite, 0, 0, 0}, 124 x86.AMOVBLSX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 125 x86.AMOVBLZX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 126 x86.AMOVBQSX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 127 x86.AMOVBQZX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 128 x86.AMOVBWSX: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 129 x86.AMOVBWZX: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 130 x86.AMOVLQSX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 131 x86.AMOVLQZX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 132 x86.AMOVWLSX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 133 x86.AMOVWLZX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 134 x86.AMOVWQSX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 135 x86.AMOVWQZX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 136 x86.AMOVQL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, 137 x86.AMOVB: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, 138 x86.AMOVL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, 139 x86.AMOVQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, 140 x86.AMOVW: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, 141 x86.AMOVSB: {gc.OK, DI | SI, DI | SI, 0}, 142 x86.AMOVSL: {gc.OK, DI | SI, DI | SI, 0}, 143 x86.AMOVSQ: {gc.OK, DI | SI, DI | SI, 0}, 144 x86.AMOVSW: {gc.OK, DI | SI, DI | SI, 0}, 145 obj.ADUFFCOPY: {gc.OK, DI | SI, DI | SI | CX, 0}, 146 x86.AMOVSD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, 147 x86.AMOVSS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, 148 149 // We use MOVAPD as a faster synonym for MOVSD. 150 x86.AMOVAPD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, 151 x86.AMULB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, 152 x86.AMULL: {gc.SizeL | gc.LeftRead | gc.SetCarry, AX, AX | DX, 0}, 153 x86.AMULQ: {gc.SizeQ | gc.LeftRead | gc.SetCarry, AX, AX | DX, 0}, 154 x86.AMULW: {gc.SizeW | gc.LeftRead | gc.SetCarry, AX, AX | DX, 0}, 155 x86.AMULSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, 156 x86.AMULSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, 157 x86.ANEGB: {gc.SizeB | RightRdwr | gc.SetCarry, 0, 0, 0}, 158 x86.ANEGL: {gc.SizeL | RightRdwr | gc.SetCarry, 0, 0, 0}, 159 x86.ANEGQ: {gc.SizeQ | RightRdwr | gc.SetCarry, 0, 0, 0}, 160 x86.ANEGW: {gc.SizeW | RightRdwr | gc.SetCarry, 0, 0, 0}, 161 x86.ANOTB: {gc.SizeB | RightRdwr, 0, 0, 0}, 162 x86.ANOTL: {gc.SizeL | RightRdwr, 0, 0, 0}, 163 x86.ANOTQ: {gc.SizeQ | RightRdwr, 0, 0, 0}, 164 x86.ANOTW: {gc.SizeW | RightRdwr, 0, 0, 0}, 165 x86.AORB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 166 x86.AORL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 167 x86.AORQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 168 x86.AORW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 169 x86.APOPQ: {gc.SizeQ | gc.RightWrite, 0, 0, 0}, 170 x86.APUSHQ: {gc.SizeQ | gc.LeftRead, 0, 0, 0}, 171 x86.ARCLB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 172 x86.ARCLL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 173 x86.ARCLQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 174 x86.ARCLW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 175 x86.ARCRB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 176 x86.ARCRL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 177 x86.ARCRQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 178 x86.ARCRW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 179 x86.AREP: {gc.OK, CX, CX, 0}, 180 x86.AREPN: {gc.OK, CX, CX, 0}, 181 obj.ARET: {gc.Break | gc.KillCarry, 0, 0, 0}, 182 x86.AROLB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 183 x86.AROLL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 184 x86.AROLQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 185 x86.AROLW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 186 x86.ARORB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 187 x86.ARORL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 188 x86.ARORQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 189 x86.ARORW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 190 x86.ASALB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 191 x86.ASALL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 192 x86.ASALQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 193 x86.ASALW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 194 x86.ASARB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 195 x86.ASARL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 196 x86.ASARQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 197 x86.ASARW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 198 x86.ASBBB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 199 x86.ASBBL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 200 x86.ASBBQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 201 x86.ASBBW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, 202 x86.ASETCC: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 203 x86.ASETCS: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 204 x86.ASETEQ: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 205 x86.ASETGE: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 206 x86.ASETGT: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 207 x86.ASETHI: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 208 x86.ASETLE: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 209 x86.ASETLS: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 210 x86.ASETLT: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 211 x86.ASETMI: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 212 x86.ASETNE: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 213 x86.ASETOC: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 214 x86.ASETOS: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 215 x86.ASETPC: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 216 x86.ASETPL: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 217 x86.ASETPS: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, 218 x86.ASHLB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 219 x86.ASHLL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 220 x86.ASHLQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 221 x86.ASHLW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 222 x86.ASHRB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 223 x86.ASHRL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 224 x86.ASHRQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 225 x86.ASHRW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, 226 x86.ASQRTSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, 227 x86.ASTOSB: {gc.OK, AX | DI, DI, 0}, 228 x86.ASTOSL: {gc.OK, AX | DI, DI, 0}, 229 x86.ASTOSQ: {gc.OK, AX | DI, DI, 0}, 230 x86.ASTOSW: {gc.OK, AX | DI, DI, 0}, 231 obj.ADUFFZERO: {gc.OK, AX | DI, DI, 0}, 232 x86.ASUBB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 233 x86.ASUBL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 234 x86.ASUBQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 235 x86.ASUBW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 236 x86.ASUBSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, 237 x86.ASUBSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, 238 x86.ATESTB: {gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 239 x86.ATESTL: {gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 240 x86.ATESTQ: {gc.SizeQ | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 241 x86.ATESTW: {gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, 242 x86.AUCOMISD: {gc.SizeD | gc.LeftRead | gc.RightRead, 0, 0, 0}, 243 x86.AUCOMISS: {gc.SizeF | gc.LeftRead | gc.RightRead, 0, 0, 0}, 244 x86.AXCHGB: {gc.SizeB | LeftRdwr | RightRdwr, 0, 0, 0}, 245 x86.AXCHGL: {gc.SizeL | LeftRdwr | RightRdwr, 0, 0, 0}, 246 x86.AXCHGQ: {gc.SizeQ | LeftRdwr | RightRdwr, 0, 0, 0}, 247 x86.AXCHGW: {gc.SizeW | LeftRdwr | RightRdwr, 0, 0, 0}, 248 x86.AXORB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 249 x86.AXORL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 250 x86.AXORQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 251 x86.AXORW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, 252 } 253 254 func progflags(p *obj.Prog) uint32 { 255 flags := progtable[p.As].Flags 256 if flags&gc.ImulAXDX != 0 && p.To.Type != obj.TYPE_NONE { 257 flags |= RightRdwr 258 } 259 return flags 260 } 261 262 func progcarryflags(p *obj.Prog) uint32 { 263 return progtable[p.As].Flags 264 } 265 266 func proginfo(p *obj.Prog) { 267 info := &p.Info 268 *info = progtable[p.As] 269 if info.Flags == 0 { 270 gc.Fatal("unknown instruction %v", p) 271 } 272 273 if (info.Flags&gc.ShiftCX != 0) && p.From.Type != obj.TYPE_CONST { 274 info.Reguse |= CX 275 } 276 277 if info.Flags&gc.ImulAXDX != 0 { 278 if p.To.Type == obj.TYPE_NONE { 279 info.Reguse |= AX 280 info.Regset |= AX | DX 281 } else { 282 info.Flags |= RightRdwr 283 } 284 } 285 286 // Addressing makes some registers used. 287 if p.From.Type == obj.TYPE_MEM && p.From.Name == obj.NAME_NONE { 288 info.Regindex |= RtoB(int(p.From.Reg)) 289 } 290 if p.From.Index != x86.REG_NONE { 291 info.Regindex |= RtoB(int(p.From.Index)) 292 } 293 if p.To.Type == obj.TYPE_MEM && p.To.Name == obj.NAME_NONE { 294 info.Regindex |= RtoB(int(p.To.Reg)) 295 } 296 if p.To.Index != x86.REG_NONE { 297 info.Regindex |= RtoB(int(p.To.Index)) 298 } 299 if gc.Ctxt.Flag_dynlink { 300 // When -dynlink is passed, many operations on external names (and 301 // also calling duffzero/duffcopy) use R15 as a scratch register. 302 if p.As == x86.ALEAQ || info.Flags == gc.Pseudo || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { 303 return 304 } 305 if p.As == obj.ADUFFZERO || p.As == obj.ADUFFCOPY || (p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local) || (p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local) { 306 info.Reguse |= R15 307 info.Regset |= R15 308 return 309 } 310 } 311 } 312