| OLD | NEW |
| 1 ; This tries to be a comprehensive test of f32 and f64 call/return ops. | 1 ; This tries to be a comprehensive test of f32 and f64 call/return ops. |
| 2 ; The CHECK lines are only checking for basic instruction patterns | 2 ; The CHECK lines are only checking for basic instruction patterns |
| 3 ; that should be present regardless of the optimization level, so | 3 ; that should be present regardless of the optimization level, so |
| 4 ; there are no special OPTM1 match lines. | 4 ; there are no special OPTM1 match lines. |
| 5 | 5 |
| 6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
| 7 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \ | 7 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \ |
| 8 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 8 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
| 9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
| 10 ; RUN: --target x8632 -i %s --args -Om1 -allow-externally-defined-symbols \ | 10 ; RUN: --target x8632 -i %s --args -Om1 -allow-externally-defined-symbols \ |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 ret i32 %add3 | 52 ret i32 %add3 |
| 53 } | 53 } |
| 54 ; CHECK-LABEL: passFpArgs | 54 ; CHECK-LABEL: passFpArgs |
| 55 ; CHECK: mov DWORD PTR [esp+0x4],0x7b | 55 ; CHECK: mov DWORD PTR [esp+0x4],0x7b |
| 56 ; CHECK: call {{.*}} R_{{.*}} ignoreFpArgsNoInline | 56 ; CHECK: call {{.*}} R_{{.*}} ignoreFpArgsNoInline |
| 57 ; CHECK: mov DWORD PTR [esp+0x4],0x7b | 57 ; CHECK: mov DWORD PTR [esp+0x4],0x7b |
| 58 ; CHECK: call {{.*}} R_{{.*}} ignoreFpArgsNoInline | 58 ; CHECK: call {{.*}} R_{{.*}} ignoreFpArgsNoInline |
| 59 ; CHECK: mov DWORD PTR [esp+0x4],0x7b | 59 ; CHECK: mov DWORD PTR [esp+0x4],0x7b |
| 60 ; CHECK: call {{.*}} R_{{.*}} ignoreFpArgsNoInline | 60 ; CHECK: call {{.*}} R_{{.*}} ignoreFpArgsNoInline |
| 61 ; MIPS32-LABEL: passFpArgs | 61 ; MIPS32-LABEL: passFpArgs |
| 62 ; MIPS32: » mfc1» a2,$f15 | 62 ; MIPS32: » mfc1» a2,$f{{[0-9]+}} |
| 63 ; MIPS32: » mfc1» a3,$f14 | 63 ; MIPS32: » mfc1» a3,$f{{[0-9]+}} |
| 64 ; MIPS32: li a1,123 | 64 ; MIPS32: li a1,123 |
| 65 ; MIPS32: jal {{.*}} ignoreFpArgsNoInline | 65 ; MIPS32: jal {{.*}} ignoreFpArgsNoInline |
| 66 ; MIPS32: » mfc1» a2,$f23 | 66 ; MIPS32: » mfc1» a2,$f{{[0-9]+}} |
| 67 ; MIPS32: » mfc1» a3,$f22 | 67 ; MIPS32: » mfc1» a3,$f{{[0-9]+}} |
| 68 ; MIPS32: li a1,123 | 68 ; MIPS32: li a1,123 |
| 69 ; MIPS32: jal {{.*}} ignoreFpArgsNoInline | 69 ; MIPS32: jal {{.*}} ignoreFpArgsNoInline |
| 70 ; MIPS32: » mfc1» a2,$f25 | 70 ; MIPS32: » mfc1» a2,$f{{[0-9]+}} |
| 71 ; MIPS32: » mfc1» a3,$f24 | 71 ; MIPS32: » mfc1» a3,$f{{[0-9]+}} |
| 72 ; MIPS32: li a1,123 | 72 ; MIPS32: li a1,123 |
| 73 ; MIPS32: jal {{.*}} ignoreFpArgsNoInline | 73 ; MIPS32: jal {{.*}} ignoreFpArgsNoInline |
| 74 | 74 |
| 75 declare i32 @ignoreFpArgsNoInline(float %x, i32 %y, double %z) | 75 declare i32 @ignoreFpArgsNoInline(float %x, i32 %y, double %z) |
| 76 | 76 |
| 77 define internal i32 @passFpConstArg(float %a, double %b) { | 77 define internal i32 @passFpConstArg(float %a, double %b) { |
| 78 entry: | 78 entry: |
| 79 %call = call i32 @ignoreFpArgsNoInline(float %a, i32 123, double 2.340000e+00) | 79 %call = call i32 @ignoreFpArgsNoInline(float %a, i32 123, double 2.340000e+00) |
| 80 ret i32 %call | 80 ret i32 %call |
| 81 } | 81 } |
| 82 ; CHECK-LABEL: passFpConstArg | 82 ; CHECK-LABEL: passFpConstArg |
| 83 ; CHECK: mov DWORD PTR [esp+0x4],0x7b | 83 ; CHECK: mov DWORD PTR [esp+0x4],0x7b |
| 84 ; CHECK: call {{.*}} R_{{.*}} ignoreFpArgsNoInline | 84 ; CHECK: call {{.*}} R_{{.*}} ignoreFpArgsNoInline |
| 85 ; MIPS32-LABEL: passFpConstArg | 85 ; MIPS32-LABEL: passFpConstArg |
| 86 ; MIPS32: » mfc1» a2,$f1 | 86 ; MIPS32: » mfc1» a2,$f{{[0-9]+}} |
| 87 ; MIPS32: » mfc1» a3,$f0 | 87 ; MIPS32: » mfc1» a3,$f{{[0-9]+}} |
| 88 ; MIPS32: li a1,123 | 88 ; MIPS32: li a1,123 |
| 89 ; MIPS32: jal {{.*}} ignoreFpArgsNoInline | 89 ; MIPS32: jal {{.*}} ignoreFpArgsNoInline |
| 90 | 90 |
| 91 define internal i32 @passFp32ConstArg(float %a) { | 91 define internal i32 @passFp32ConstArg(float %a) { |
| 92 entry: | 92 entry: |
| 93 %call = call i32 @ignoreFp32ArgsNoInline(float %a, i32 123, float 2.0) | 93 %call = call i32 @ignoreFp32ArgsNoInline(float %a, i32 123, float 2.0) |
| 94 ret i32 %call | 94 ret i32 %call |
| 95 } | 95 } |
| 96 ; CHECK-LABEL: passFp32ConstArg | 96 ; CHECK-LABEL: passFp32ConstArg |
| 97 ; CHECK: mov DWORD PTR [esp+0x4],0x7b | 97 ; CHECK: mov DWORD PTR [esp+0x4],0x7b |
| (...skipping 26 matching lines...) Expand all Loading... |
| 124 ; MIPS32: mov.d $f0,$f12 | 124 ; MIPS32: mov.d $f0,$f12 |
| 125 ; MIPS32: jr ra | 125 ; MIPS32: jr ra |
| 126 | 126 |
| 127 define internal float @returnFloatConst() { | 127 define internal float @returnFloatConst() { |
| 128 entry: | 128 entry: |
| 129 ret float 0x3FF3AE1480000000 | 129 ret float 0x3FF3AE1480000000 |
| 130 } | 130 } |
| 131 ; CHECK-LABEL: returnFloatConst | 131 ; CHECK-LABEL: returnFloatConst |
| 132 ; CHECK: fld | 132 ; CHECK: fld |
| 133 ; MIPS32-LABEL: returnFloatConst | 133 ; MIPS32-LABEL: returnFloatConst |
| 134 ; MIPS32: » lui» v0,0x0» 160: R_MIPS_HI16» .L$float$3f9d70a4 | 134 ; MIPS32: » lui» v0,0x0 {{.*}} .L$float$3f9d70a4 |
| 135 ; MIPS32: » lwc1» $f0,0(v0) 164: R_MIPS_LO16» .L$float$3f9d70a4 | 135 ; MIPS32: » lwc1» $f0,0(v0) {{.*}} .L$float$3f9d70a4 |
| 136 ; MIPS32: jr ra | 136 ; MIPS32: jr ra |
| 137 | 137 |
| 138 define internal double @returnDoubleConst() { | 138 define internal double @returnDoubleConst() { |
| 139 entry: | 139 entry: |
| 140 ret double 1.230000e+00 | 140 ret double 1.230000e+00 |
| 141 } | 141 } |
| 142 ; CHECK-LABEL: returnDoubleConst | 142 ; CHECK-LABEL: returnDoubleConst |
| 143 ; CHECK: fld | 143 ; CHECK: fld |
| 144 ; MIPS32-LABEL: returnDoubleConst | 144 ; MIPS32-LABEL: returnDoubleConst |
| 145 ; MIPS32: » lui» v0,0x0» 170: R_MIPS_HI16 .L$double$3ff3ae147ae147ae | 145 ; MIPS32: » lui» v0,0x0» {{.*}} .L$double$3ff3ae147ae147ae |
| 146 ; MIPS32: » ldc1» $f0,0(v0) 174: R_MIPS_LO16 .L$double$3ff3ae147ae147ae | 146 ; MIPS32: » ldc1» $f0,0(v0) {{.*}} .L$double$3ff3ae147ae147ae |
| 147 ; MIPS32: jr ra | 147 ; MIPS32: jr ra |
| OLD | NEW |