reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=AVX

declare { <4 x i32>, <4 x i1> } @llvm.umul.with.overflow.v4i32(<4 x i32>, <4 x i32>)
declare { <4 x i32>, <4 x i1> } @llvm.smul.with.overflow.v4i32(<4 x i32>, <4 x i32>)

define <4 x i32> @umul_v4i32_0(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: umul_v4i32_0:
; AVX:       # %bb.0:
; AVX-NEXT:    vxorps %xmm0, %xmm0, %xmm0
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.umul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> zeroinitializer)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}

define <4 x i32> @umul_v4i32_1(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: umul_v4i32_1:
; AVX:       # %bb.0:
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.umul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> <i32 1, i32 1, i32 1, i32 1>)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}

define <4 x i32> @umul_v4i32_2(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: umul_v4i32_2:
; AVX:       # %bb.0:
; AVX-NEXT:    vpaddd %xmm0, %xmm0, %xmm2
; AVX-NEXT:    vpmaxud %xmm0, %xmm2, %xmm0
; AVX-NEXT:    vpcmpeqd %xmm0, %xmm2, %xmm0
; AVX-NEXT:    vblendvps %xmm0, %xmm2, %xmm1, %xmm0
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.umul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> <i32 2, i32 2, i32 2, i32 2>)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}

define <4 x i32> @umul_v4i32_8(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: umul_v4i32_8:
; AVX:       # %bb.0:
; AVX-NEXT:    vpslld $3, %xmm0, %xmm2
; AVX-NEXT:    vpsrld $3, %xmm2, %xmm3
; AVX-NEXT:    vpcmpeqd %xmm0, %xmm3, %xmm0
; AVX-NEXT:    vblendvps %xmm0, %xmm2, %xmm1, %xmm0
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.umul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> <i32 8, i32 8, i32 8, i32 8>)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}

define <4 x i32> @umul_v4i32_2pow31(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: umul_v4i32_2pow31:
; AVX:       # %bb.0:
; AVX-NEXT:    vpslld $31, %xmm0, %xmm2
; AVX-NEXT:    vpsrld $31, %xmm2, %xmm3
; AVX-NEXT:    vpcmpeqd %xmm0, %xmm3, %xmm0
; AVX-NEXT:    vblendvps %xmm0, %xmm2, %xmm1, %xmm0
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.umul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> <i32 2147483648, i32 2147483648, i32 2147483648, i32 2147483648>)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}

define <4 x i32> @smul_v4i32_0(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: smul_v4i32_0:
; AVX:       # %bb.0:
; AVX-NEXT:    vxorps %xmm0, %xmm0, %xmm0
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.smul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> zeroinitializer)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}

define <4 x i32> @smul_v4i32_1(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: smul_v4i32_1:
; AVX:       # %bb.0:
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.smul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> <i32 1, i32 1, i32 1, i32 1>)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}

define <4 x i32> @smul_v4i32_2(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: smul_v4i32_2:
; AVX:       # %bb.0:
; AVX-NEXT:    vpaddd %xmm0, %xmm0, %xmm2
; AVX-NEXT:    vpcmpgtd %xmm2, %xmm0, %xmm3
; AVX-NEXT:    vpxor %xmm3, %xmm0, %xmm0
; AVX-NEXT:    vblendvps %xmm0, %xmm1, %xmm2, %xmm0
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.smul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> <i32 2, i32 2, i32 2, i32 2>)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}

define <4 x i32> @smul_v4i32_8(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: smul_v4i32_8:
; AVX:       # %bb.0:
; AVX-NEXT:    vpslld $3, %xmm0, %xmm2
; AVX-NEXT:    vpsrad $3, %xmm2, %xmm3
; AVX-NEXT:    vpcmpeqd %xmm0, %xmm3, %xmm0
; AVX-NEXT:    vblendvps %xmm0, %xmm2, %xmm1, %xmm0
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.smul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> <i32 8, i32 8, i32 8, i32 8>)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}

define <4 x i32> @smul_v4i32_2pow31(<4 x i32> %a, <4 x i32> %b) nounwind {
; AVX-LABEL: smul_v4i32_2pow31:
; AVX:       # %bb.0:
; AVX-NEXT:    vpslld $31, %xmm0, %xmm2
; AVX-NEXT:    vpsrld $31, %xmm2, %xmm3
; AVX-NEXT:    vpcmpeqd %xmm0, %xmm3, %xmm0
; AVX-NEXT:    vblendvps %xmm0, %xmm2, %xmm1, %xmm0
; AVX-NEXT:    retq
    %x = call { <4 x i32>, <4 x i1> } @llvm.smul.with.overflow.v4i32(<4 x i32> %a, <4 x i32> <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>)
    %y = extractvalue { <4 x i32>, <4 x i1> } %x, 0
    %z = extractvalue { <4 x i32>, <4 x i1> } %x, 1
    %u = select <4 x i1> %z, <4 x i32> %b, <4 x i32> %y
    ret <4 x i32> %u
}