Files
clang-p2996/llvm/test/CodeGen/M68k/Arith/mul64.ll
Min-Yih Hsu 657bb7262d [M68k] Separate ADDA from ADD and migrate rest of the arithmetic MC tests
Previously ADD & ADDA (as well as SUB & SUBA) instructions are mixed
together, which not only violated Motorola assembly's syntax but also
made asm parsing more difficult. This patch separates these two kinds of
instructions migrate rest of the tests from
test/CodeGen/M68k/Encoding/Arithmetic to test/MC/M68k/Arithmetic.

Note that we observed minor regressions on codegen quality: Sometimes
isel uses ADD instead of ADDA even the latter can lead to shorter
sequence of code. This issue implies that some isel patterns might need
to be updated.
2021-08-07 17:19:12 -07:00

20 lines
670 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=m68k-linux -verify-machineinstrs | FileCheck %s
; Currenlty making the libcall is ok, x20 supports i32 mul/div which
; yields saner expansion for i64 mul
define i64 @foo(i64 %t, i64 %u) nounwind {
; CHECK-LABEL: foo:
; CHECK: ; %bb.0:
; CHECK-NEXT: suba.l #20, %sp
; CHECK-NEXT: move.l (36,%sp), (12,%sp)
; CHECK-NEXT: move.l (32,%sp), (8,%sp)
; CHECK-NEXT: move.l (28,%sp), (4,%sp)
; CHECK-NEXT: move.l (24,%sp), (%sp)
; CHECK-NEXT: jsr __muldi3@PLT
; CHECK-NEXT: adda.l #20, %sp
; CHECK-NEXT: rts
%k = mul i64 %t, %u
ret i64 %k
}