1 ; Test that vectors are scalarized/lowered correctly 2 ; (with both legalization methods). 3 ; RUN: llc -march=x86 < %s 4 ; RUN: llc -march=x86 < %s 5 6 ; A simple test to check copyToParts and copyFromParts. 7 8 define <4 x i64> @test_param_0(<4 x i64> %A, <2 x i32> %B, <4 x i8> %C) { 9 ret <4 x i64> %A 10 } 11 12 define <2 x i32> @test_param_1(<4 x i64> %A, <2 x i32> %B, <4 x i8> %C) { 13 ret <2 x i32> %B 14 } 15 16 define <4 x i8> @test_param_2(<4 x i64> %A, <2 x i32> %B, <4 x i8> %C) { 17 ret <4 x i8> %C 18 } 19 20 ; Simple tests to check arithmetic and vector operations on types which need to 21 ; be legalized (no loads/stores to/from memory here). 22 23 define <4 x i64> @test_arith_0(<4 x i64> %A, <2 x i32> %B, <4 x i8> %C) { 24 %K = add <4 x i64> %A, <i64 0, i64 1, i64 3, i64 9> 25 ret <4 x i64> %K 26 } 27 28 define <2 x i32> @test_arith_1(<4 x i64> %A, <2 x i32> %B, <4 x i8> %C) { 29 %K = add <2 x i32> %B, <i32 0, i32 1> 30 ret <2 x i32> %K 31 } 32 33 define <4 x i8> @test_arith_2(<4 x i64> %A, <2 x i32> %B, <4 x i8> %C) { 34 %K = add <4 x i8> %C, <i8 0, i8 1, i8 3, i8 9> 35 ret <4 x i8> %K 36 } 37 38 define i8 @test_arith_3(<4 x i64> %A, <2 x i32> %B, <4 x i8> %C) { 39 %K = add <4 x i8> %C, <i8 0, i8 1, i8 3, i8 9> 40 %Y = extractelement <4 x i8> %K, i32 1 41 ret i8 %Y 42 } 43 44 define <4 x i8> @test_arith_4(<4 x i64> %A, <2 x i32> %B, <4 x i8> %C) { 45 %Y = insertelement <4 x i8> %C, i8 1, i32 0 46 ret <4 x i8> %Y 47 } 48 49 define <4 x i32> @test_arith_5(<4 x i64> %A, <2 x i32> %B, <4 x i32> %C) { 50 %Y = insertelement <4 x i32> %C, i32 1, i32 0 51 ret <4 x i32> %Y 52 } 53 54 define <4 x i32> @test_arith_6(<4 x i64> %A, <2 x i32> %B, <4 x i32> %C) { 55 %F = extractelement <2 x i32> %B, i32 1 56 %Y = insertelement <4 x i32> %C, i32 %F, i32 0 57 ret <4 x i32> %Y 58 } 59 60 define <4 x i64> @test_arith_7(<4 x i64> %A, <2 x i32> %B, <4 x i32> %C) { 61 %F = extractelement <2 x i32> %B, i32 1 62 %W = zext i32 %F to i64 63 %Y = insertelement <4 x i64> %A, i64 %W, i32 0 64 ret <4 x i64> %Y 65 } 66 67 define i64 @test_arith_8(<4 x i64> %A, <2 x i32> %B, <4 x i32> %C) { 68 %F = extractelement <2 x i32> %B, i32 1 69 %W = zext i32 %F to i64 70 %T = add i64 %W , 11 71 ret i64 %T 72 } 73 74 define <4 x i64> @test_arith_9(<4 x i64> %A, <2 x i32> %B, <4 x i16> %C) { 75 %T = add <4 x i16> %C, %C 76 %F0 = extractelement <4 x i16> %T, i32 0 77 %F1 = extractelement <4 x i16> %T, i32 1 78 %W0 = zext i16 %F0 to i64 79 %W1 = zext i16 %F1 to i64 80 %Y0 = insertelement <4 x i64> %A, i64 %W0, i32 0 81 %Y1 = insertelement <4 x i64> %Y0, i64 %W1, i32 2 82 ret <4 x i64> %Y1 83 } 84 85 define <4 x i16> @test_arith_10(<4 x i64> %A, <2 x i32> %B, <4 x i32> %C) { 86 %F = bitcast <2 x i32> %B to <4 x i16> 87 %T = add <4 x i16> %F , <i16 0, i16 1, i16 2, i16 3> 88 ret <4 x i16> %T 89 } 90 91 92 ; Simple tests to check saving/loading from memory 93 define <4 x i16> @test_mem_0(<4 x i64> %A, <2 x i32> %B, <4 x i32> %C) { 94 %F = bitcast <2 x i32> %B to <4 x i16> 95 %T = add <4 x i16> %F , <i16 0, i16 1, i16 2, i16 3> 96 ret <4 x i16> %T 97 } 98 99