2015-05-08 08:57:22 +08:00
|
|
|
; RUN: llc -mtriple=mips64el-unknown-unknown -mcpu=mips4 -mattr=+soft-float -O1 \
|
2017-01-27 19:36:52 +08:00
|
|
|
; RUN: -disable-mips-delay-filler -relocation-model=pic < %s | FileCheck \
|
|
|
|
; RUN: %s -check-prefixes=ALL,C_CC_FMT,PRER6
|
2015-05-08 08:57:22 +08:00
|
|
|
; RUN: llc -mtriple=mips64el-unknown-unknown -mcpu=mips64 -mattr=+soft-float -O1 \
|
2017-01-27 19:36:52 +08:00
|
|
|
; RUN: -disable-mips-delay-filler -relocation-model=pic < %s | FileCheck \
|
|
|
|
; RUN: %s -check-prefixes=ALL,C_CC_FMT,PRER6
|
|
|
|
; RUN: llc -mtriple=mips64el-unknown-unknown -mcpu=mips64r2 -mattr=+soft-float \
|
|
|
|
; RUN: -O1 -disable-mips-delay-filler -relocation-model=pic < %s | FileCheck \
|
|
|
|
; RUN: %s -check-prefixes=ALL,C_CC_FMT,PRER6
|
|
|
|
; RUN: llc -mtriple=mips64el-unknown-unknown -mcpu=mips64r6 -mattr=+soft-float \
|
|
|
|
; RUN: -O1 -disable-mips-delay-filler -relocation-model=pic < %s | FileCheck \
|
|
|
|
; RUN: %s -check-prefixes=ALL,CMP_CC_FMT,R6
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
@gld0 = external global fp128
|
|
|
|
@gld1 = external global fp128
|
|
|
|
@gld2 = external global fp128
|
|
|
|
@gf1 = external global float
|
|
|
|
@gd1 = external global double
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: addLD:
|
|
|
|
; ALL: ld $25, %call16(__addtf3)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @addLD() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
|
|
|
%1 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%add = fadd fp128 %0, %1
|
|
|
|
ret fp128 %add
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: subLD:
|
|
|
|
; ALL: ld $25, %call16(__subtf3)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @subLD() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
|
|
|
%1 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%sub = fsub fp128 %0, %1
|
|
|
|
ret fp128 %sub
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: mulLD:
|
|
|
|
; ALL: ld $25, %call16(__multf3)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @mulLD() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
|
|
|
%1 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%mul = fmul fp128 %0, %1
|
|
|
|
ret fp128 %mul
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: divLD:
|
|
|
|
; ALL: ld $25, %call16(__divtf3)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @divLD() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
|
|
|
%1 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%div = fdiv fp128 %0, %1
|
|
|
|
ret fp128 %div
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_char:
|
|
|
|
; ALL: ld $25, %call16(__floatsitf)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @conv_LD_char(i8 signext %a) {
|
|
|
|
entry:
|
|
|
|
%conv = sitofp i8 %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_short:
|
|
|
|
; ALL: ld $25, %call16(__floatsitf)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @conv_LD_short(i16 signext %a) {
|
|
|
|
entry:
|
|
|
|
%conv = sitofp i16 %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_int:
|
|
|
|
; ALL: ld $25, %call16(__floatsitf)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @conv_LD_int(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = sitofp i32 %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_LL:
|
|
|
|
; ALL: ld $25, %call16(__floatditf)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @conv_LD_LL(i64 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = sitofp i64 %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_UChar:
|
|
|
|
; ALL: ld $25, %call16(__floatunsitf)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @conv_LD_UChar(i8 zeroext %a) {
|
|
|
|
entry:
|
|
|
|
%conv = uitofp i8 %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_UShort:
|
|
|
|
; ALL: ld $25, %call16(__floatunsitf)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @conv_LD_UShort(i16 zeroext %a) {
|
|
|
|
entry:
|
|
|
|
%conv = uitofp i16 %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_UInt:
|
|
|
|
; ALL: ld $25, %call16(__floatunsitf)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
2014-11-08 00:54:21 +08:00
|
|
|
define fp128 @conv_LD_UInt(i32 signext %a) {
|
2013-03-02 05:11:44 +08:00
|
|
|
entry:
|
|
|
|
%conv = uitofp i32 %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_ULL:
|
|
|
|
; ALL: ld $25, %call16(__floatunditf)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @conv_LD_ULL(i64 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = uitofp i64 %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_char_LD:
|
|
|
|
; ALL: ld $25, %call16(__fixtfsi)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define signext i8 @conv_char_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptosi fp128 %a to i8
|
|
|
|
ret i8 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_short_LD:
|
|
|
|
; ALL: ld $25, %call16(__fixtfsi)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define signext i16 @conv_short_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptosi fp128 %a to i16
|
|
|
|
ret i16 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_int_LD:
|
|
|
|
; ALL: ld $25, %call16(__fixtfsi)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i32 @conv_int_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptosi fp128 %a to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LL_LD:
|
|
|
|
; ALL: ld $25, %call16(__fixtfdi)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i64 @conv_LL_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptosi fp128 %a to i64
|
|
|
|
ret i64 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_UChar_LD:
|
|
|
|
; ALL: ld $25, %call16(__fixtfsi)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define zeroext i8 @conv_UChar_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptoui fp128 %a to i8
|
|
|
|
ret i8 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_UShort_LD:
|
|
|
|
; ALL: ld $25, %call16(__fixtfsi)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define zeroext i16 @conv_UShort_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptoui fp128 %a to i16
|
|
|
|
ret i16 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_UInt_LD:
|
|
|
|
; ALL: ld $25, %call16(__fixunstfsi)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i32 @conv_UInt_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptoui fp128 %a to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_ULL_LD:
|
|
|
|
; ALL: ld $25, %call16(__fixunstfdi)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i64 @conv_ULL_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptoui fp128 %a to i64
|
|
|
|
ret i64 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_float:
|
|
|
|
; ALL: ld $25, %call16(__extendsftf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @conv_LD_float(float %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fpext float %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_LD_double:
|
|
|
|
; ALL: ld $25, %call16(__extenddftf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @conv_LD_double(double %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fpext double %a to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_float_LD:
|
|
|
|
; ALL: ld $25, %call16(__trunctfsf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define float @conv_float_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptrunc fp128 %a to float
|
|
|
|
ret float %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: conv_double_LD:
|
|
|
|
; ALL: ld $25, %call16(__trunctfdf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define double @conv_double_LD(fp128 %a) {
|
|
|
|
entry:
|
|
|
|
%conv = fptrunc fp128 %a to double
|
|
|
|
ret double %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_fabsl:
|
|
|
|
; ALL-DAG: ld $[[R0:[0-9]+]], 8($[[R4:[0-9]+]])
|
|
|
|
; ALL-DAG: daddiu $[[R1:[0-9]+]], $zero, 1
|
|
|
|
; ALL-DAG: dsll $[[R2:[0-9]+]], $[[R1]], 63
|
|
|
|
; ALL-DAG: daddiu $[[R3:[0-9]+]], $[[R2]], -1
|
|
|
|
; ALL-DAG: and $4, $[[R0]], $[[R3]]
|
|
|
|
; ALL-DAG: ld $2, 0($[[R4]])
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_fabsl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @fabsl(fp128 %0) nounwind readnone
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @fabsl(fp128) #1
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_ceill:
|
|
|
|
; ALL: ld $25, %call16(ceill)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_ceill() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @ceill(fp128 %0) nounwind readnone
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @ceill(fp128) #1
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_sinl:
|
|
|
|
; ALL: ld $25, %call16(sinl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_sinl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @sinl(fp128 %0) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @sinl(fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_cosl:
|
|
|
|
; ALL: ld $25, %call16(cosl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_cosl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @cosl(fp128 %0) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @cosl(fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_expl:
|
|
|
|
; ALL: ld $25, %call16(expl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_expl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @expl(fp128 %0) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @expl(fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_exp2l:
|
|
|
|
; ALL: ld $25, %call16(exp2l)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_exp2l() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @exp2l(fp128 %0) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @exp2l(fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_logl:
|
|
|
|
; ALL: ld $25, %call16(logl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_logl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @logl(fp128 %0) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @logl(fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_log2l:
|
|
|
|
; ALL: ld $25, %call16(log2l)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_log2l() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @log2l(fp128 %0) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @log2l(fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_log10l:
|
|
|
|
; ALL: ld $25, %call16(log10l)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_log10l() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @log10l(fp128 %0) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @log10l(fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_nearbyintl:
|
|
|
|
; ALL: ld $25, %call16(nearbyintl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_nearbyintl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @nearbyintl(fp128 %0) nounwind readnone
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @nearbyintl(fp128) #1
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_floorl:
|
|
|
|
; ALL: ld $25, %call16(floorl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_floorl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @floorl(fp128 %0) nounwind readnone
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @floorl(fp128) #1
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_sqrtl:
|
|
|
|
; ALL: ld $25, %call16(sqrtl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_sqrtl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @sqrtl(fp128 %0) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @sqrtl(fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall1_rintl:
|
|
|
|
; ALL: ld $25, %call16(rintl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall1_rintl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @rintl(fp128 %0) nounwind readnone
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @rintl(fp128) #1
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall_powil:
|
|
|
|
; ALL: ld $25, %call16(__powitf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall_powil(fp128 %a, i32 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = tail call fp128 @llvm.powi.f128(fp128 %a, i32 %b)
|
|
|
|
ret fp128 %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @llvm.powi.f128(fp128, i32) #3
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall2_copysignl:
|
|
|
|
; ALL-DAG: daddiu $[[R2:[0-9]+]], $zero, 1
|
|
|
|
; ALL-DAG: dsll $[[R3:[0-9]+]], $[[R2]], 63
|
|
|
|
; ALL-DAG: ld $[[R0:[0-9]+]], %got_disp(gld1)
|
|
|
|
; ALL-DAG: ld $[[R1:[0-9]+]], 8($[[R0]])
|
|
|
|
; ALL-DAG: and $[[R4:[0-9]+]], $[[R1]], $[[R3]]
|
|
|
|
; ALL-DAG: ld $[[R5:[0-9]+]], %got_disp(gld0)
|
|
|
|
; ALL-DAG: ld $[[R6:[0-9]+]], 8($[[R5]])
|
|
|
|
; ALL-DAG: daddiu $[[R7:[0-9]+]], $[[R3]], -1
|
|
|
|
; ALL-DAG: and $[[R8:[0-9]+]], $[[R6]], $[[R7]]
|
|
|
|
; ALL-DAG: or $4, $[[R8]], $[[R4]]
|
|
|
|
; ALL-DAG: ld $2, 0($[[R5]])
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall2_copysignl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
|
|
|
%1 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @copysignl(fp128 %0, fp128 %1) nounwind readnone
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @copysignl(fp128, fp128) #1
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall2_powl:
|
|
|
|
; ALL: ld $25, %call16(powl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall2_powl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
|
|
|
%1 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @powl(fp128 %0, fp128 %1) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @powl(fp128, fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall2_fmodl:
|
|
|
|
; ALL: ld $25, %call16(fmodl)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall2_fmodl() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
|
|
|
%1 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%call = tail call fp128 @fmodl(fp128 %0, fp128 %1) nounwind
|
|
|
|
ret fp128 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @fmodl(fp128, fp128) #2
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: libcall3_fmal:
|
|
|
|
; ALL: ld $25, %call16(fmal)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @libcall3_fmal() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld0, align 16
|
|
|
|
%1 = load fp128, fp128* @gld2, align 16
|
|
|
|
%2 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%3 = tail call fp128 @llvm.fma.f128(fp128 %0, fp128 %2, fp128 %1)
|
|
|
|
ret fp128 %3
|
|
|
|
}
|
|
|
|
|
|
|
|
declare fp128 @llvm.fma.f128(fp128, fp128, fp128) #4
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: cmp_lt:
|
|
|
|
; ALL: ld $25, %call16(__lttf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i32 @cmp_lt(fp128 %a, fp128 %b) {
|
|
|
|
entry:
|
|
|
|
%cmp = fcmp olt fp128 %a, %b
|
|
|
|
%conv = zext i1 %cmp to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: cmp_le:
|
|
|
|
; ALL: ld $25, %call16(__letf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i32 @cmp_le(fp128 %a, fp128 %b) {
|
|
|
|
entry:
|
|
|
|
%cmp = fcmp ole fp128 %a, %b
|
|
|
|
%conv = zext i1 %cmp to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: cmp_gt:
|
|
|
|
; ALL: ld $25, %call16(__gttf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i32 @cmp_gt(fp128 %a, fp128 %b) {
|
|
|
|
entry:
|
|
|
|
%cmp = fcmp ogt fp128 %a, %b
|
|
|
|
%conv = zext i1 %cmp to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: cmp_ge:
|
|
|
|
; ALL: ld $25, %call16(__getf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i32 @cmp_ge(fp128 %a, fp128 %b) {
|
|
|
|
entry:
|
|
|
|
%cmp = fcmp oge fp128 %a, %b
|
|
|
|
%conv = zext i1 %cmp to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: cmp_eq:
|
|
|
|
; ALL: ld $25, %call16(__eqtf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i32 @cmp_eq(fp128 %a, fp128 %b) {
|
|
|
|
entry:
|
|
|
|
%cmp = fcmp oeq fp128 %a, %b
|
|
|
|
%conv = zext i1 %cmp to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: cmp_ne:
|
|
|
|
; ALL: ld $25, %call16(__netf2)
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define i32 @cmp_ne(fp128 %a, fp128 %b) {
|
|
|
|
entry:
|
|
|
|
%cmp = fcmp une fp128 %a, %b
|
|
|
|
%conv = zext i1 %cmp to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: load_LD_LD:
|
|
|
|
; ALL: ld $[[R0:[0-9]+]], %got_disp(gld1)
|
|
|
|
; ALL: ld $2, 0($[[R0]])
|
|
|
|
; ALL: ld $4, 8($[[R0]])
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @load_LD_LD() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
ret fp128 %0
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: load_LD_float:
|
2016-04-05 20:50:29 +08:00
|
|
|
; ALL: ld $[[R0:[0-9]+]], %got_disp(gf1)
|
|
|
|
; ALL: lw $4, 0($[[R0]])
|
|
|
|
; ALL: ld $25, %call16(__extendsftf2)
|
|
|
|
; PRER6: jalr $25
|
2016-04-14 21:43:17 +08:00
|
|
|
; R6: jalrc $25
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @load_LD_float() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load float, float* @gf1, align 4
|
2013-03-02 05:11:44 +08:00
|
|
|
%conv = fpext float %0 to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: load_LD_double:
|
2016-04-05 20:50:29 +08:00
|
|
|
; ALL: ld $[[R0:[0-9]+]], %got_disp(gd1)
|
|
|
|
; ALL: ld $4, 0($[[R0]])
|
|
|
|
; ALL: ld $25, %call16(__extenddftf2)
|
|
|
|
; PRER6: jalr $25
|
2016-04-14 21:43:17 +08:00
|
|
|
; R6: jalrc $25
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @load_LD_double() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load double, double* @gd1, align 8
|
2013-03-02 05:11:44 +08:00
|
|
|
%conv = fpext double %0 to fp128
|
|
|
|
ret fp128 %conv
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: store_LD_LD:
|
|
|
|
; ALL: ld $[[R0:[0-9]+]], %got_disp(gld1)
|
|
|
|
; ALL: ld $[[R2:[0-9]+]], 8($[[R0]])
|
|
|
|
; ALL: ld $[[R3:[0-9]+]], %got_disp(gld0)
|
|
|
|
; ALL: sd $[[R2]], 8($[[R3]])
|
In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.
Recommiting after fixup of 32-bit aliasing sign offset bug in DAGCombiner.
* Simplify Consecutive Merge Store Candidate Search
Now that address aliasing is much less conservative, push through
simplified store merging search and chain alias analysis which only
checks for parallel stores through the chain subgraph. This is cleaner
as the separation of non-interfering loads/stores from the
store-merging logic.
When merging stores search up the chain through a single load, and
finds all possible stores by looking down from through a load and a
TokenFactor to all stores visited.
This improves the quality of the output SelectionDAG and the output
Codegen (save perhaps for some ARM cases where we correctly constructs
wider loads, but then promotes them to float operations which appear
but requires more expensive constant generation).
Some minor peephole optimizations to deal with improved SubDAG shapes (listed below)
Additional Minor Changes:
1. Finishes removing unused AliasLoad code
2. Unifies the chain aggregation in the merged stores across code
paths
3. Re-add the Store node to the worklist after calling
SimplifyDemandedBits.
4. Increase GatherAllAliasesMaxDepth from 6 to 18. That number is
arbitrary, but seems sufficient to not cause regressions in
tests.
5. Remove Chain dependencies of Memory operations on CopyfromReg
nodes as these are captured by data dependence
6. Forward loads-store values through tokenfactors containing
{CopyToReg,CopyFromReg} Values.
7. Peephole to convert buildvector of extract_vector_elt to
extract_subvector if possible (see
CodeGen/AArch64/store-merge.ll)
8. Store merging for the ARM target is restricted to 32-bit as
some in some contexts invalid 64-bit operations are being
generated. This can be removed once appropriate checks are
added.
This finishes the change Matt Arsenault started in r246307 and
jyknight's original patch.
Many tests required some changes as memory operations are now
reorderable, improving load-store forwarding. One test in
particular is worth noting:
CodeGen/PowerPC/ppc64-align-long-double.ll - Improved load-store
forwarding converts a load-store pair into a parallel store and
a memory-realized bitcast of the same value. However, because we
lose the sharing of the explicit and implicit store values we
must create another local store. A similar transformation
happens before SelectionDAG as well.
Reviewers: arsenm, hfinkel, tstellarAMD, jyknight, nhaehnle
llvm-svn: 296252
2017-02-25 19:43:58 +08:00
|
|
|
; ALL: ld $[[R1:[0-9]+]], 0($[[R0]])
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL: sd $[[R1]], 0($[[R3]])
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define void @store_LD_LD() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
store fp128 %0, fp128* @gld0, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: store_LD_float:
|
2016-04-05 20:50:29 +08:00
|
|
|
; ALL: ld $[[R0:[0-9]+]], %got_disp(gld1)
|
|
|
|
; ALL: ld $4, 0($[[R0]])
|
|
|
|
; ALL: ld $5, 8($[[R0]])
|
|
|
|
; ALL: ld $25, %call16(__trunctfsf2)
|
|
|
|
; PRER6: jalr $25
|
2016-04-14 21:43:17 +08:00
|
|
|
; R6: jalrc $25
|
2016-04-05 20:50:29 +08:00
|
|
|
; ALL: ld $[[R1:[0-9]+]], %got_disp(gf1)
|
|
|
|
; ALL: sw $2, 0($[[R1]])
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define void @store_LD_float() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%conv = fptrunc fp128 %0 to float
|
|
|
|
store float %conv, float* @gf1, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: store_LD_double:
|
2016-04-05 20:50:29 +08:00
|
|
|
; ALL: ld $[[R0:[0-9]+]], %got_disp(gld1)
|
|
|
|
; ALL: ld $4, 0($[[R0]])
|
|
|
|
; ALL: ld $5, 8($[[R0]])
|
|
|
|
; ALL: ld $25, %call16(__trunctfdf2)
|
|
|
|
; PRER6: jalr $25
|
2016-04-14 21:43:17 +08:00
|
|
|
; R6: jalrc $25
|
2016-04-05 20:50:29 +08:00
|
|
|
; ALL: ld $[[R1:[0-9]+]], %got_disp(gd1)
|
|
|
|
; ALL: sd $2, 0($[[R1]])
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define void @store_LD_double() {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load fp128, fp128* @gld1, align 16
|
2013-03-02 05:11:44 +08:00
|
|
|
%conv = fptrunc fp128 %0 to double
|
|
|
|
store double %conv, double* @gd1, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: select_LD:
|
|
|
|
; C_CC_FMT: movn $8, $6, $4
|
|
|
|
; C_CC_FMT: movn $9, $7, $4
|
|
|
|
; C_CC_FMT: move $2, $8
|
|
|
|
; C_CC_FMT: move $4, $9
|
|
|
|
|
|
|
|
; FIXME: This sll works around an implementation detail in the code generator
|
|
|
|
; (setcc's result is i32 so bits 32-63 are undefined). It's not really
|
|
|
|
; needed.
|
|
|
|
; CMP_CC_FMT-DAG: sll $[[CC:[0-9]+]], $4, 0
|
2014-07-09 18:47:26 +08:00
|
|
|
; CMP_CC_FMT-DAG: seleqz $[[EQ1:[0-9]+]], $8, $[[CC]]
|
|
|
|
; CMP_CC_FMT-DAG: selnez $[[NE1:[0-9]+]], $6, $[[CC]]
|
|
|
|
; CMP_CC_FMT-DAG: or $2, $[[NE1]], $[[EQ1]]
|
|
|
|
; CMP_CC_FMT-DAG: seleqz $[[EQ2:[0-9]+]], $9, $[[CC]]
|
|
|
|
; CMP_CC_FMT-DAG: selnez $[[NE2:[0-9]+]], $7, $[[CC]]
|
|
|
|
; CMP_CC_FMT-DAG: or $4, $[[NE2]], $[[EQ2]]
|
2013-03-02 05:11:44 +08:00
|
|
|
|
2014-11-08 00:54:21 +08:00
|
|
|
define fp128 @select_LD(i32 signext %a, i64, fp128 %b, fp128 %c) {
|
2013-03-02 05:11:44 +08:00
|
|
|
entry:
|
|
|
|
%tobool = icmp ne i32 %a, 0
|
|
|
|
%cond = select i1 %tobool, fp128 %b, fp128 %c
|
|
|
|
ret fp128 %cond
|
|
|
|
}
|
|
|
|
|
2014-06-12 21:39:06 +08:00
|
|
|
; ALL-LABEL: selectCC_LD:
|
|
|
|
; ALL: move $[[R0:[0-9]+]], $11
|
|
|
|
; ALL: move $[[R1:[0-9]+]], $10
|
|
|
|
; ALL: move $[[R2:[0-9]+]], $9
|
|
|
|
; ALL: move $[[R3:[0-9]+]], $8
|
|
|
|
; ALL: ld $25, %call16(__gttf2)($gp)
|
2016-04-05 20:50:29 +08:00
|
|
|
; PRER6: jalr $25
|
2016-04-14 21:43:17 +08:00
|
|
|
; R6: jalrc $25
|
2014-06-12 21:39:06 +08:00
|
|
|
|
|
|
|
; C_CC_FMT: slti $[[CC:[0-9]+]], $2, 1
|
|
|
|
; C_CC_FMT: movz $[[R1]], $[[R3]], $[[CC]]
|
|
|
|
; C_CC_FMT: movz $[[R0]], $[[R2]], $[[CC]]
|
|
|
|
; C_CC_FMT: move $2, $[[R1]]
|
|
|
|
; C_CC_FMT: move $4, $[[R0]]
|
|
|
|
|
|
|
|
; CMP_CC_FMT: slt $[[CC:[0-9]+]], $zero, $2
|
|
|
|
; CMP_CC_FMT: seleqz $[[EQ1:[0-9]+]], $[[R1]], $[[CC]]
|
|
|
|
; CMP_CC_FMT: selnez $[[NE1:[0-9]+]], $[[R3]], $[[CC]]
|
|
|
|
; CMP_CC_FMT: or $2, $[[NE1]], $[[EQ1]]
|
|
|
|
; CMP_CC_FMT: seleqz $[[EQ2:[0-9]+]], $[[R0]], $[[CC]]
|
|
|
|
; CMP_CC_FMT: selnez $[[NE2:[0-9]+]], $[[R2]], $[[CC]]
|
|
|
|
; CMP_CC_FMT: or $4, $[[NE2]], $[[EQ2]]
|
2013-03-02 05:11:44 +08:00
|
|
|
|
|
|
|
define fp128 @selectCC_LD(fp128 %a, fp128 %b, fp128 %c, fp128 %d) {
|
|
|
|
entry:
|
|
|
|
%cmp = fcmp ogt fp128 %a, %b
|
|
|
|
%cond = select i1 %cmp, fp128 %c, fp128 %d
|
|
|
|
ret fp128 %cond
|
|
|
|
}
|