1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 21:13:02 +02:00
llvm-mirror/test/CodeGen/SPARC/LeonSMACUMACInstructionUT.ll
Chris Dewhurst f418c98924 [SPARC] Fixes for hardware errata on LEON processor.
Passes to fix three hardware errata that appear on some LEON processor variants.

The instructions FSMULD, FMULS and FDIVS do not work as expected on some LEON processors. This change allows those instructions to be substituted for alternatives instruction sequences that are known to work.

These passes only run when selected individually, or as part of a processor defintion. They are not included in general SPARC processor compilations for non-LEON processors or for those LEON processors that do not have these hardware errata.

llvm-svn: 273108
2016-06-19 11:03:28 +00:00

21 lines
717 B
LLVM
Executable File

; RUN: llc %s -O0 -march=sparc -mcpu=leon2 -o - | FileCheck %s
; RUN: llc %s -O0 -march=sparc -mcpu=leon3 -o - | FileCheck %s
; RUN: llc %s -O0 -march=sparc -mcpu=leon4 -o - | FileCheck %s
; CHECK-LABEL: smac_test:
; CHECK: smac %o1, %o0, %o0
define i32 @smac_test(i16* %a, i16* %b) {
entry:
; %0 = tail call i32 asm sideeffect "smac $2, $1, $0", "={r2},{r3},{r4}"(i16* %a, i16* %b)
%0 = tail call i32 asm sideeffect "smac $2, $1, $0", "=r,rI,r"(i16* %a, i16* %b)
ret i32 %0
}
; CHECK-LABEL: umac_test:
; CHECK: umac %o1, %o0, %o0
define i32 @umac_test(i16* %a, i16* %b) {
entry:
%0 = tail call i32 asm sideeffect "umac $2, $1, $0", "=r,rI,r"(i16* %a, i16* %b)
ret i32 %0
}