Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: tests_lit/assembler/mips32/encoding_intrinsics.ll

Issue 2358393004: Subzero, MIPS32: Intrinsic call Cttz for i32 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Changes as advised Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTargetLoweringMIPS32.cpp ('k') | tests_lit/llvm2ice_tests/nacl-other-intrinsics.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/assembler/mips32/encoding_intrinsics.ll
diff --git a/tests_lit/assembler/mips32/encoding_intrinsics.ll b/tests_lit/assembler/mips32/encoding_intrinsics.ll
index 8b6d3a17095c8d6ea02cbb2c2a6a3623534cc69c..9b243bb62bf644b1bc79b53c4e0766dc2984ed06 100644
--- a/tests_lit/assembler/mips32/encoding_intrinsics.ll
+++ b/tests_lit/assembler/mips32/encoding_intrinsics.ll
@@ -23,6 +23,7 @@
; RUN: | FileCheck %s --check-prefix=DIS
declare i32 @llvm.ctlz.i32(i32, i1)
+declare i32 @llvm.cttz.i32(i32, i1)
declare void @llvm.trap()
define internal i32 @encCtlz32(i32 %x) {
@@ -57,6 +58,62 @@ entry:
; IASM-NEXT: .byte 0xe0
; IASM-NEXT: .byte 0x3
+define internal i32 @encCttz32(i32 %x) {
+entry:
+ %r = call i32 @llvm.cttz.i32(i32 %x, i1 false)
+ ret i32 %r
+}
+
+; ASM-LABEL: encCttz32
+; ASM-NEXT: .LencCttz32$entry:
+; ASM-NEXT: addiu $v0, $a0, -1
+; ASM-NEXT: nor $a0, $a0, $zero
+; ASM-NEXT: and $a0, $a0, $v0
+; ASM-NEXT: clz $a0, $a0
+; ASM-NEXT: addiu $v0, $zero, 32
+; ASM-NEXT: subu $v0, $v0, $a0
+; ASM-NEXT: jr $ra
+
+; DIS-LABEL: 00000010 <encCttz32>:
+; DIS-NEXT: 10: 2482ffff addiu v0,a0,-1
+; DIS-NEXT: 14: 00802027 nor a0,a0,zero
+; DIS-NEXT: 18: 00822024 and a0,a0,v0
+; DIS-NEXT: 1c: 70842020 clz a0,a0
+; DIS-NEXT: 20: 24020020 li v0,32
+; DIS-NEXT: 24: 00441023 subu v0,v0,a0
+; DIS-NEXT: 28: 03e00008 jr ra
+
+; IASM-LABEL: encCttz32
+; IASM-NEXT: .LencCttz32$entry:
+; IASM-NEXT: .byte 0xff
+; IASM-NEXT: .byte 0xff
+; IASM-NEXT: .byte 0x82
+; IASM-NEXT: .byte 0x24
+; IASM-NEXT: .byte 0x27
+; IASM-NEXT: .byte 0x20
+; IASM-NEXT: .byte 0x80
+; IASM-NEXT: .byte 0x0
+; IASM-NEXT: .byte 0x24
+; IASM-NEXT: .byte 0x20
+; IASM-NEXT: .byte 0x82
+; IASM-NEXT: .byte 0x0
+; IASM-NEXT: .byte 0x20
+; IASM-NEXT: .byte 0x20
+; IASM-NEXT: .byte 0x84
+; IASM-NEXT: .byte 0x70
+; IASM-NEXT: .byte 0x20
+; IASM-NEXT: .byte 0x0
+; IASM-NEXT: .byte 0x2
+; IASM-NEXT: .byte 0x24
+; IASM-NEXT: .byte 0x23
+; IASM-NEXT: .byte 0x10
+; IASM-NEXT: .byte 0x44
+; IASM-NEXT: .byte 0x0
+; IASM-NEXT: .byte 0x8
+; IASM-NEXT: .byte 0x0
+; IASM-NEXT: .byte 0xe0
+; IASM-NEXT: .byte 0x3
+
define internal void @encTrap() {
unreachable
}
@@ -65,8 +122,8 @@ define internal void @encTrap() {
; ASM-NEXT: .LencTrap$__0:
; ASM-NEXT: teq $zero, $zero, 0
-; DIS-LABEL: 00000010 <encTrap>:
-; DIS-NEXT: 10: 00000034 teq zero,zero
+; DIS-LABEL: 00000030 <encTrap>:
+; DIS-NEXT: 30: 00000034 teq zero,zero
; IASM-LABEL: encTrap:
; IASM-NEXT: .LencTrap$__0:
« no previous file with comments | « src/IceTargetLoweringMIPS32.cpp ('k') | tests_lit/llvm2ice_tests/nacl-other-intrinsics.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698