1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -O3 | FileCheck %s --check-prefix=OPT
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -O0 | FileCheck %s --check-prefix=NOOPT
3 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 -O3 | %ptxas-verify %}
4 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 -O0 | %ptxas-verify %}
6 ; OPT-LABEL: @mulwide16
7 ; NOOPT-LABEL: @mulwide16
8 define i32 @mulwide16(i16 %a, i16 %b) {
11 %val0 = sext i16 %a to i32
12 %val1 = sext i16 %b to i32
13 %val2 = mul i32 %val0, %val1
17 ; OPT-LABEL: @mulwideu16
18 ; NOOPT-LABEL: @mulwideu16
19 define i32 @mulwideu16(i16 %a, i16 %b) {
22 %val0 = zext i16 %a to i32
23 %val1 = zext i16 %b to i32
24 %val2 = mul i32 %val0, %val1
28 ; OPT-LABEL: @mulwide8
29 ; NOOPT-LABEL: @mulwide8
30 define i32 @mulwide8(i8 %a, i8 %b) {
33 %val0 = sext i8 %a to i32
34 %val1 = sext i8 %b to i32
35 %val2 = mul i32 %val0, %val1
39 ; OPT-LABEL: @mulwideu8
40 ; NOOPT-LABEL: @mulwideu8
41 define i32 @mulwideu8(i8 %a, i8 %b) {
44 %val0 = zext i8 %a to i32
45 %val1 = zext i8 %b to i32
46 %val2 = mul i32 %val0, %val1
50 ; OPT-LABEL: @mulwide32
51 ; NOOPT-LABEL: @mulwide32
52 define i64 @mulwide32(i32 %a, i32 %b) {
55 %val0 = sext i32 %a to i64
56 %val1 = sext i32 %b to i64
57 %val2 = mul i64 %val0, %val1
61 ; OPT-LABEL: @mulwideu32
62 ; NOOPT-LABEL: @mulwideu32
63 define i64 @mulwideu32(i32 %a, i32 %b) {
66 %val0 = zext i32 %a to i64
67 %val1 = zext i32 %b to i64
68 %val2 = mul i64 %val0, %val1
72 ; OPT-LABEL: @mulwideu7
73 ; NOOPT-LABEL: @mulwideu7
74 define i64 @mulwideu7(i7 %a, i7 %b) {
77 %val0 = zext i7 %a to i64
78 %val1 = zext i7 %b to i64
79 %val2 = mul i64 %val0, %val1
83 ; OPT-LABEL: @mulwides7
84 ; NOOPT-LABEL: @mulwides7
85 define i64 @mulwides7(i7 %a, i7 %b) {
88 %val0 = sext i7 %a to i64
89 %val1 = sext i7 %b to i64
90 %val2 = mul i64 %val0, %val1
96 define i64 @shl30(i32 %a) {
99 %conv = sext i32 %a to i64
100 %shl = shl i64 %conv, 30
105 ; NOOPT-LABEL: @shl31
106 define i64 @shl31(i32 %a) {
108 ; NOOPT-NOT: mul.wide
109 %conv = sext i32 %a to i64
110 %shl = shl i64 %conv, 31