[llvm-commits] [llvm] r161346 - in /llvm/trunk: lib/Target/PowerPC/PPCInstr64Bit.td test/CodeGen/PowerPC/ppc64-cyclecounter.ll

Hal Finkel hfinkel at anl.gov
Mon Aug 6 14:21:44 PDT 2012


Author: hfinkel
Date: Mon Aug  6 16:21:44 2012
New Revision: 161346

URL: http://llvm.org/viewvc/llvm-project?rev=161346&view=rev
Log:
MFTB on PPC64 should really be encoded using MFSPR.

The MFTB instruction itself is being phased out, and its functionality
is provided by MFSPR. According to the ISA docs, using MFSPR works on all known
chips except for the 601 (which did not have a timebase register anyway)
and the POWER3.

Thanks to Adhemerval Zanella for pointing this out!

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td
    llvm/trunk/test/CodeGen/PowerPC/ppc64-cyclecounter.ll

Modified: llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td?rev=161346&r1=161345&r2=161346&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td Mon Aug  6 16:21:44 2012
@@ -266,8 +266,8 @@
 }
 
 let Pattern = [(set G8RC:$rT, readcyclecounter)] in
-def MFTB8 : XFXForm_1_ext<31, 371, 268, (outs G8RC:$rT), (ins),
-                          "mftb $rT", SprMFTB>,
+def MFTB8 : XFXForm_1_ext<31, 339, 268, (outs G8RC:$rT), (ins),
+                          "mfspr $rT, 268", SprMFTB>,
             PPC970_DGroup_First, PPC970_Unit_FXU;
 
 let Defs = [X1], Uses = [X1] in

Modified: llvm/trunk/test/CodeGen/PowerPC/ppc64-cyclecounter.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/ppc64-cyclecounter.ll?rev=161346&r1=161345&r2=161346&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/ppc64-cyclecounter.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/ppc64-cyclecounter.ll Mon Aug  6 16:21:44 2012
@@ -9,7 +9,7 @@
 }
 
 ; CHECK: @test1
-; CHECK: mftb
+; CHECK: mfspr 3, 268
 
 declare i64 @llvm.readcyclecounter()
 





More information about the llvm-commits mailing list