| Craig Topper | 84d8fa3 | 2019-12-17 14:32:21 -0800 | [diff] [blame] | 1 | ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | ; RUN: llc < %s -mtriple=aarch64-apple-darwin | FileCheck %s |
| 3 | |
| 4 | ; Check that the legalizer doesn't crash when scalarizing FP conversion |
| 5 | ; instructions' operands. The operands are all illegal on AArch64, |
| 6 | ; ensuring they are legalized. The results are all legal. |
| 7 | |
| 8 | define <1 x double> @test_sitofp(<1 x i1> %in) #0 { |
| 9 | ; CHECK-LABEL: test_sitofp: |
| 10 | ; CHECK: ; %bb.0: ; %entry |
| Craig Topper | 84d8fa3 | 2019-12-17 14:32:21 -0800 | [diff] [blame] | 11 | ; CHECK-NEXT: sbfx w8, w0, #0, #1 |
| John Brawn | 0bb9a27 | 2020-01-27 15:51:06 +0000 | [diff] [blame] | 12 | ; CHECK-NEXT: scvtf d0, w8 |
| Craig Topper | 84d8fa3 | 2019-12-17 14:32:21 -0800 | [diff] [blame] | 13 | ; CHECK-NEXT: ret |
| 14 | entry: |
| 15 | %0 = call <1 x double> @llvm.experimental.constrained.sitofp.v1f64.v1i1(<1 x i1> %in, metadata !"round.dynamic", metadata !"fpexcept.strict") #0 |
| 16 | ret <1 x double> %0 |
| 17 | } |
| 18 | |
| 19 | define <1 x double> @test_uitofp(<1 x i1> %in) #0 { |
| 20 | ; CHECK-LABEL: test_uitofp: |
| 21 | ; CHECK: ; %bb.0: ; %entry |
| Craig Topper | 84d8fa3 | 2019-12-17 14:32:21 -0800 | [diff] [blame] | 22 | ; CHECK-NEXT: and w8, w0, #0x1 |
| John Brawn | 0bb9a27 | 2020-01-27 15:51:06 +0000 | [diff] [blame] | 23 | ; CHECK-NEXT: ucvtf d0, w8 |
| Craig Topper | 84d8fa3 | 2019-12-17 14:32:21 -0800 | [diff] [blame] | 24 | ; CHECK-NEXT: ret |
| 25 | entry: |
| 26 | %0 = call <1 x double> @llvm.experimental.constrained.uitofp.v1f64.v1i1(<1 x i1> %in, metadata !"round.dynamic", metadata !"fpexcept.strict") #0 |
| 27 | ret <1 x double> %0 |
| 28 | } |
| 29 | |
| 30 | attributes #0 = { strictfp } |
| 31 | |
| 32 | declare <1 x double> @llvm.experimental.constrained.sitofp.v1f64.v1i1(<1 x i1>, metadata, metadata) |
| 33 | declare <1 x double> @llvm.experimental.constrained.uitofp.v1f64.v1i1(<1 x i1>, metadata, metadata) |