blob: cefdb8d56f21b6495f21c5c1db5d6b9983a07f1f [file] [log] [blame]
Wesley Pecka70f28c2010-02-23 19:15:24 +00001; Ensure that multiplication is lowered to function calls when the multiplier
2; unit is not available in the hardware and that function calls are not used
3; when the multiplier unit is available in the hardware.
4;
5; RUN: llc < %s -march=mblaze | FileCheck -check-prefix=FUN %s
6; RUN: llc < %s -march=mblaze -mattr=+mul | FileCheck -check-prefix=MUL %s
7
8define i8 @test_i8(i8 %a, i8 %b) {
9 ; FUN: test_i8:
10 ; MUL: test_i8:
11
12 %tmp.1 = mul i8 %a, %b
13 ; FUN-NOT: mul
14 ; FUN: brlid
15 ; MUL-NOT: brlid
Wesley Pecka70f28c2010-02-23 19:15:24 +000016
17 ret i8 %tmp.1
18 ; FUN: rtsd
19 ; MUL: rtsd
Wesley Peck4e9141f2010-10-21 03:57:26 +000020 ; MUL: mul
Wesley Pecka70f28c2010-02-23 19:15:24 +000021}
22
23define i16 @test_i16(i16 %a, i16 %b) {
24 ; FUN: test_i16:
25 ; MUL: test_i16:
26
27 %tmp.1 = mul i16 %a, %b
28 ; FUN-NOT: mul
29 ; FUN: brlid
30 ; MUL-NOT: brlid
Wesley Pecka70f28c2010-02-23 19:15:24 +000031
32 ret i16 %tmp.1
33 ; FUN: rtsd
34 ; MUL: rtsd
Wesley Peck4e9141f2010-10-21 03:57:26 +000035 ; MUL: mul
Wesley Pecka70f28c2010-02-23 19:15:24 +000036}
37
38define i32 @test_i32(i32 %a, i32 %b) {
39 ; FUN: test_i32:
40 ; MUL: test_i32:
41
42 %tmp.1 = mul i32 %a, %b
43 ; FUN-NOT: mul
44 ; FUN: brlid
45 ; MUL-NOT: brlid
Wesley Pecka70f28c2010-02-23 19:15:24 +000046
47 ret i32 %tmp.1
48 ; FUN: rtsd
49 ; MUL: rtsd
Wesley Peck4e9141f2010-10-21 03:57:26 +000050 ; MUL: mul
Wesley Pecka70f28c2010-02-23 19:15:24 +000051}