summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/PowerPC/PPCInstrInfo.td7
-rw-r--r--llvm/test/CodeGen/PowerPC/cttz.ll2
-rw-r--r--llvm/test/CodeGen/PowerPC/long-compare.ll2
-rw-r--r--llvm/test/CodeGen/PowerPC/seteq-0.ll2
-rw-r--r--llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt4
-rw-r--r--llvm/test/MC/Disassembler/PowerPC/ppc64le-encoding.txt4
-rw-r--r--llvm/test/MC/PowerPC/ppc64-encoding.s22
7 files changed, 24 insertions, 19 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
index 24fd9bd5c1f..cc1af1a7132 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
@@ -3883,8 +3883,11 @@ def : InstAlias<"rotlw. $rA, $rS, $rB", (RLWNMo gprc:$rA, gprc:$rS, gprc:$rB, 0,
def : InstAlias<"clrlwi $rA, $rS, $n", (RLWINM gprc:$rA, gprc:$rS, 0, u5imm:$n, 31)>;
def : InstAlias<"clrlwi. $rA, $rS, $n", (RLWINMo gprc:$rA, gprc:$rS, 0, u5imm:$n, 31)>;
-def : InstAlias<"cntlz $rA, $rS", (CNTLZW gprc:$rA, gprc:$rS)>;
-def : InstAlias<"cntlz. $rA, $rS", (CNTLZWo gprc:$rA, gprc:$rS)>;
+def : InstAlias<"cntlzw $rA, $rS", (CNTLZW gprc:$rA, gprc:$rS)>;
+def : InstAlias<"cntlzw. $rA, $rS", (CNTLZWo gprc:$rA, gprc:$rS)>;
+// The POWER variant
+def : MnemonicAlias<"cntlz", "cntlzw">;
+def : MnemonicAlias<"cntlz.", "cntlzw.">;
def EXTLDI : PPCAsmPseudo<"extldi $rA, $rS, $n, $b",
(ins g8rc:$rA, g8rc:$rS, u6imm:$n, u6imm:$b)>;
diff --git a/llvm/test/CodeGen/PowerPC/cttz.ll b/llvm/test/CodeGen/PowerPC/cttz.ll
index 60de982d91a..3757fa3e2f2 100644
--- a/llvm/test/CodeGen/PowerPC/cttz.ll
+++ b/llvm/test/CodeGen/PowerPC/cttz.ll
@@ -6,7 +6,7 @@ declare i32 @llvm.cttz.i32(i32, i1)
define i32 @bar(i32 %x) {
entry:
; CHECK: @bar
-; CHECK: cntlz
+; CHECK: cntlzw
%tmp.1 = call i32 @llvm.cttz.i32( i32 %x, i1 true ) ; <i32> [#uses=1]
ret i32 %tmp.1
}
diff --git a/llvm/test/CodeGen/PowerPC/long-compare.ll b/llvm/test/CodeGen/PowerPC/long-compare.ll
index e53356a5ddf..d596068cbb7 100644
--- a/llvm/test/CodeGen/PowerPC/long-compare.ll
+++ b/llvm/test/CodeGen/PowerPC/long-compare.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=ppc32 | grep cntlz
+; RUN: llc < %s -march=ppc32 | grep cntlzw
; RUN: llc < %s -march=ppc32 | not grep xori
; RUN: llc < %s -march=ppc32 | not grep "li "
; RUN: llc < %s -march=ppc32 | not grep "mr "
diff --git a/llvm/test/CodeGen/PowerPC/seteq-0.ll b/llvm/test/CodeGen/PowerPC/seteq-0.ll
index 4afb8fee177..b7dd78085eb 100644
--- a/llvm/test/CodeGen/PowerPC/seteq-0.ll
+++ b/llvm/test/CodeGen/PowerPC/seteq-0.ll
@@ -5,7 +5,7 @@ define i32 @eq0(i32 %a) {
%tmp.2 = zext i1 %tmp.1 to i32 ; <i32> [#uses=1]
ret i32 %tmp.2
-; CHECK: cntlz [[REG:r[0-9]+]], r3
+; CHECK: cntlzw [[REG:r[0-9]+]], r3
; CHECK: rlwinm r3, [[REG]], 27, 31, 31
; CHECK: blr
}
diff --git a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt
index f235c242fbc..74023340d50 100644
--- a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt
+++ b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt
@@ -508,10 +508,10 @@
# CHECK: extsh. 2, 3
0x7c 0x62 0x07 0x35
-# CHECK: cntlz 2, 3
+# CHECK: cntlzw 2, 3
0x7c 0x62 0x00 0x34
-# CHECK: cntlz. 2, 3
+# CHECK: cntlzw. 2, 3
0x7c 0x62 0x00 0x35
# CHECK: popcntw 2, 3
diff --git a/llvm/test/MC/Disassembler/PowerPC/ppc64le-encoding.txt b/llvm/test/MC/Disassembler/PowerPC/ppc64le-encoding.txt
index f154e00ff51..9ddc286d8aa 100644
--- a/llvm/test/MC/Disassembler/PowerPC/ppc64le-encoding.txt
+++ b/llvm/test/MC/Disassembler/PowerPC/ppc64le-encoding.txt
@@ -508,10 +508,10 @@
# CHECK: extsh. 2, 3
0x35 0x07 0x62 0x7c
-# CHECK: cntlz 2, 3
+# CHECK: cntlzw 2, 3
0x34 0x00 0x62 0x7c
-# CHECK: cntlz. 2, 3
+# CHECK: cntlzw. 2, 3
0x35 0x00 0x62 0x7c
# CHECK: popcntw 2, 3
diff --git a/llvm/test/MC/PowerPC/ppc64-encoding.s b/llvm/test/MC/PowerPC/ppc64-encoding.s
index 4a698adadda..b2aac8874ff 100644
--- a/llvm/test/MC/PowerPC/ppc64-encoding.s
+++ b/llvm/test/MC/PowerPC/ppc64-encoding.s
@@ -634,18 +634,20 @@
# CHECK-LE: extsh. 2, 3 # encoding: [0x35,0x07,0x62,0x7c]
extsh. 2, 3
-# CHECK-BE: cntlz 2, 3 # encoding: [0x7c,0x62,0x00,0x34]
-# CHECK-LE: cntlz 2, 3 # encoding: [0x34,0x00,0x62,0x7c]
+# CHECK-BE: cntlzw 2, 3 # encoding: [0x7c,0x62,0x00,0x34]
+# CHECK-LE: cntlzw 2, 3 # encoding: [0x34,0x00,0x62,0x7c]
cntlzw 2, 3
-# CHECK-BE: cntlz. 2, 3 # encoding: [0x7c,0x62,0x00,0x35]
-# CHECK-LE: cntlz. 2, 3 # encoding: [0x35,0x00,0x62,0x7c]
+# CHECK-BE: cntlzw. 2, 3 # encoding: [0x7c,0x62,0x00,0x35]
+# CHECK-LE: cntlzw. 2, 3 # encoding: [0x35,0x00,0x62,0x7c]
cntlzw. 2, 3
-# CHECK-BE: cntlz 2, 3 # encoding: [0x7c,0x62,0x00,0x34]
-# CHECK-LE: cntlz 2, 3 # encoding: [0x34,0x00,0x62,0x7c]
- cntlz 2, 3
-# CHECK-BE: cntlz. 2, 3 # encoding: [0x7c,0x62,0x00,0x35]
-# CHECK-LE: cntlz. 2, 3 # encoding: [0x35,0x00,0x62,0x7c]
- cntlz. 2, 3
+#
+# The POWER variant of cntlzw
+# CHECK-BE: cntlzw 2, 3 # encoding: [0x7c,0x62,0x00,0x34]
+# CHECK-LE: cntlzw 2, 3 # encoding: [0x34,0x00,0x62,0x7c]
+ cntlz 2, 3
+# CHECK-BE: cntlzw. 2, 3 # encoding: [0x7c,0x62,0x00,0x35]
+# CHECK-LE: cntlzw. 2, 3 # encoding: [0x35,0x00,0x62,0x7c]
+ cntlz. 2, 3
cmpb 7, 21, 4
# CHECK-BE: cmpb 7, 21, 4 # encoding: [0x7e,0xa7,0x23,0xf8]
# CHECK-LE: cmpb 7, 21, 4 # encoding: [0xf8,0x23,0xa7,0x7e]
OpenPOWER on IntegriCloud