File: vec_anyext.ll

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8~deb9u3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 733,456 kB
  • sloc: cpp: 3,776,651; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; ruby: 156
file content (77 lines) | stat: -rw-r--r-- 2,033 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
; RUN: llc < %s -mtriple=x86_64--
; PR 9267

define<4 x i16> @func_16_32() {
  %F = load <4 x i32>, <4 x i32>* undef
  %G = trunc <4 x i32> %F to <4 x i16>
  %H = load <4 x i32>, <4 x i32>* undef
  %Y = trunc <4 x i32> %H to <4 x i16>
  %T = add <4 x i16> %Y, %G
  store <4 x i16>%T , <4 x i16>* undef
  ret <4 x i16> %T
}

define<4 x i16> @func_16_64() {
  %F = load <4 x i64>, <4 x i64>* undef
  %G = trunc <4 x i64> %F to <4 x i16>
  %H = load <4 x i64>, <4 x i64>* undef
  %Y = trunc <4 x i64> %H to <4 x i16>
  %T = xor <4 x i16> %Y, %G
  store <4 x i16>%T , <4 x i16>* undef
  ret <4 x i16> %T
}

define<4 x i32> @func_32_64() {
  %F = load <4 x i64>, <4 x i64>* undef
  %G = trunc <4 x i64> %F to <4 x i32>
  %H = load <4 x i64>, <4 x i64>* undef
  %Y = trunc <4 x i64> %H to <4 x i32>
  %T = or <4 x i32> %Y, %G
  ret <4 x i32> %T
}

define<4 x i8> @func_8_16() {
  %F = load <4 x i16>, <4 x i16>* undef
  %G = trunc <4 x i16> %F to <4 x i8>
  %H = load <4 x i16>, <4 x i16>* undef
  %Y = trunc <4 x i16> %H to <4 x i8>
  %T = add <4 x i8> %Y, %G
  ret <4 x i8> %T
}

define<4 x i8> @func_8_32() {
  %F = load <4 x i32>, <4 x i32>* undef
  %G = trunc <4 x i32> %F to <4 x i8>
  %H = load <4 x i32>, <4 x i32>* undef
  %Y = trunc <4 x i32> %H to <4 x i8>
  %T = sub <4 x i8> %Y, %G
  ret <4 x i8> %T
}

define<4 x i8> @func_8_64() {
  %F = load <4 x i64>, <4 x i64>* undef
  %G = trunc <4 x i64> %F to <4 x i8>
  %H = load <4 x i64>, <4 x i64>* undef
  %Y = trunc <4 x i64> %H to <4 x i8>
  %T = add <4 x i8> %Y, %G
  ret <4 x i8> %T
}

define<4 x i16> @const_16_32() {
  %G = trunc <4 x i32> <i32 0, i32 3, i32 8, i32 7> to <4 x i16>
  ret <4 x i16> %G
}

define<4 x i16> @const_16_64() {
  %G = trunc <4 x i64> <i64 0, i64 3, i64 8, i64 7> to <4 x i16>
  ret <4 x i16> %G
}

define void @bugOnTruncBitwidthReduce() nounwind {
meh:
  %0 = xor <4 x i64> zeroinitializer, zeroinitializer
  %1 = trunc <4 x i64> %0 to <4 x i32>
  %2 = lshr <4 x i32> %1, <i32 18, i32 18, i32 18, i32 18>
  %3 = xor <4 x i32> %2, %1
  ret void
}