2016-07-16 10:24:59 +08:00
|
|
|
# RUN: llc -march=x86-64 -run-pass none -o - %s | FileCheck %s
|
2015-07-21 04:51:18 +08:00
|
|
|
# This test ensures that the MIR parser parses constant pool constants and
|
|
|
|
# constant pool operands correctly.
|
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
|
define double @test(double %a, float %b) {
|
|
|
|
entry:
|
|
|
|
%c = fadd double %a, 3.250000e+00
|
|
|
|
%d = fadd float %b, 6.250000e+00
|
|
|
|
%e = fpext float %d to double
|
|
|
|
%f = fmul double %c, %e
|
|
|
|
ret double %f
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test2(double %a, float %b) {
|
|
|
|
entry:
|
|
|
|
%c = fadd double %a, 3.250000e+00
|
|
|
|
%d = fadd float %b, 6.250000e+00
|
|
|
|
%e = fpext float %d to double
|
|
|
|
%f = fmul double %c, %e
|
|
|
|
ret double %f
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test3(double %a, float %b) {
|
|
|
|
entry:
|
|
|
|
%c = fadd double %a, 3.250000e+00
|
|
|
|
%d = fadd float %b, 6.250000e+00
|
|
|
|
%e = fpext float %d to double
|
|
|
|
%f = fmul double %c, %e
|
|
|
|
ret double %f
|
|
|
|
}
|
2015-08-06 06:26:15 +08:00
|
|
|
|
|
|
|
define double @test4(double %a, float %b) {
|
|
|
|
entry:
|
|
|
|
%c = fadd double %a, 3.250000e+00
|
|
|
|
%d = fadd float %b, 6.250000e+00
|
|
|
|
%e = fpext float %d to double
|
|
|
|
%f = fmul double %c, %e
|
|
|
|
ret double %f
|
|
|
|
}
|
2015-07-21 04:51:18 +08:00
|
|
|
...
|
|
|
|
---
|
|
|
|
# CHECK: name: test
|
|
|
|
# CHECK: constants:
|
|
|
|
# CHECK-NEXT: - id: 0
|
|
|
|
# CHECK-NEXT: value: 'double 3.250000e+00'
|
|
|
|
# CHECK-NEXT: alignment: 8
|
2017-08-02 19:09:30 +08:00
|
|
|
# CHECK-NEXT: isTargetSpecific: false
|
2015-07-21 04:51:18 +08:00
|
|
|
# CHECK-NEXT: - id: 1
|
|
|
|
# CHECK-NEXT: value: 'float 6.250000e+00'
|
|
|
|
# CHECK-NEXT: alignment: 4
|
2017-08-02 19:09:30 +08:00
|
|
|
# CHECK-NEXT: isTargetSpecific: false
|
2015-07-21 04:51:18 +08:00
|
|
|
name: test
|
|
|
|
constants:
|
|
|
|
- id: 0
|
|
|
|
value: 'double 3.250000e+00'
|
|
|
|
alignment: 8
|
|
|
|
- id: 1
|
|
|
|
value: 'float 6.250000e+00'
|
|
|
|
alignment: 4
|
2015-08-14 07:10:16 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $xmm0 = ADDSDrm killed $xmm0, $rip, 1, $noreg, %const.0, $noreg
|
|
|
|
; CHECK-NEXT: $xmm1 = ADDSSrm killed $xmm1, $rip, 1, $noreg, %const.1, $noreg
|
|
|
|
$xmm0 = ADDSDrm killed $xmm0, $rip, 1, _, %const.0, _
|
|
|
|
$xmm1 = ADDSSrm killed $xmm1, $rip, 1, _, %const.1, _
|
|
|
|
$xmm1 = CVTSS2SDrr killed $xmm1
|
|
|
|
$xmm0 = MULSDrr killed $xmm0, killed $xmm1
|
|
|
|
RETQ $xmm0
|
2015-07-21 04:51:18 +08:00
|
|
|
...
|
|
|
|
---
|
|
|
|
# Verify that alignment can be inferred:
|
|
|
|
# CHECK: name: test2
|
|
|
|
# CHECK: constants:
|
|
|
|
# CHECK-NEXT: - id: 0
|
|
|
|
# CHECK-NEXT: value: 'double 3.250000e+00'
|
|
|
|
# CHECK-NEXT: alignment: 8
|
2017-08-02 19:09:30 +08:00
|
|
|
# CHECK-NEXT: isTargetSpecific: false
|
2015-07-21 04:51:18 +08:00
|
|
|
# CHECK-NEXT: - id: 1
|
|
|
|
# CHECK-NEXT: value: 'float 6.250000e+00'
|
|
|
|
# CHECK-NEXT: alignment: 4
|
2017-08-02 19:09:30 +08:00
|
|
|
# CHECK-NEXT: isTargetSpecific: false
|
2015-07-21 04:51:18 +08:00
|
|
|
name: test2
|
|
|
|
constants:
|
|
|
|
- id: 0
|
|
|
|
value: 'double 3.250000e+00'
|
|
|
|
- id: 1
|
|
|
|
value: 'float 6.250000e+00'
|
2015-08-14 07:10:16 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
2018-02-01 06:04:26 +08:00
|
|
|
$xmm0 = ADDSDrm killed $xmm0, $rip, 1, _, %const.0, _
|
|
|
|
$xmm1 = ADDSSrm killed $xmm1, $rip, 1, _, %const.1, _
|
|
|
|
$xmm1 = CVTSS2SDrr killed $xmm1
|
|
|
|
$xmm0 = MULSDrr killed $xmm0, killed $xmm1
|
|
|
|
RETQ $xmm0
|
2015-07-21 04:51:18 +08:00
|
|
|
...
|
|
|
|
---
|
|
|
|
# Verify that the non-standard alignments are respected:
|
|
|
|
# CHECK: name: test3
|
|
|
|
# CHECK: constants:
|
|
|
|
# CHECK-NEXT: - id: 0
|
|
|
|
# CHECK-NEXT: value: 'double 3.250000e+00'
|
|
|
|
# CHECK-NEXT: alignment: 128
|
2017-08-02 19:09:30 +08:00
|
|
|
# CHECK-NEXT: isTargetSpecific: false
|
2015-07-21 04:51:18 +08:00
|
|
|
# CHECK-NEXT: - id: 1
|
|
|
|
# CHECK-NEXT: value: 'float 6.250000e+00'
|
|
|
|
# CHECK-NEXT: alignment: 1
|
2017-08-02 19:09:30 +08:00
|
|
|
# CHECK-NEXT: isTargetSpecific: false
|
2015-07-21 04:51:18 +08:00
|
|
|
name: test3
|
|
|
|
constants:
|
|
|
|
- id: 0
|
|
|
|
value: 'double 3.250000e+00'
|
|
|
|
alignment: 128
|
|
|
|
- id: 1
|
|
|
|
value: 'float 6.250000e+00'
|
|
|
|
alignment: 1
|
2015-08-14 07:10:16 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $xmm0 = ADDSDrm killed $xmm0, $rip, 1, $noreg, %const.0, $noreg
|
|
|
|
; CHECK-NEXT: $xmm1 = ADDSSrm killed $xmm1, $rip, 1, $noreg, %const.1, $noreg
|
|
|
|
$xmm0 = ADDSDrm killed $xmm0, $rip, 1, _, %const.0, _
|
|
|
|
$xmm1 = ADDSSrm killed $xmm1, $rip, 1, _, %const.1, _
|
|
|
|
$xmm1 = CVTSS2SDrr killed $xmm1
|
|
|
|
$xmm0 = MULSDrr killed $xmm0, killed $xmm1
|
|
|
|
RETQ $xmm0
|
2015-07-21 04:51:18 +08:00
|
|
|
...
|
2015-08-06 06:26:15 +08:00
|
|
|
---
|
|
|
|
# CHECK: name: test4
|
|
|
|
name: test4
|
|
|
|
constants:
|
|
|
|
- id: 0
|
|
|
|
value: 'double 3.250000e+00'
|
|
|
|
- id: 1
|
|
|
|
value: 'float 6.250000e+00'
|
2015-08-14 07:10:16 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $xmm0 = ADDSDrm killed $xmm0, $rip, 1, $noreg, %const.1 - 12, $noreg
|
|
|
|
; CHECK-NEXT: $xmm1 = ADDSSrm killed $xmm1, $rip, 1, $noreg, %const.0 + 8, $noreg
|
|
|
|
$xmm0 = ADDSDrm killed $xmm0, $rip, 1, _, %const.1 - 12, _
|
|
|
|
$xmm1 = ADDSSrm killed $xmm1, $rip, 1, _, %const.0 + 8, _
|
|
|
|
$xmm1 = CVTSS2SDrr killed $xmm1
|
|
|
|
$xmm0 = MULSDrr killed $xmm0, killed $xmm1
|
|
|
|
RETQ $xmm0
|
2015-08-06 06:26:15 +08:00
|
|
|
...
|