From 7ad7c75048eb32f95eae04847908793e0183802f Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 7 Aug 2014 13:35:34 +0000 Subject: [PATCH] Add mfasr and mtasr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215110 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCInstrInfo.td | 3 +++ test/MC/PowerPC/ppc64-encoding-ext.s | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td index aa5466c192d..51e0a3f9859 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.td +++ b/lib/Target/PowerPC/PPCInstrInfo.td @@ -3360,6 +3360,9 @@ def : InstAlias<"subc. $rA, $rB, $rC", (SUBFC8o g8rc:$rA, g8rc:$rC, g8rc:$rB)>; def : InstAlias<"mtmsrd $RS", (MTMSRD gprc:$RS, 0)>; def : InstAlias<"mtmsr $RS", (MTMSR gprc:$RS, 0)>; +def : InstAlias<"mfasr $RT", (MFSPR gprc:$RT, 280)>; +def : InstAlias<"mtasr $RT", (MTSPR 280, gprc:$RT)>; + foreach SPRG = 0-3 in { def : InstAlias<"mfsprg $RT, "#SPRG, (MFSPR gprc:$RT, !add(SPRG, 272))>; def : InstAlias<"mfsprg"#SPRG#" $RT", (MFSPR gprc:$RT, !add(SPRG, 272))>; diff --git a/test/MC/PowerPC/ppc64-encoding-ext.s b/test/MC/PowerPC/ppc64-encoding-ext.s index 0729154c5ca..0ffe0bf6b7c 100644 --- a/test/MC/PowerPC/ppc64-encoding-ext.s +++ b/test/MC/PowerPC/ppc64-encoding-ext.s @@ -3626,3 +3626,10 @@ # CHECK-BE: rfid # encoding: [0x4c,0x00,0x00,0x24] # CHECK-LE: rfid # encoding: [0x24,0x00,0x00,0x4c] rfid + +# CHECK-BE: mfspr 2, 280 # encoding: [0x7c,0x58,0x42,0xa6] +# CHECK-LE: mfspr 2, 280 # encoding: [0xa6,0x42,0x58,0x7c] + mfasr 2 +# CHECK-BE: mtspr 280, 2 # encoding: [0x7c,0x58,0x43,0xa6] +# CHECK-LE: mtspr 280, 2 # encoding: [0xa6,0x43,0x58,0x7c] + mtasr 2