Skip to content

Commit fca51ba

Browse files
pmurlaboger
authored andcommitted
cmd/internal/obj: remove ppc64 msr support from MOV* insns
These are privileged instructions, and thus will never work with usermode code. I don't think there is a case where this isn't true. The motivation is to simplify handling of MOV* opcodes. Assembler support for recognizing the MSR as a register is retained. Change-Id: Ic33f021a20057b64e69df8ea125e23dd8937e38d Reviewed-on: https://go-review.googlesource.com/c/go/+/307814 Run-TryBot: Paul Murphy <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Carlos Eduardo Seo <[email protected]> Reviewed-by: Lynn Boger <[email protected]> Trust: Carlos Eduardo Seo <[email protected]>
1 parent e306d06 commit fca51ba

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

src/cmd/internal/obj/ppc64/a.out.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ const (
377377
C_SOREG // D/DS form memory operation
378378
C_LOREG // 32 bit addis + D/DS-form memory operation
379379
C_FPSCR
380-
C_MSR
381380
C_XER
382381
C_LR
383382
C_CTR

src/cmd/internal/obj/ppc64/anames9.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ var cnames9 = []string{
2929
"SOREG",
3030
"LOREG",
3131
"FPSCR",
32-
"MSR",
3332
"XER",
3433
"LR",
3534
"CTR",

src/cmd/internal/obj/ppc64/asm9.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,9 @@ var optab = []Optab{
233233
{as: AMOVD, a1: C_TLS_IE, a6: C_REG, type_: 80, size: 8},
234234
{as: AMOVD, a1: C_TOCADDR, a6: C_REG, type_: 95, size: 8},
235235
{as: AMOVD, a1: C_SPR, a6: C_REG, type_: 66, size: 4},
236-
{as: AMOVD, a1: C_MSR, a6: C_REG, type_: 54, size: 4}, /* mfmsr */
237236
{as: AMOVD, a1: C_REG, a6: C_ADDR, type_: 74, size: 8},
238237
{as: AMOVD, a1: C_REG, a6: C_SOREG, type_: 7, size: 4},
239238
{as: AMOVD, a1: C_REG, a6: C_LOREG, type_: 35, size: 8},
240-
{as: AMOVD, a1: C_REG, a6: C_MSR, type_: 54, size: 4}, /* mtmsrd */
241239
{as: AMOVD, a1: C_REG, a6: C_SPR, type_: 66, size: 4},
242240
{as: AMOVD, a1: C_REG, a6: C_REG, type_: 1, size: 4},
243241

@@ -274,7 +272,6 @@ var optab = []Optab{
274272
{as: AMOVWZ, a1: C_REG, a6: C_CREG, type_: 69, size: 4},
275273
{as: AMOVWZ, a1: C_REG, a6: C_SOREG, type_: 7, size: 4},
276274
{as: AMOVWZ, a1: C_REG, a6: C_LOREG, type_: 35, size: 8},
277-
{as: AMOVWZ, a1: C_REG, a6: C_MSR, type_: 54, size: 4}, /* mtmsr */
278275
{as: AMOVWZ, a1: C_REG, a6: C_SPR, type_: 66, size: 4},
279276
{as: AMOVWZ, a1: C_REG, a6: C_REG, type_: 13, size: 4},
280277

@@ -807,9 +804,6 @@ func (c *ctxt9) aclass(a *obj.Addr) int {
807804
if a.Reg == REG_FPSCR {
808805
return C_FPSCR
809806
}
810-
if a.Reg == REG_MSR {
811-
return C_MSR
812-
}
813807
return C_GOK
814808

815809
case obj.TYPE_MEM:
@@ -2166,15 +2160,12 @@ const (
21662160
OP_MCRXR = 31<<26 | 512<<1 | 0<<10 | 0
21672161
OP_MFCR = 31<<26 | 19<<1 | 0<<10 | 0
21682162
OP_MFFS = 63<<26 | 583<<1 | 0<<10 | 0
2169-
OP_MFMSR = 31<<26 | 83<<1 | 0<<10 | 0
21702163
OP_MFSPR = 31<<26 | 339<<1 | 0<<10 | 0
21712164
OP_MFSR = 31<<26 | 595<<1 | 0<<10 | 0
21722165
OP_MFSRIN = 31<<26 | 659<<1 | 0<<10 | 0
21732166
OP_MTCRF = 31<<26 | 144<<1 | 0<<10 | 0
21742167
OP_MTFSF = 63<<26 | 711<<1 | 0<<10 | 0
21752168
OP_MTFSFI = 63<<26 | 134<<1 | 0<<10 | 0
2176-
OP_MTMSR = 31<<26 | 146<<1 | 0<<10 | 0
2177-
OP_MTMSRD = 31<<26 | 178<<1 | 0<<10 | 0
21782169
OP_MTSPR = 31<<26 | 467<<1 | 0<<10 | 0
21792170
OP_MTSR = 31<<26 | 210<<1 | 0<<10 | 0
21802171
OP_MTSRIN = 31<<26 | 242<<1 | 0<<10 | 0
@@ -3251,17 +3242,6 @@ func (c *ctxt9) asmout(p *obj.Prog, o *Optab, out []uint32) {
32513242
case 53: /* mffsX ,fr1 */
32523243
o1 = AOP_RRR(OP_MFFS, uint32(p.To.Reg), 0, 0)
32533244

3254-
case 54: /* mov msr,r1; mov r1, msr*/
3255-
if oclass(&p.From) == C_REG {
3256-
if p.As == AMOVD {
3257-
o1 = AOP_RRR(OP_MTMSRD, uint32(p.From.Reg), 0, 0)
3258-
} else {
3259-
o1 = AOP_RRR(OP_MTMSR, uint32(p.From.Reg), 0, 0)
3260-
}
3261-
} else {
3262-
o1 = AOP_RRR(OP_MFMSR, uint32(p.To.Reg), 0, 0)
3263-
}
3264-
32653245
case 55: /* op Rb, Rd */
32663246
o1 = AOP_RRR(c.oprrr(p.As), uint32(p.To.Reg), 0, uint32(p.From.Reg))
32673247

0 commit comments

Comments
 (0)