def : StoreRegImmPat<SDC1_D64_MMR6, f64>, FGR_64, ISA_MICROMIPS32R6;
}
+let isCall=1, hasDelaySlot=0, isCTI=1, Defs = [RA] in {
+ class JumpLinkMMR6<Instruction JumpInst, DAGOperand Opnd> :
+ PseudoSE<(outs), (ins calltarget:$target), [], II_JAL>,
+ PseudoInstExpansion<(JumpInst Opnd:$target)>;
+}
+
+def JAL_MMR6 : JumpLinkMMR6<BALC_MMR6, brtarget26_mm>, ISA_MICROMIPS32R6;
+
+def : MipsPat<(MipsJmpLink (i32 texternalsym:$dst)),
+ (JAL_MMR6 texternalsym:$dst)>, ISA_MICROMIPS32R6;
+def : MipsPat<(MipsJmpLink (iPTR tglobaladdr:$dst)),
+ (JAL_MMR6 tglobaladdr:$dst)>, ISA_MICROMIPS32R6;
+
def TAILCALL_MMR6 : TailCall<BC_MMR6, brtarget26_mm>, ISA_MICROMIPS32R6;
def TAILCALLREG_MMR6 : TailCallReg<JRC16_MM, GPR32Opnd>, ISA_MICROMIPS32R6;
BGTZC_MMR6, BLEZC_MMR6, BLTC_MMR6,
BLTUC_MMR6, BLTZC_MMR6, BNEC_MMR6,
BNEZC16_MMR6, BNEZC_MMR6, BNVC_MMR6,
- BOVC_MMR6, DERET_MMR6, ERETNC_MMR6,
+ BOVC_MMR6, DERET_MMR6, ERETNC_MMR6, JAL_MMR6,
ERET_MMR6, JIC_MMR6, JRADDIUSP, JRC16_MM,
JRC16_MMR6, JRCADDIUSP_MMR6, SIGRIE_MMR6,
B_MMR6_Pseudo, PseudoIndirectBranch_MMR6)>;
; MMR6-SF-NEXT: # <MCOperand Reg:{{[0-9]+}}>
; MMR6-SF-NEXT: # <MCOperand Imm:20>>
; MMR6-SF-NEXT: .cfi_offset 31, -4
-; MMR6-SF-NEXT: jalr __fixsfsi # <MCInst #{{[0-9]+}} JALRC16_MMR6
+; MMR6-SF-NEXT: balc __fixsfsi # <MCInst #{{[0-9]+}} BALC_MMR6
; MMR6-SF-NEXT: # <MCOperand Expr:(__fixsfsi)>>
; MMR6-SF-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
; MMR6-SF-NEXT: # <MCInst #{{[0-9]+}} LW
; MMR6-SF-NEXT: # <MCOperand Reg:{{[0-9]+}}>
; MMR6-SF-NEXT: # <MCOperand Imm:20>>
; MMR6-SF-NEXT: .cfi_offset 31, -4
-; MMR6-SF-NEXT: jalr __fixdfsi # <MCInst #{{[0-9]+}} JALRC16_MMR6
+; MMR6-SF-NEXT: balc __fixdfsi # <MCInst #{{[0-9]+}} BALC_MMR6
; MMR6-SF-NEXT: # <MCOperand Expr:(__fixdfsi)>>
; MMR6-SF-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
; MMR6-SF-NEXT: # <MCInst #{{[0-9]+}} LW
; CHECK: jals
; CHECK-NEXT: sll16
-; CHECK-MMR6: jal
+; CHECK-MMR6: balc
; CHECK-MMR6-NOT: sll16
-; RUN: llc -mtriple=mips-mti-linux-gnu -mcpu=mips32r2 -mattr=+micromips -stop-after=finalize-isel < %s | FileCheck %s
+; RUN: llc -mtriple=mips-mti-linux-gnu -mcpu=mips32r2 -mattr=+micromips \
+; RUN: -stop-after=finalize-isel < %s | FileCheck --check-prefix=MM2 %s
+; RUN: llc -mtriple=mips-mti-linux-gnu -mcpu=mips32r6 -mattr=+micromips \
+; RUN: -stop-after=finalize-isel < %s | FileCheck --check-prefix=MM6 %s
-; CHECK: JAL_MM
-; CHECK-NOT: JALR16_MM
+; MM2: JAL_MM @bar
+; MM2: JAL_MM &memset
+; MM2-NOT: JALR16_MM
+
+; MM6: JAL_MMR6 @bar
+; MM6: JAL_MMR6 &memset
+; MM6-NOT: JALRC16_MMR6
define dso_local void @foo(i32* nocapture %ar) local_unnamed_addr {
entry:
+ call void @bar()
%0 = bitcast i32* %ar to i8*
tail call void @llvm.memset.p0i8.i32(i8* align 4 %0, i8 0, i32 100, i1 false)
ret void
}
declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1)
+declare void @bar()
; PIC32MM: jalr $25
; PIC32R6: jalr $25
; STATIC32: jal
-; STATIC32MMR6: jal
+; STATIC32MMR6: balc
; N64: jalr $25
; N64R6: jalr $25
; PIC16: jalrc
; PIC32MM: jalr $25
; PIC32R6: jalr $25
; STATIC32: jal
-; STATIC32MMR6: jal
+; STATIC32MMR6: balc
; N64: jalr $25
; N64R6: jalr $25
; PIC16: jalrc
; PIC32R6: jalr $25
; PIC32MM: jalr $25
; STATIC32: jal
-; STATIC32MMR6: jal
+; STATIC32MMR6: balc
; N64: jalr $25
; N64R6: jalr $25
; PIC16: jalrc
; PIC32R6: jalr $25
; PIC32MM: jalr $25
; STATIC32: jal
-; STATIC32MMR6: jal
+; STATIC32MMR6: balc
; PIC64: jalr $25
; STATIC64: jal
; PIC16: jalrc
; PIC32R6: jalrc $25
; PIC32MM: jalr $25
; STATIC32: jal
-; STATIC32MMR6: jal
+; STATIC32MMR6: balc
; STATIC64: jal
; PIC64: jalr $25
; PIC64R6: jalrc $25
; PIC32R6: jalr $25
; PIC32MM: jalr $25
; STATIC32: jal
-; STATIC32MMR6: jal
+; STATIC32MMR6: balc
; STATIC64: jal
; PIC64: jalr $25
; PIC64R6: jalr $25
; PIC32R6: jalrc $25
; PIC32MM: jalr $25
; STATIC32: jal
-; STATIC32MMR6: jal
+; STATIC32MMR6: balc
; STATIC64: jal
; PIC64: jalr $25
; PIC64R6: jalrc $25
; PIC32R6: jalrc $25
; PIC32MM: jalr $25
; STATIC32: jal
-; STATIC32MMR6: jal
+; STATIC32MMR6: balc
; STATIC64: jal
; PIC64: jalr $25
; PIC64R6: jalrc $25
; PIC32R6: jalr $25
; PIC32MM: jalr $25
; STATIC32: jal
-; STATIC32MMR6: jal
+; STATIC32MMR6: balc
; STATIC64: jal
; PIC64R6: jalr $25
; PIC64: jalr $25