• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
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
16
17    ret i8 %tmp.1
18    ; FUN:        rtsd
19    ; MUL:        rtsd
20    ; MUL:        mul
21}
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
31
32    ret i16 %tmp.1
33    ; FUN:        rtsd
34    ; MUL:        rtsd
35    ; MUL:        mul
36}
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
46
47    ret i32 %tmp.1
48    ; FUN:        rtsd
49    ; MUL:        rtsd
50    ; MUL:        mul
51}
52