mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-17 10:55:58 +00:00
[ARM GlobalISel] Support G_CTLZ for Thumb2
Same as ARM mode but with different opcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355191 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6535445674
commit
de23a6b25f
@ -206,13 +206,6 @@ ARMLegalizerInfo::ARMLegalizerInfo(const ARMSubtarget &ST) {
|
|||||||
|
|
||||||
getActionDefinitionsBuilder({G_FREM, G_FPOW}).libcallFor({s32, s64});
|
getActionDefinitionsBuilder({G_FREM, G_FPOW}).libcallFor({s32, s64});
|
||||||
|
|
||||||
if (ST.isThumb()) {
|
|
||||||
// FIXME: merge with the code for non-Thumb.
|
|
||||||
computeTables();
|
|
||||||
verify(*ST.getInstrInfo());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ST.hasV5TOps()) {
|
if (ST.hasV5TOps()) {
|
||||||
getActionDefinitionsBuilder(G_CTLZ)
|
getActionDefinitionsBuilder(G_CTLZ)
|
||||||
.legalFor({s32, s32})
|
.legalFor({s32, s32})
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# RUN: llc -O0 -mtriple arm-linux-gnueabi -mattr=+v5t -run-pass=legalizer %s -o - | FileCheck %s -check-prefixes=CHECK,CLZ
|
# RUN: llc -O0 -mtriple arm-linux-gnueabi -mattr=+v5t -run-pass=legalizer %s -o - | FileCheck %s -check-prefixes=CHECK,CLZ
|
||||||
|
# RUN: llc -O0 -mtriple thumb-linux-gnueabi -mattr=+v6t2 -run-pass=legalizer %s -o - | FileCheck %s -check-prefixes=CHECK,CLZ
|
||||||
# RUN: llc -O0 -mtriple arm-linux-gnueabi -mattr=-v5t -run-pass=legalizer %s -o - | FileCheck %s -check-prefixes=CHECK,LIBCALLS
|
# RUN: llc -O0 -mtriple arm-linux-gnueabi -mattr=-v5t -run-pass=legalizer %s -o - | FileCheck %s -check-prefixes=CHECK,LIBCALLS
|
||||||
--- |
|
--- |
|
||||||
define void @test_ctlz_s32() { ret void }
|
define void @test_ctlz_s32() { ret void }
|
||||||
|
33
test/CodeGen/ARM/GlobalISel/select-clz.mir
Normal file
33
test/CodeGen/ARM/GlobalISel/select-clz.mir
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# RUN: llc -O0 -mtriple arm-- -mattr=+v6 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,ARM
|
||||||
|
# RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,THUMB
|
||||||
|
--- |
|
||||||
|
define void @test_clz() { ret void }
|
||||||
|
...
|
||||||
|
---
|
||||||
|
name: test_clz
|
||||||
|
# CHECK-LABEL: name: test_clz
|
||||||
|
legalized: true
|
||||||
|
regBankSelected: true
|
||||||
|
selected: false
|
||||||
|
# CHECK: selected: true
|
||||||
|
registers:
|
||||||
|
- { id: 0, class: gprb }
|
||||||
|
- { id: 1, class: gprb }
|
||||||
|
body: |
|
||||||
|
bb.0:
|
||||||
|
liveins: $r0
|
||||||
|
|
||||||
|
%0(s32) = COPY $r0
|
||||||
|
; ARM: [[VREGX:%[0-9]+]]:gpr = COPY $r0
|
||||||
|
; THUMB: [[VREGX:%[0-9]+]]:rgpr = COPY $r0
|
||||||
|
|
||||||
|
%1(s32) = G_CTLZ %0(s32)
|
||||||
|
; ARM: [[VREGR:%[0-9]+]]:gpr = CLZ [[VREGX]], 14, $noreg
|
||||||
|
; THUMB: [[VREGR:%[0-9]+]]:rgpr = t2CLZ [[VREGX]], 14, $noreg
|
||||||
|
|
||||||
|
$r0 = COPY %1(s32)
|
||||||
|
; CHECK: $r0 = COPY [[VREGR]]
|
||||||
|
|
||||||
|
BX_RET 14, $noreg, implicit $r0
|
||||||
|
; CHECK: BX_RET 14, $noreg, implicit $r0
|
||||||
|
...
|
Loading…
x
Reference in New Issue
Block a user