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

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

Issue 2354293002: Subzero, MIPS32: Intrinsic call Ctlz for i32 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressing review comments 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_trap.ll b/tests_lit/assembler/mips32/encoding_intrinsics.ll
similarity index 56%
copy from tests_lit/assembler/mips32/encoding_trap.ll
copy to tests_lit/assembler/mips32/encoding_intrinsics.ll
index a6a86e9e4b60edc1bbdce71792bb358b216c8b39..8b6d3a17095c8d6ea02cbb2c2a6a3623534cc69c 100644
--- a/tests_lit/assembler/mips32/encoding_trap.ll
+++ b/tests_lit/assembler/mips32/encoding_intrinsics.ll
@@ -1,4 +1,4 @@
-; Test encoding of MIPS32 floating point arithmetic instructions
+; Test encoding of MIPS32 instructions used in intrinsic calls
; REQUIRES: allow_dump
@@ -22,6 +22,41 @@
; RUN: --args -O2 --allow-externally-defined-symbols --skip-unimplemented \
; RUN: | FileCheck %s --check-prefix=DIS
+declare i32 @llvm.ctlz.i32(i32, i1)
+declare void @llvm.trap()
+
+define internal i32 @encCtlz32(i32 %x) {
+entry:
+ %r = call i32 @llvm.ctlz.i32(i32 %x, i1 false)
+ ret i32 %r
+}
+
+; ASM-LABEL: encCtlz32
+; ASM-NEXT: .LencCtlz32$entry:
+; ASM-NEXT: clz $a0, $a0
+; ASM-NEXT: move $v0, $a0
+; ASM-NEXT: jr $ra
+
+; DIS-LABEL: 00000000 <encCtlz32>:
+; DIS-NEXT: 0: 70842020 clz a0,a0
+; DIS-NEXT: 4: 00801021 move v0,a0
+; DIS-NEXT: 8: 03e00008 jr ra
+
+; IASM-LABEL: encCtlz32
+; IASM-NEXT: .LencCtlz32$entry:
+; IASM-NEXT: .byte 0x20
+; IASM-NEXT: .byte 0x20
+; IASM-NEXT: .byte 0x84
+; IASM-NEXT: .byte 0x70
+; IASM-NEXT: .byte 0x21
+; IASM-NEXT: .byte 0x10
+; IASM-NEXT: .byte 0x80
+; 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
}
@@ -30,8 +65,8 @@ define internal void @encTrap() {
; ASM-NEXT: .LencTrap$__0:
; ASM-NEXT: teq $zero, $zero, 0
-; DIS-LABEL: 00000000 <encTrap>:
-; DIS-NEXT: 0: 00000034 teq zero,zero
+; DIS-LABEL: 00000010 <encTrap>:
+; DIS-NEXT: 10: 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