1 ; RUN: opt -mtriple=aarch64-linux-gnu -mattr=+sve -passes="print<cost-model>" 2>&1 -disable-output < %s | FileCheck %s
3 ; Integer to float bitcasts
5 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
7 define <vscale x 2 x double> @test_nxv2f64(<vscale x 2 x i64> %a) {
8 ; CHECK-LABEL: test_nxv2f64
9 ; CHECK: Found an estimated cost of 0 for instruction: %b = bitcast <vscale x 2 x i64> %a to <vscale x 2 x double>
10 %b = bitcast <vscale x 2 x i64> %a to <vscale x 2 x double>
11 ret <vscale x 2 x double> %b
14 define <vscale x 2 x half> @test_nxv2f16(<vscale x 2 x i16> %a) {
15 ; CHECK-LABEL: test_nxv2f16
16 ; CHECK: Found an estimated cost of 0 for instruction: %b = bitcast <vscale x 2 x i16> %a to <vscale x 2 x half>
17 %b = bitcast <vscale x 2 x i16> %a to <vscale x 2 x half>
18 ret <vscale x 2 x half> %b
21 define <vscale x 4 x half> @test_nxv4f16(<vscale x 4 x i16> %a) {
22 ; CHECK-LABEL: test_nxv4f16
23 ; CHECK: Found an estimated cost of 0 for instruction: %b = bitcast <vscale x 4 x i16> %a to <vscale x 4 x half>
24 %b = bitcast <vscale x 4 x i16> %a to <vscale x 4 x half>
25 ret <vscale x 4 x half> %b
28 define <vscale x 2 x float> @test_nxv2f32(<vscale x 2 x i32> %a) {
29 ; CHECK-LABEL: test_nxv2f32
30 ; CHECK: Found an estimated cost of 0 for instruction: %b = bitcast <vscale x 2 x i32> %a to <vscale x 2 x float>
31 %b = bitcast <vscale x 2 x i32> %a to <vscale x 2 x float>
32 ret <vscale x 2 x float> %b
35 ; Float to integer bitcasts
37 define <vscale x 2 x i64> @test_nxv2i64(<vscale x 2 x double> %a) {
38 ; CHECK-LABEL: test_nxv2i64
39 ; CHECK: Found an estimated cost of 0 for instruction: %b = bitcast <vscale x 2 x double> %a to <vscale x 2 x i64>
40 %b = bitcast <vscale x 2 x double> %a to <vscale x 2 x i64>
41 ret <vscale x 2 x i64> %b
44 define <vscale x 2 x i16> @test_nxv2i16(<vscale x 2 x half> %a) {
45 ; CHECK-LABEL: test_nxv2i16
46 ; CHECK: Found an estimated cost of 0 for instruction: %b = bitcast <vscale x 2 x half> %a to <vscale x 2 x i16>
47 %b = bitcast <vscale x 2 x half> %a to <vscale x 2 x i16>
48 ret <vscale x 2 x i16> %b
51 define <vscale x 4 x i16> @test_nxv4i16(<vscale x 4 x half> %a) {
52 ; CHECK-LABEL: test_nxv4i16
53 ; CHECK: Found an estimated cost of 0 for instruction: %b = bitcast <vscale x 4 x half> %a to <vscale x 4 x i16>
54 %b = bitcast <vscale x 4 x half> %a to <vscale x 4 x i16>
55 ret <vscale x 4 x i16> %b
58 define <vscale x 2 x i32> @test_nxv2i32(<vscale x 2 x float> %a) {
59 ; CHECK-LABEL: test_nxv2i32
60 ; CHECK: Found an estimated cost of 0 for instruction: %b = bitcast <vscale x 2 x float> %a to <vscale x 2 x i32>
61 %b = bitcast <vscale x 2 x float> %a to <vscale x 2 x i32>
62 ret <vscale x 2 x i32> %b