mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-06 04:18:00 +00:00
[FastISel][AArch64] Don't perform sign-/zero-extension for function arguments that have already been sign-/zero-extended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214844 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2335,9 +2335,31 @@ bool AArch64FastISel::SelectIntExt(const Instruction *I) {
|
|||||||
|
|
||||||
MVT SrcVT = SrcEVT.getSimpleVT();
|
MVT SrcVT = SrcEVT.getSimpleVT();
|
||||||
MVT DestVT = DestEVT.getSimpleVT();
|
MVT DestVT = DestEVT.getSimpleVT();
|
||||||
unsigned ResultReg = EmitIntExt(SrcVT, SrcReg, DestVT, isZExt);
|
unsigned ResultReg = 0;
|
||||||
if (ResultReg == 0)
|
|
||||||
|
// Check if it is an argument and if it is already zero/sign-extended.
|
||||||
|
if (const auto *Arg = dyn_cast<Argument>(Src)) {
|
||||||
|
if ((isZExt && Arg->hasZExtAttr()) || (!isZExt && Arg->hasSExtAttr())) {
|
||||||
|
ResultReg = createResultReg(TLI.getRegClassFor(DestVT));
|
||||||
|
if (DestVT == MVT::i64)
|
||||||
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
|
||||||
|
TII.get(AArch64::SUBREG_TO_REG), ResultReg)
|
||||||
|
.addImm(0)
|
||||||
|
.addReg(SrcReg)
|
||||||
|
.addImm(AArch64::sub_32);
|
||||||
|
else
|
||||||
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
|
||||||
|
TII.get(TargetOpcode::COPY), ResultReg)
|
||||||
|
.addReg(SrcReg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ResultReg)
|
||||||
|
ResultReg = EmitIntExt(SrcVT, SrcReg, DestVT, isZExt);
|
||||||
|
|
||||||
|
if (!ResultReg)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
UpdateValueMap(I, ResultReg);
|
UpdateValueMap(I, ResultReg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
;; Test various conversions.
|
;; Test various conversions.
|
||||||
define zeroext i32 @trunc_(i8 zeroext %a, i16 zeroext %b, i32 %c, i64 %d) nounwind ssp {
|
define zeroext i32 @trunc_(i8 zeroext %a, i16 zeroext %b, i32 %c, i64 %d) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: trunc_
|
; CHECK-LABEL: trunc_
|
||||||
; CHECK: sub sp, sp, #16
|
; CHECK: sub sp, sp, #16
|
||||||
; CHECK: strb w0, [sp, #15]
|
; CHECK: strb w0, [sp, #15]
|
||||||
; CHECK: strh w1, [sp, #12]
|
; CHECK: strh w1, [sp, #12]
|
||||||
@@ -44,7 +44,7 @@ entry:
|
|||||||
|
|
||||||
define i64 @zext_(i8 zeroext %a, i16 zeroext %b, i32 %c, i64 %d) nounwind ssp {
|
define i64 @zext_(i8 zeroext %a, i16 zeroext %b, i32 %c, i64 %d) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: zext_
|
; CHECK-LABEL: zext_
|
||||||
; CHECK: sub sp, sp, #16
|
; CHECK: sub sp, sp, #16
|
||||||
; CHECK: strb w0, [sp, #15]
|
; CHECK: strb w0, [sp, #15]
|
||||||
; CHECK: strh w1, [sp, #12]
|
; CHECK: strh w1, [sp, #12]
|
||||||
@@ -85,23 +85,25 @@ entry:
|
|||||||
|
|
||||||
define i32 @zext_i1_i32(i1 zeroext %a) nounwind ssp {
|
define i32 @zext_i1_i32(i1 zeroext %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: @zext_i1_i32
|
; CHECK-LABEL: zext_i1_i32
|
||||||
; CHECK: and w0, w0, #0x1
|
; CHECK-NOT: and w0, w0, #0x1
|
||||||
|
; CHECK: ret
|
||||||
%conv = zext i1 %a to i32
|
%conv = zext i1 %a to i32
|
||||||
ret i32 %conv;
|
ret i32 %conv;
|
||||||
}
|
}
|
||||||
|
|
||||||
define i64 @zext_i1_i64(i1 zeroext %a) nounwind ssp {
|
define i64 @zext_i1_i64(i1 zeroext %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: @zext_i1_i64
|
; CHECK-LABEL: zext_i1_i64
|
||||||
; CHECK: and w0, w0, #0x1
|
; CHECK-NOT: and w0, w0, #0x1
|
||||||
|
; CHECK: ret
|
||||||
%conv = zext i1 %a to i64
|
%conv = zext i1 %a to i64
|
||||||
ret i64 %conv;
|
ret i64 %conv;
|
||||||
}
|
}
|
||||||
|
|
||||||
define i64 @sext_(i8 signext %a, i16 signext %b, i32 %c, i64 %d) nounwind ssp {
|
define i64 @sext_(i8 signext %a, i16 signext %b, i32 %c, i64 %d) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sext_
|
; CHECK-LABEL: sext_
|
||||||
; CHECK: sub sp, sp, #16
|
; CHECK: sub sp, sp, #16
|
||||||
; CHECK: strb w0, [sp, #15]
|
; CHECK: strb w0, [sp, #15]
|
||||||
; CHECK: strh w1, [sp, #12]
|
; CHECK: strh w1, [sp, #12]
|
||||||
@@ -161,8 +163,9 @@ define zeroext i64 @sext_i16_i64(i16 zeroext %in) {
|
|||||||
; Test sext i1 to i32
|
; Test sext i1 to i32
|
||||||
define i32 @sext_i1_i32(i1 signext %a) nounwind ssp {
|
define i32 @sext_i1_i32(i1 signext %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sext_i1_i32
|
; CHECK-LABEL: sext_i1_i32
|
||||||
; CHECK: sbfx w0, w0, #0, #1
|
; CHECK-NOT: sbfx w0, w0, #0, #1
|
||||||
|
; CHECK: ret
|
||||||
%conv = sext i1 %a to i32
|
%conv = sext i1 %a to i32
|
||||||
ret i32 %conv
|
ret i32 %conv
|
||||||
}
|
}
|
||||||
@@ -170,7 +173,7 @@ entry:
|
|||||||
; Test sext i1 to i16
|
; Test sext i1 to i16
|
||||||
define signext i16 @sext_i1_i16(i1 %a) nounwind ssp {
|
define signext i16 @sext_i1_i16(i1 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sext_i1_i16
|
; CHECK-LABEL: sext_i1_i16
|
||||||
; CHECK: sbfx w0, w0, #0, #1
|
; CHECK: sbfx w0, w0, #0, #1
|
||||||
%conv = sext i1 %a to i16
|
%conv = sext i1 %a to i16
|
||||||
ret i16 %conv
|
ret i16 %conv
|
||||||
@@ -179,7 +182,7 @@ entry:
|
|||||||
; Test sext i1 to i8
|
; Test sext i1 to i8
|
||||||
define signext i8 @sext_i1_i8(i1 %a) nounwind ssp {
|
define signext i8 @sext_i1_i8(i1 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sext_i1_i8
|
; CHECK-LABEL: sext_i1_i8
|
||||||
; CHECK: sbfx w0, w0, #0, #1
|
; CHECK: sbfx w0, w0, #0, #1
|
||||||
%conv = sext i1 %a to i8
|
%conv = sext i1 %a to i8
|
||||||
ret i8 %conv
|
ret i8 %conv
|
||||||
@@ -188,7 +191,7 @@ entry:
|
|||||||
; Test fpext
|
; Test fpext
|
||||||
define double @fpext_(float %a) nounwind ssp {
|
define double @fpext_(float %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: fpext_
|
; CHECK-LABEL: fpext_
|
||||||
; CHECK: fcvt d0, s0
|
; CHECK: fcvt d0, s0
|
||||||
%conv = fpext float %a to double
|
%conv = fpext float %a to double
|
||||||
ret double %conv
|
ret double %conv
|
||||||
@@ -197,7 +200,7 @@ entry:
|
|||||||
; Test fptrunc
|
; Test fptrunc
|
||||||
define float @fptrunc_(double %a) nounwind ssp {
|
define float @fptrunc_(double %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: fptrunc_
|
; CHECK-LABEL: fptrunc_
|
||||||
; CHECK: fcvt s0, d0
|
; CHECK: fcvt s0, d0
|
||||||
%conv = fptrunc double %a to float
|
%conv = fptrunc double %a to float
|
||||||
ret float %conv
|
ret float %conv
|
||||||
@@ -206,7 +209,7 @@ entry:
|
|||||||
; Test fptosi
|
; Test fptosi
|
||||||
define i32 @fptosi_ws(float %a) nounwind ssp {
|
define i32 @fptosi_ws(float %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: fptosi_ws
|
; CHECK-LABEL: fptosi_ws
|
||||||
; CHECK: fcvtzs w0, s0
|
; CHECK: fcvtzs w0, s0
|
||||||
%conv = fptosi float %a to i32
|
%conv = fptosi float %a to i32
|
||||||
ret i32 %conv
|
ret i32 %conv
|
||||||
@@ -215,7 +218,7 @@ entry:
|
|||||||
; Test fptosi
|
; Test fptosi
|
||||||
define i32 @fptosi_wd(double %a) nounwind ssp {
|
define i32 @fptosi_wd(double %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: fptosi_wd
|
; CHECK-LABEL: fptosi_wd
|
||||||
; CHECK: fcvtzs w0, d0
|
; CHECK: fcvtzs w0, d0
|
||||||
%conv = fptosi double %a to i32
|
%conv = fptosi double %a to i32
|
||||||
ret i32 %conv
|
ret i32 %conv
|
||||||
@@ -224,7 +227,7 @@ entry:
|
|||||||
; Test fptoui
|
; Test fptoui
|
||||||
define i32 @fptoui_ws(float %a) nounwind ssp {
|
define i32 @fptoui_ws(float %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: fptoui_ws
|
; CHECK-LABEL: fptoui_ws
|
||||||
; CHECK: fcvtzu w0, s0
|
; CHECK: fcvtzu w0, s0
|
||||||
%conv = fptoui float %a to i32
|
%conv = fptoui float %a to i32
|
||||||
ret i32 %conv
|
ret i32 %conv
|
||||||
@@ -233,7 +236,7 @@ entry:
|
|||||||
; Test fptoui
|
; Test fptoui
|
||||||
define i32 @fptoui_wd(double %a) nounwind ssp {
|
define i32 @fptoui_wd(double %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: fptoui_wd
|
; CHECK-LABEL: fptoui_wd
|
||||||
; CHECK: fcvtzu w0, d0
|
; CHECK: fcvtzu w0, d0
|
||||||
%conv = fptoui double %a to i32
|
%conv = fptoui double %a to i32
|
||||||
ret i32 %conv
|
ret i32 %conv
|
||||||
@@ -242,7 +245,7 @@ entry:
|
|||||||
; Test sitofp
|
; Test sitofp
|
||||||
define float @sitofp_sw_i1(i1 %a) nounwind ssp {
|
define float @sitofp_sw_i1(i1 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sitofp_sw_i1
|
; CHECK-LABEL: sitofp_sw_i1
|
||||||
; CHECK: sbfx w0, w0, #0, #1
|
; CHECK: sbfx w0, w0, #0, #1
|
||||||
; CHECK: scvtf s0, w0
|
; CHECK: scvtf s0, w0
|
||||||
%conv = sitofp i1 %a to float
|
%conv = sitofp i1 %a to float
|
||||||
@@ -252,7 +255,7 @@ entry:
|
|||||||
; Test sitofp
|
; Test sitofp
|
||||||
define float @sitofp_sw_i8(i8 %a) nounwind ssp {
|
define float @sitofp_sw_i8(i8 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sitofp_sw_i8
|
; CHECK-LABEL: sitofp_sw_i8
|
||||||
; CHECK: sxtb w0, w0
|
; CHECK: sxtb w0, w0
|
||||||
; CHECK: scvtf s0, w0
|
; CHECK: scvtf s0, w0
|
||||||
%conv = sitofp i8 %a to float
|
%conv = sitofp i8 %a to float
|
||||||
@@ -262,9 +265,7 @@ entry:
|
|||||||
; Test sitofp
|
; Test sitofp
|
||||||
define float @sitofp_sw_i16(i16 %a) nounwind ssp {
|
define float @sitofp_sw_i16(i16 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sitofp_sw_i16
|
; CHECK-LABEL: sitofp_sw_i16
|
||||||
; CHECK: sxth w0, w0
|
|
||||||
; CHECK: scvtf s0, w0
|
|
||||||
%conv = sitofp i16 %a to float
|
%conv = sitofp i16 %a to float
|
||||||
ret float %conv
|
ret float %conv
|
||||||
}
|
}
|
||||||
@@ -272,7 +273,7 @@ entry:
|
|||||||
; Test sitofp
|
; Test sitofp
|
||||||
define float @sitofp_sw(i32 %a) nounwind ssp {
|
define float @sitofp_sw(i32 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sitofp_sw
|
; CHECK-LABEL: sitofp_sw
|
||||||
; CHECK: scvtf s0, w0
|
; CHECK: scvtf s0, w0
|
||||||
%conv = sitofp i32 %a to float
|
%conv = sitofp i32 %a to float
|
||||||
ret float %conv
|
ret float %conv
|
||||||
@@ -281,7 +282,7 @@ entry:
|
|||||||
; Test sitofp
|
; Test sitofp
|
||||||
define float @sitofp_sx(i64 %a) nounwind ssp {
|
define float @sitofp_sx(i64 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sitofp_sx
|
; CHECK-LABEL: sitofp_sx
|
||||||
; CHECK: scvtf s0, x0
|
; CHECK: scvtf s0, x0
|
||||||
%conv = sitofp i64 %a to float
|
%conv = sitofp i64 %a to float
|
||||||
ret float %conv
|
ret float %conv
|
||||||
@@ -290,7 +291,7 @@ entry:
|
|||||||
; Test sitofp
|
; Test sitofp
|
||||||
define double @sitofp_dw(i32 %a) nounwind ssp {
|
define double @sitofp_dw(i32 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sitofp_dw
|
; CHECK-LABEL: sitofp_dw
|
||||||
; CHECK: scvtf d0, w0
|
; CHECK: scvtf d0, w0
|
||||||
%conv = sitofp i32 %a to double
|
%conv = sitofp i32 %a to double
|
||||||
ret double %conv
|
ret double %conv
|
||||||
@@ -299,7 +300,7 @@ entry:
|
|||||||
; Test sitofp
|
; Test sitofp
|
||||||
define double @sitofp_dx(i64 %a) nounwind ssp {
|
define double @sitofp_dx(i64 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: sitofp_dx
|
; CHECK-LABEL: sitofp_dx
|
||||||
; CHECK: scvtf d0, x0
|
; CHECK: scvtf d0, x0
|
||||||
%conv = sitofp i64 %a to double
|
%conv = sitofp i64 %a to double
|
||||||
ret double %conv
|
ret double %conv
|
||||||
@@ -308,7 +309,7 @@ entry:
|
|||||||
; Test uitofp
|
; Test uitofp
|
||||||
define float @uitofp_sw_i1(i1 %a) nounwind ssp {
|
define float @uitofp_sw_i1(i1 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: uitofp_sw_i1
|
; CHECK-LABEL: uitofp_sw_i1
|
||||||
; CHECK: and w0, w0, #0x1
|
; CHECK: and w0, w0, #0x1
|
||||||
; CHECK: ucvtf s0, w0
|
; CHECK: ucvtf s0, w0
|
||||||
%conv = uitofp i1 %a to float
|
%conv = uitofp i1 %a to float
|
||||||
@@ -318,9 +319,7 @@ entry:
|
|||||||
; Test uitofp
|
; Test uitofp
|
||||||
define float @uitofp_sw_i8(i8 %a) nounwind ssp {
|
define float @uitofp_sw_i8(i8 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: uitofp_sw_i8
|
; CHECK-LABEL: uitofp_sw_i8
|
||||||
; CHECK: uxtb w0, w0
|
|
||||||
; CHECK: ucvtf s0, w0
|
|
||||||
%conv = uitofp i8 %a to float
|
%conv = uitofp i8 %a to float
|
||||||
ret float %conv
|
ret float %conv
|
||||||
}
|
}
|
||||||
@@ -328,9 +327,7 @@ entry:
|
|||||||
; Test uitofp
|
; Test uitofp
|
||||||
define float @uitofp_sw_i16(i16 %a) nounwind ssp {
|
define float @uitofp_sw_i16(i16 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: uitofp_sw_i16
|
; CHECK-LABEL: uitofp_sw_i16
|
||||||
; CHECK: uxth w0, w0
|
|
||||||
; CHECK: ucvtf s0, w0
|
|
||||||
%conv = uitofp i16 %a to float
|
%conv = uitofp i16 %a to float
|
||||||
ret float %conv
|
ret float %conv
|
||||||
}
|
}
|
||||||
@@ -338,7 +335,7 @@ entry:
|
|||||||
; Test uitofp
|
; Test uitofp
|
||||||
define float @uitofp_sw(i32 %a) nounwind ssp {
|
define float @uitofp_sw(i32 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: uitofp_sw
|
; CHECK-LABEL: uitofp_sw
|
||||||
; CHECK: ucvtf s0, w0
|
; CHECK: ucvtf s0, w0
|
||||||
%conv = uitofp i32 %a to float
|
%conv = uitofp i32 %a to float
|
||||||
ret float %conv
|
ret float %conv
|
||||||
@@ -347,7 +344,7 @@ entry:
|
|||||||
; Test uitofp
|
; Test uitofp
|
||||||
define float @uitofp_sx(i64 %a) nounwind ssp {
|
define float @uitofp_sx(i64 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: uitofp_sx
|
; CHECK-LABEL: uitofp_sx
|
||||||
; CHECK: ucvtf s0, x0
|
; CHECK: ucvtf s0, x0
|
||||||
%conv = uitofp i64 %a to float
|
%conv = uitofp i64 %a to float
|
||||||
ret float %conv
|
ret float %conv
|
||||||
@@ -356,7 +353,7 @@ entry:
|
|||||||
; Test uitofp
|
; Test uitofp
|
||||||
define double @uitofp_dw(i32 %a) nounwind ssp {
|
define double @uitofp_dw(i32 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: uitofp_dw
|
; CHECK-LABEL: uitofp_dw
|
||||||
; CHECK: ucvtf d0, w0
|
; CHECK: ucvtf d0, w0
|
||||||
%conv = uitofp i32 %a to double
|
%conv = uitofp i32 %a to double
|
||||||
ret double %conv
|
ret double %conv
|
||||||
@@ -365,7 +362,7 @@ entry:
|
|||||||
; Test uitofp
|
; Test uitofp
|
||||||
define double @uitofp_dx(i64 %a) nounwind ssp {
|
define double @uitofp_dx(i64 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: uitofp_dx
|
; CHECK-LABEL: uitofp_dx
|
||||||
; CHECK: ucvtf d0, x0
|
; CHECK: ucvtf d0, x0
|
||||||
%conv = uitofp i64 %a to double
|
%conv = uitofp i64 %a to double
|
||||||
ret double %conv
|
ret double %conv
|
||||||
@@ -373,7 +370,7 @@ entry:
|
|||||||
|
|
||||||
define i32 @i64_trunc_i32(i64 %a) nounwind ssp {
|
define i32 @i64_trunc_i32(i64 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: i64_trunc_i32
|
; CHECK-LABEL: i64_trunc_i32
|
||||||
; CHECK: mov x1, x0
|
; CHECK: mov x1, x0
|
||||||
%conv = trunc i64 %a to i32
|
%conv = trunc i64 %a to i32
|
||||||
ret i32 %conv
|
ret i32 %conv
|
||||||
@@ -381,7 +378,7 @@ entry:
|
|||||||
|
|
||||||
define zeroext i16 @i64_trunc_i16(i64 %a) nounwind ssp {
|
define zeroext i16 @i64_trunc_i16(i64 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: i64_trunc_i16
|
; CHECK-LABEL: i64_trunc_i16
|
||||||
; CHECK: mov x[[REG:[0-9]+]], x0
|
; CHECK: mov x[[REG:[0-9]+]], x0
|
||||||
; CHECK: and [[REG2:w[0-9]+]], w[[REG]], #0xffff
|
; CHECK: and [[REG2:w[0-9]+]], w[[REG]], #0xffff
|
||||||
; CHECK: uxth w0, [[REG2]]
|
; CHECK: uxth w0, [[REG2]]
|
||||||
@@ -391,7 +388,7 @@ entry:
|
|||||||
|
|
||||||
define zeroext i8 @i64_trunc_i8(i64 %a) nounwind ssp {
|
define zeroext i8 @i64_trunc_i8(i64 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: i64_trunc_i8
|
; CHECK-LABEL: i64_trunc_i8
|
||||||
; CHECK: mov x[[REG:[0-9]+]], x0
|
; CHECK: mov x[[REG:[0-9]+]], x0
|
||||||
; CHECK: and [[REG2:w[0-9]+]], w[[REG]], #0xff
|
; CHECK: and [[REG2:w[0-9]+]], w[[REG]], #0xff
|
||||||
; CHECK: uxtb w0, [[REG2]]
|
; CHECK: uxtb w0, [[REG2]]
|
||||||
@@ -401,7 +398,7 @@ entry:
|
|||||||
|
|
||||||
define zeroext i1 @i64_trunc_i1(i64 %a) nounwind ssp {
|
define zeroext i1 @i64_trunc_i1(i64 %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
; CHECK: i64_trunc_i1
|
; CHECK-LABEL: i64_trunc_i1
|
||||||
; CHECK: mov x[[REG:[0-9]+]], x0
|
; CHECK: mov x[[REG:[0-9]+]], x0
|
||||||
; CHECK: and [[REG2:w[0-9]+]], w[[REG]], #0x1
|
; CHECK: and [[REG2:w[0-9]+]], w[[REG]], #0x1
|
||||||
; CHECK: and w0, [[REG2]], #0x1
|
; CHECK: and w0, [[REG2]], #0x1
|
||||||
@@ -411,7 +408,7 @@ entry:
|
|||||||
|
|
||||||
; rdar://15101939
|
; rdar://15101939
|
||||||
define void @stack_trunc() nounwind {
|
define void @stack_trunc() nounwind {
|
||||||
; CHECK: stack_trunc
|
; CHECK-LABEL: stack_trunc
|
||||||
; CHECK: sub sp, sp, #16
|
; CHECK: sub sp, sp, #16
|
||||||
; CHECK: ldr [[REG:x[0-9]+]], [sp]
|
; CHECK: ldr [[REG:x[0-9]+]], [sp]
|
||||||
; CHECK: mov x[[REG2:[0-9]+]], [[REG]]
|
; CHECK: mov x[[REG2:[0-9]+]], [[REG]]
|
||||||
@@ -428,15 +425,15 @@ define void @stack_trunc() nounwind {
|
|||||||
|
|
||||||
define zeroext i64 @zext_i8_i64(i8 zeroext %in) {
|
define zeroext i64 @zext_i8_i64(i8 zeroext %in) {
|
||||||
; CHECK-LABEL: zext_i8_i64:
|
; CHECK-LABEL: zext_i8_i64:
|
||||||
; CHECK: mov x[[TMP:[0-9]+]], x0
|
; CHECK-NOT: ubfx x0, {{x[0-9]+}}, #0, #8
|
||||||
; CHECK: ubfx x0, x[[TMP]], #0, #8
|
; CHECK: ret
|
||||||
%big = zext i8 %in to i64
|
%big = zext i8 %in to i64
|
||||||
ret i64 %big
|
ret i64 %big
|
||||||
}
|
}
|
||||||
define zeroext i64 @zext_i16_i64(i16 zeroext %in) {
|
define zeroext i64 @zext_i16_i64(i16 zeroext %in) {
|
||||||
; CHECK-LABEL: zext_i16_i64:
|
; CHECK-LABEL: zext_i16_i64:
|
||||||
; CHECK: mov x[[TMP:[0-9]+]], x0
|
; CHECK-NOT: ubfx x0, {{x[0-9]+}}, #0, #16
|
||||||
; CHECK: ubfx x0, x[[TMP]], #0, #16
|
; CHECK: ret
|
||||||
%big = zext i16 %in to i64
|
%big = zext i16 %in to i64
|
||||||
ret i64 %big
|
ret i64 %big
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user