mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +00:00
b96fc4a5ea
Adds the instructions ext/ext32/cins/cins32. It also changes pop/dpop to accept the two operand version and adds a simple pattern to generate baddu. Tests for the two operand versions (including baddu/dmul/dpop/pop) and the code generation pattern for baddu are included. Reviewed by: Daniel.Sanders@imgtec.com git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205449 91177308-0d34-0410-b5e6-96231b3b80d8
30 lines
656 B
LLVM
30 lines
656 B
LLVM
; RUN: llc -O1 < %s -march=mips64 -mcpu=octeon | FileCheck %s -check-prefix=OCTEON
|
|
; RUN: llc -O1 < %s -march=mips64 -mcpu=mips64 | FileCheck %s -check-prefix=MIPS64
|
|
|
|
define i64 @addi64(i64 %a, i64 %b) nounwind {
|
|
entry:
|
|
; OCTEON-LABEL: addi64:
|
|
; OCTEON: jr $ra
|
|
; OCTEON: baddu $2, $4, $5
|
|
; MIPS64-LABEL: addi64:
|
|
; MIPS64: daddu
|
|
; MIPS64: jr
|
|
; MIPS64: andi
|
|
%add = add i64 %a, %b
|
|
%and = and i64 %add, 255
|
|
ret i64 %and
|
|
}
|
|
|
|
define i64 @mul(i64 %a, i64 %b) nounwind {
|
|
entry:
|
|
; OCTEON-LABEL: mul:
|
|
; OCTEON: jr $ra
|
|
; OCTEON: dmul $2, $4, $5
|
|
; MIPS64-LABEL: mul:
|
|
; MIPS64: dmult
|
|
; MIPS64: jr
|
|
; MIPS64: mflo
|
|
%res = mul i64 %a, %b
|
|
ret i64 %res
|
|
}
|