Adding the MicroBlaze backend.
[oota-llvm.git] / test / CodeGen / MBlaze / mul.ll
1 ; 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
8 define 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
16     ; MUL:        mul
17
18     ret i8 %tmp.1
19     ; FUN:        rtsd
20     ; MUL:        rtsd
21 }
22
23 define 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
31     ; MUL:        mul
32
33     ret i16 %tmp.1
34     ; FUN:        rtsd
35     ; MUL:        rtsd
36 }
37
38 define 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
46     ; MUL:        mul
47
48     ret i32 %tmp.1
49     ; FUN:        rtsd
50     ; MUL:        rtsd
51 }