diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td index 1b11cd878233..5a4df7ac154e 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td @@ -3243,6 +3243,12 @@ def : InstAlias<"mfsrr0 $Rx", (MFSPR gprc:$Rx, 26)>; def : InstAlias<"mtsrr1 $Rx", (MTSPR 27, gprc:$Rx)>; def : InstAlias<"mfsrr1 $Rx", (MFSPR gprc:$Rx, 27)>; +def : InstAlias<"mtsrr2 $Rx", (MTSPR 990, gprc:$Rx)>, Requires<[IsPPC4xx]>; +def : InstAlias<"mfsrr2 $Rx", (MFSPR gprc:$Rx, 990)>, Requires<[IsPPC4xx]>; + +def : InstAlias<"mtsrr3 $Rx", (MTSPR 991, gprc:$Rx)>, Requires<[IsPPC4xx]>; +def : InstAlias<"mfsrr3 $Rx", (MFSPR gprc:$Rx, 991)>, Requires<[IsPPC4xx]>; + def : InstAlias<"mtcfar $Rx", (MTSPR 28, gprc:$Rx)>; def : InstAlias<"mfcfar $Rx", (MFSPR gprc:$Rx, 28)>; diff --git a/llvm/test/MC/PowerPC/ppc64-encoding-4xx.s b/llvm/test/MC/PowerPC/ppc64-encoding-4xx.s index b973b0fdeaab..f94eab0b99fb 100644 --- a/llvm/test/MC/PowerPC/ppc64-encoding-4xx.s +++ b/llvm/test/MC/PowerPC/ppc64-encoding-4xx.s @@ -97,3 +97,16 @@ # CHECK-BE: ici 14 # encoding: [0x7d,0xc0,0x07,0x8c] # CHECK-LE: ici 14 # encoding: [0x8c,0x07,0xc0,0x7d] ici 14 + +# CHECK-BE: mfspr 2, 990 # encoding: [0x7c,0x5e,0xf2,0xa6] +# CHECK-LE: mfspr 2, 990 # encoding: [0xa6,0xf2,0x5e,0x7c] + mfsrr2 2 +# CHECK-BE: mtspr 990, 2 # encoding: [0x7c,0x5e,0xf3,0xa6] +# CHECK-LE: mtspr 990, 2 # encoding: [0xa6,0xf3,0x5e,0x7c] + mtsrr2 2 +# CHECK-BE: mfspr 2, 991 # encoding: [0x7c,0x5f,0xf2,0xa6] +# CHECK-LE: mfspr 2, 991 # encoding: [0xa6,0xf2,0x5f,0x7c] + mfsrr3 2 +# CHECK-BE: mtspr 991, 2 # encoding: [0x7c,0x5f,0xf3,0xa6] +# CHECK-LE: mtspr 991, 2 # encoding: [0xa6,0xf3,0x5f,0x7c] + mtsrr3 2