| Daniel Sanders | 8008de5 | 2015-10-15 14:34:23 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=1 |
| 2 | ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=2 |
| 3 | ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=3 |
| 4 | ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=4 |
| Reed Kotler | 783c794 | 2013-05-10 22:25:39 +0000 | [diff] [blame] | 5 | |
| 6 | |
| 7 | @x = global float 0x41F487E980000000, align 4 |
| 8 | @dx = global double 0x41CDCC8BC4800000, align 8 |
| 9 | @cx = global { float, float } { float 1.000000e+00, float 9.900000e+01 }, align 4 |
| 10 | @dcx = global { double, double } { double 0x42CE5E14A412B480, double 0x423AA4C580DB0000 }, align 8 |
| 11 | |
| 12 | define float @foox() { |
| 13 | entry: |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 14 | %0 = load float, float* @x, align 4 |
| Reed Kotler | 783c794 | 2013-05-10 22:25:39 +0000 | [diff] [blame] | 15 | ret float %0 |
| 16 | ; 1: .ent foox |
| 17 | ; 1: lw $2, %lo(x)(${{[0-9]+}}) |
| 18 | ; 1: jal __mips16_ret_sf |
| 19 | } |
| 20 | |
| 21 | define double @foodx() { |
| 22 | entry: |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 23 | %0 = load double, double* @dx, align 8 |
| Reed Kotler | 783c794 | 2013-05-10 22:25:39 +0000 | [diff] [blame] | 24 | ret double %0 |
| 25 | ; 1: .ent foodx |
| 26 | ; 1: lw $2, %lo(dx)(${{[0-9]+}}) |
| 27 | ; 1: jal __mips16_ret_df |
| 28 | ; 2: .ent foodx |
| 29 | ; 2: lw $3, 4(${{[0-9]+}}) |
| 30 | ; 2: jal __mips16_ret_df |
| 31 | |
| 32 | } |
| 33 | |
| 34 | define { float, float } @foocx() { |
| 35 | entry: |
| 36 | %retval = alloca { float, float }, align 4 |
| David Blaikie | f72d05b | 2015-03-13 18:20:45 +0000 | [diff] [blame] | 37 | %cx.real = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @cx, i32 0, i32 0) |
| 38 | %cx.imag = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @cx, i32 0, i32 1) |
| David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 39 | %real = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 0 |
| 40 | %imag = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 1 |
| Reed Kotler | 783c794 | 2013-05-10 22:25:39 +0000 | [diff] [blame] | 41 | store float %cx.real, float* %real |
| 42 | store float %cx.imag, float* %imag |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 43 | %0 = load { float, float }, { float, float }* %retval |
| Reed Kotler | 783c794 | 2013-05-10 22:25:39 +0000 | [diff] [blame] | 44 | ret { float, float } %0 |
| 45 | ; 1: .ent foocx |
| 46 | ; 1: lw $2, %lo(cx)(${{[0-9]+}}) |
| 47 | ; 1: jal __mips16_ret_sc |
| 48 | ; 2: .ent foocx |
| 49 | ; 2: lw $3, 4(${{[0-9]+}}) |
| 50 | ; 2: jal __mips16_ret_sc |
| 51 | } |
| 52 | |
| 53 | define { double, double } @foodcx() { |
| 54 | entry: |
| 55 | %retval = alloca { double, double }, align 8 |
| David Blaikie | f72d05b | 2015-03-13 18:20:45 +0000 | [diff] [blame] | 56 | %dcx.real = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @dcx, i32 0, i32 0) |
| 57 | %dcx.imag = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @dcx, i32 0, i32 1) |
| David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 58 | %real = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 0 |
| 59 | %imag = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 1 |
| Reed Kotler | 783c794 | 2013-05-10 22:25:39 +0000 | [diff] [blame] | 60 | store double %dcx.real, double* %real |
| 61 | store double %dcx.imag, double* %imag |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 62 | %0 = load { double, double }, { double, double }* %retval |
| Reed Kotler | 783c794 | 2013-05-10 22:25:39 +0000 | [diff] [blame] | 63 | ret { double, double } %0 |
| 64 | ; 1: .ent foodcx |
| Andrew Trick | 8485257 | 2013-07-25 18:35:14 +0000 | [diff] [blame] | 65 | ; 1: lw ${{[0-9]}}, %lo(dcx)(${{[0-9]+}}) |
| Reed Kotler | 783c794 | 2013-05-10 22:25:39 +0000 | [diff] [blame] | 66 | ; 1: jal __mips16_ret_dc |
| 67 | ; 2: .ent foodcx |
| Andrew Trick | 8485257 | 2013-07-25 18:35:14 +0000 | [diff] [blame] | 68 | ; 2: lw ${{[0-9]}}, 4(${{[0-9]+}}) |
| Reed Kotler | 783c794 | 2013-05-10 22:25:39 +0000 | [diff] [blame] | 69 | ; 2: jal __mips16_ret_dc |
| 70 | ; 3: .ent foodcx |
| 71 | ; 3: lw $4, 8(${{[0-9]+}}) |
| 72 | ; 3: jal __mips16_ret_dc |
| 73 | ; 4: .ent foodcx |
| 74 | ; 4: lw $5, 12(${{[0-9]+}}) |
| 75 | ; 4: jal __mips16_ret_dc |
| 76 | } |