1 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 -O3 | FileCheck %s --check-prefix=OPT 2 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 -O0 | FileCheck %s --check-prefix=NOOPT 3 4 ; OPT-LABEL: @mulwide16 5 ; NOOPT-LABEL: @mulwide16 6 define i32 @mulwide16(i16 %a, i16 %b) { 7 ; OPT: mul.wide.s16 8 ; NOOPT: mul.lo.s32 9 %val0 = sext i16 %a to i32 10 %val1 = sext i16 %b to i32 11 %val2 = mul i32 %val0, %val1 12 ret i32 %val2 13 } 14 15 ; OPT-LABEL: @mulwideu16 16 ; NOOPT-LABEL: @mulwideu16 17 define i32 @mulwideu16(i16 %a, i16 %b) { 18 ; OPT: mul.wide.u16 19 ; NOOPT: mul.lo.s32 20 %val0 = zext i16 %a to i32 21 %val1 = zext i16 %b to i32 22 %val2 = mul i32 %val0, %val1 23 ret i32 %val2 24 } 25 26 ; OPT-LABEL: @mulwide8 27 ; NOOPT-LABEL: @mulwide8 28 define i32 @mulwide8(i8 %a, i8 %b) { 29 ; OPT: mul.wide.s16 30 ; NOOPT: mul.lo.s32 31 %val0 = sext i8 %a to i32 32 %val1 = sext i8 %b to i32 33 %val2 = mul i32 %val0, %val1 34 ret i32 %val2 35 } 36 37 ; OPT-LABEL: @mulwideu8 38 ; NOOPT-LABEL: @mulwideu8 39 define i32 @mulwideu8(i8 %a, i8 %b) { 40 ; OPT: mul.wide.u16 41 ; NOOPT: mul.lo.s32 42 %val0 = zext i8 %a to i32 43 %val1 = zext i8 %b to i32 44 %val2 = mul i32 %val0, %val1 45 ret i32 %val2 46 } 47 48 ; OPT-LABEL: @mulwide32 49 ; NOOPT-LABEL: @mulwide32 50 define i64 @mulwide32(i32 %a, i32 %b) { 51 ; OPT: mul.wide.s32 52 ; NOOPT: mul.lo.s64 53 %val0 = sext i32 %a to i64 54 %val1 = sext i32 %b to i64 55 %val2 = mul i64 %val0, %val1 56 ret i64 %val2 57 } 58 59 ; OPT-LABEL: @mulwideu32 60 ; NOOPT-LABEL: @mulwideu32 61 define i64 @mulwideu32(i32 %a, i32 %b) { 62 ; OPT: mul.wide.u32 63 ; NOOPT: mul.lo.s64 64 %val0 = zext i32 %a to i64 65 %val1 = zext i32 %b to i64 66 %val2 = mul i64 %val0, %val1 67 ret i64 %val2 68 } 69 70 ; OPT-LABEL: @mulwideu7 71 ; NOOPT-LABEL: @mulwideu7 72 define i64 @mulwideu7(i7 %a, i7 %b) { 73 ; OPT: mul.wide.u32 74 ; NOOPT: mul.lo.s64 75 %val0 = zext i7 %a to i64 76 %val1 = zext i7 %b to i64 77 %val2 = mul i64 %val0, %val1 78 ret i64 %val2 79 } 80 81 ; OPT-LABEL: @mulwides7 82 ; NOOPT-LABEL: @mulwides7 83 define i64 @mulwides7(i7 %a, i7 %b) { 84 ; OPT: mul.wide.s32 85 ; NOOPT: mul.lo.s64 86 %val0 = sext i7 %a to i64 87 %val1 = sext i7 %b to i64 88 %val2 = mul i64 %val0, %val1 89 ret i64 %val2 90 } 91