55 lines · plain
1; RUN: llc -mtriple=arm-eabi -mattr=+v6 %s -o - | FileCheck %s -check-prefix=V62; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s -check-prefix=V43; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s -check-prefix=M34 5define i32 @smulhi(i32 %x, i32 %y) nounwind {6; V6-LABEL: smulhi:7; V6: smmul8 9; V4-LABEL: smulhi:10; V4: smull11 12; M3-LABEL: smulhi:13; M3: smull14 %tmp = sext i32 %x to i64 ; <i64> [#uses=1]15 %tmp1 = sext i32 %y to i64 ; <i64> [#uses=1]16 %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]17 %tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]18 %tmp3.upgrd.1 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]19 ret i32 %tmp3.upgrd.120}21 22define i32 @umulhi(i32 %x, i32 %y) nounwind {23; V6-LABEL: umulhi:24; V6: umull25 26; V4-LABEL: umulhi:27; V4: umull28 29; M3-LABEL: umulhi:30; M3: umull31 %tmp = zext i32 %x to i64 ; <i64> [#uses=1]32 %tmp1 = zext i32 %y to i64 ; <i64> [#uses=1]33 %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]34 %tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]35 %tmp3.upgrd.2 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]36 ret i32 %tmp3.upgrd.237}38 39; rdar://r1015291140define i32 @t3(i32 %a) nounwind {41; V6-LABEL: t3:42; V6: smmla43 44; V4-LABEL: t3:45; V4: smull46 47; M3-LABEL: t3:48; M3-NOT: smmla49; M3: smull50entry:51 %tmp1 = mul nsw i32 %a, 352 %tmp2 = sdiv i32 %tmp1, 2353 ret i32 %tmp254}55