source: trunk/lib_ir/gen/llc_func.pytemplate.ll @ 3985

Last change on this file since 3985 was 3985, checked in by linmengl, 5 years ago

add testcases for insert_vector_element and extract_

File size: 946 bytes
Line 
1{% for name in FunctionNames %}
2define <64 x i2> @{{ name.c }}(<64 x i2> %a, <64 x i2> %b) {
3entry:
4  %c = {{ name.op }} <64 x i2> %a, %b
5{% if "icmp" in name.op %}
6  %d = sext <64 x i1> %c to <64 x i2>
7  ret <64 x i2> %d
8{% else %}
9  ret <64 x i2> %c
10{% endif %}
11}
12{% endfor %}
13
14{% for x in range(0, 4) %}
15define <64 x i2> @insertelement_idx0_elt{{ x }}(<64 x i2> %a) {
16entry:
17  %c = insertelement <64 x i2> %a, i2 {{ x }}, i32 0
18  ret <64 x i2> %c
19}
20
21define <64 x i2> @insertelement_idx1_elt{{ x }}(<64 x i2> %a) {
22entry:
23  %c = insertelement <64 x i2> %a, i2 {{ x }}, i32 1
24  ret <64 x i2> %c
25}
26
27define <64 x i2> @insertelement_idx17_elt{{ x }}(<64 x i2> %a) {
28entry:
29  %c = insertelement <64 x i2> %a, i2 {{ x }}, i32 17
30  ret <64 x i2> %c
31}
32
33{% endfor %}
34
35{% for x in [0, 1, 17] %}
36define i8 @extractelement_idx{{ x }}(<64 x i2> %a) {
37entry:
38  %c = extractelement <64 x i2> %a, i32 {{ x }}
39  %d = zext i2 %c to i8
40  ret i8 %d
41}
42{% endfor %}
Note: See TracBrowser for help on using the repository browser.