mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
8b112ee806
Summary: When identifing instructions that can be folded into a MOVCC instruction, checking for a predicate operand is not enough, also need to check for thumb2 function, with restrict-IT, is the machine instruction eligible for ARMv8 IT or not. Notes in ARMv8-A Architecture Reference Manual, section "Partial deprecation of IT" https://usermanual.wiki/Pdf/ARM20Architecture20Reference20ManualARMv8.1667877052.pdf "ARMv8-A deprecates some uses of the T32 IT instruction. All uses of IT that apply to instructions other than a single subsequent 16-bit instruction from a restricted set are deprecated, as are explicit references to the PC within that single 16-bit instruction. This permits the non-deprecated forms of IT and subsequent instructions to be treated as a single 32-bit conditional instruction." Reviewers: efriedma, lebedev.ri, t.p.northover, jmolloy, aemerson, compnerd, stoklund, ostannard Reviewed By: ostannard Subscribers: ostannard, javed.absar, kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63474 llvm-svn: 363739
33 lines
1.4 KiB
LLVM
33 lines
1.4 KiB
LLVM
; RUN: llc < %s -mtriple=thumbv7 -o - | llvm-mc -triple thumbv7 --show-encoding 2>&1 | FileCheck %s --check-prefix=V7
|
|
; RUN: llc < %s -mtriple=thumbv7 -arm-restrict-it -o - | llvm-mc -triple thumbv7 --show-encoding 2>&1 | FileCheck %s --check-prefix=V7_RESTRICT_IT
|
|
; RUN: llc < %s -mtriple=thumbv8 -o - | llvm-mc -triple thumbv8 --show-encoding 2>&1 | FileCheck %s --check-prefix=V8
|
|
; RUN: llc < %s -mtriple=thumbv8 -arm-no-restrict-it -o - | llvm-mc -triple thumbv8 --show-encoding 2>&1 | FileCheck %s --check-prefix=V8_NO_RESTRICT_IT
|
|
|
|
|
|
; V7-NOT: warning
|
|
; V7_RESTRICT_IT-NOT: warning
|
|
; V8-NOT: warning
|
|
; V8_NO_RESTRICT_IT: warning: deprecated instruction in IT block
|
|
; it ge @ encoding: [0xa8,0xbf]
|
|
; lslge.w r3, r12, lr @ encoding: [0x0c,0xfa,0x0e,0xf3] ; deprecated in ARMv8 thumb mode
|
|
define i1 @scalar_i64_lowestbit_eq(i64 %x, i64 %y) {
|
|
%t0 = shl i64 1, %y
|
|
%t1 = and i64 %t0, %x
|
|
%res = icmp eq i64 %t1, 0
|
|
ret i1 %res
|
|
}
|
|
|
|
; V7-NOT: warning
|
|
; V7_RESTRICT_IT-NOT: warning
|
|
; V8-NOT: warning
|
|
; V8_NO_RESTRICT_IT: warning: deprecated instruction in IT block
|
|
; it ne @ encoding: [0x18,0xbf]
|
|
; movne.w r0, #-1 @ encoding: [0x4f,0xf0,0xff,0x30] ; deprecated in ARMv8 thumb mode
|
|
define i32 @icmp_eq_minus_one(i8* %ptr) {
|
|
%load = load i8, i8* %ptr, align 1
|
|
%conv = zext i8 %load to i32
|
|
%cmp = icmp eq i8 %load, -1
|
|
%ret = select i1 %cmp, i32 %conv, i32 -1
|
|
ret i32 %ret
|
|
}
|