331 lines
10 KiB
LLVM
331 lines
10 KiB
LLVM
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
||
|
; RUN: llc -mtriple=sparc-linux-gnu < %s | FileCheck %s -check-prefixes=ALL,V8,V8-OPT
|
||
|
; RUN: llc -mtriple=sparcel-linux-gnu < %s | FileCheck %s -check-prefixes=ALL,V8,V8-OPT
|
||
|
; RUN: llc -mtriple=sparc-linux-gnu -O0 < %s | FileCheck %s -check-prefixes=ALL,V8,V8-UNOPT
|
||
|
; RUN: llc -mtriple=sparc-linux-gnu -mattr=v9 < %s | FileCheck %s -check-prefixes=ALL,V9
|
||
|
; RUN: llc -mtriple=sparc64-unknown-linux < %s | FileCheck %s -check-prefixes=ALL,SPARC64
|
||
|
|
||
|
define void @test_load_store(half* %p, half* %q) nounwind {
|
||
|
; ALL-LABEL: test_load_store:
|
||
|
; ALL: ! %bb.0:
|
||
|
; ALL-NEXT: lduh [%o0], %o0
|
||
|
; ALL-NEXT: retl
|
||
|
; ALL-NEXT: sth %o0, [%o1]
|
||
|
%a = load half, half* %p
|
||
|
store half %a, half* %q
|
||
|
ret void
|
||
|
}
|
||
|
|
||
|
define float @test_fpextend_float(half* %p) nounwind {
|
||
|
; V8-LABEL: test_fpextend_float:
|
||
|
; V8: ! %bb.0:
|
||
|
; V8-NEXT: save %sp, -96, %sp
|
||
|
; V8-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-NEXT: lduh [%i0], %o0
|
||
|
; V8-NEXT: ret
|
||
|
; V8-NEXT: restore
|
||
|
;
|
||
|
; V9-LABEL: test_fpextend_float:
|
||
|
; V9: ! %bb.0:
|
||
|
; V9-NEXT: save %sp, -96, %sp
|
||
|
; V9-NEXT: call __gnu_h2f_ieee
|
||
|
; V9-NEXT: lduh [%i0], %o0
|
||
|
; V9-NEXT: ret
|
||
|
; V9-NEXT: restore
|
||
|
;
|
||
|
; SPARC64-LABEL: test_fpextend_float:
|
||
|
; SPARC64: ! %bb.0:
|
||
|
; SPARC64-NEXT: save %sp, -176, %sp
|
||
|
; SPARC64-NEXT: call __gnu_h2f_ieee
|
||
|
; SPARC64-NEXT: lduh [%i0], %o0
|
||
|
; SPARC64-NEXT: ret
|
||
|
; SPARC64-NEXT: restore
|
||
|
%a = load half, half* %p
|
||
|
%r = fpext half %a to float
|
||
|
ret float %r
|
||
|
}
|
||
|
|
||
|
define double @test_fpextend_double(half* %p) nounwind {
|
||
|
; V8-LABEL: test_fpextend_double:
|
||
|
; V8: ! %bb.0:
|
||
|
; V8-NEXT: save %sp, -96, %sp
|
||
|
; V8-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-NEXT: lduh [%i0], %o0
|
||
|
; V8-NEXT: fstod %f0, %f0
|
||
|
; V8-NEXT: ret
|
||
|
; V8-NEXT: restore
|
||
|
;
|
||
|
; V9-LABEL: test_fpextend_double:
|
||
|
; V9: ! %bb.0:
|
||
|
; V9-NEXT: save %sp, -96, %sp
|
||
|
; V9-NEXT: call __gnu_h2f_ieee
|
||
|
; V9-NEXT: lduh [%i0], %o0
|
||
|
; V9-NEXT: fstod %f0, %f0
|
||
|
; V9-NEXT: ret
|
||
|
; V9-NEXT: restore
|
||
|
;
|
||
|
; SPARC64-LABEL: test_fpextend_double:
|
||
|
; SPARC64: ! %bb.0:
|
||
|
; SPARC64-NEXT: save %sp, -176, %sp
|
||
|
; SPARC64-NEXT: call __gnu_h2f_ieee
|
||
|
; SPARC64-NEXT: lduh [%i0], %o0
|
||
|
; SPARC64-NEXT: fstod %f0, %f0
|
||
|
; SPARC64-NEXT: ret
|
||
|
; SPARC64-NEXT: restore
|
||
|
%a = load half, half* %p
|
||
|
%r = fpext half %a to double
|
||
|
ret double %r
|
||
|
}
|
||
|
|
||
|
define void @test_fptrunc_float(float %f, half* %p) nounwind {
|
||
|
; V8-OPT-LABEL: test_fptrunc_float:
|
||
|
; V8-OPT: ! %bb.0:
|
||
|
; V8-OPT-NEXT: save %sp, -96, %sp
|
||
|
; V8-OPT-NEXT: call __gnu_f2h_ieee
|
||
|
; V8-OPT-NEXT: mov %i0, %o0
|
||
|
; V8-OPT-NEXT: sth %o0, [%i1]
|
||
|
; V8-OPT-NEXT: ret
|
||
|
; V8-OPT-NEXT: restore
|
||
|
;
|
||
|
; V8-UNOPT-LABEL: test_fptrunc_float:
|
||
|
; V8-UNOPT: ! %bb.0:
|
||
|
; V8-UNOPT-NEXT: save %sp, -96, %sp
|
||
|
; V8-UNOPT-NEXT: mov %i0, %o0
|
||
|
; V8-UNOPT-NEXT: st %o0, [%fp+-4]
|
||
|
; V8-UNOPT-NEXT: call __gnu_f2h_ieee
|
||
|
; V8-UNOPT-NEXT: ld [%fp+-4], %f0
|
||
|
; V8-UNOPT-NEXT: sth %o0, [%i1]
|
||
|
; V8-UNOPT-NEXT: ret
|
||
|
; V8-UNOPT-NEXT: restore
|
||
|
;
|
||
|
; V9-LABEL: test_fptrunc_float:
|
||
|
; V9: ! %bb.0:
|
||
|
; V9-NEXT: save %sp, -96, %sp
|
||
|
; V9-NEXT: call __gnu_f2h_ieee
|
||
|
; V9-NEXT: mov %i0, %o0
|
||
|
; V9-NEXT: sth %o0, [%i1]
|
||
|
; V9-NEXT: ret
|
||
|
; V9-NEXT: restore
|
||
|
;
|
||
|
; SPARC64-LABEL: test_fptrunc_float:
|
||
|
; SPARC64: ! %bb.0:
|
||
|
; SPARC64-NEXT: save %sp, -176, %sp
|
||
|
; SPARC64-NEXT: call __gnu_f2h_ieee
|
||
|
; SPARC64-NEXT: nop
|
||
|
; SPARC64-NEXT: sth %o0, [%i1]
|
||
|
; SPARC64-NEXT: ret
|
||
|
; SPARC64-NEXT: restore
|
||
|
%a = fptrunc float %f to half
|
||
|
store half %a, half* %p
|
||
|
ret void
|
||
|
}
|
||
|
|
||
|
define void @test_fptrunc_double(double %d, half* %p) nounwind {
|
||
|
; V8-OPT-LABEL: test_fptrunc_double:
|
||
|
; V8-OPT: ! %bb.0:
|
||
|
; V8-OPT-NEXT: save %sp, -112, %sp
|
||
|
; V8-OPT-NEXT: ! kill: def $i1 killed $i1 killed $i0_i1 def $i0_i1
|
||
|
; V8-OPT-NEXT: ! kill: def $i0 killed $i0 killed $i0_i1 def $i0_i1
|
||
|
; V8-OPT-NEXT: std %i0, [%fp+-8]
|
||
|
; V8-OPT-NEXT: ldd [%fp+-8], %f0
|
||
|
; V8-OPT-NEXT: std %f0, [%fp+-16]
|
||
|
; V8-OPT-NEXT: call __truncdfhf2
|
||
|
; V8-OPT-NEXT: ldd [%fp+-16], %o0
|
||
|
; V8-OPT-NEXT: sth %o0, [%i2]
|
||
|
; V8-OPT-NEXT: ret
|
||
|
; V8-OPT-NEXT: restore
|
||
|
;
|
||
|
; V8-UNOPT-LABEL: test_fptrunc_double:
|
||
|
; V8-UNOPT: ! %bb.0:
|
||
|
; V8-UNOPT-NEXT: save %sp, -112, %sp
|
||
|
; V8-UNOPT-NEXT: mov %i1, %i3
|
||
|
; V8-UNOPT-NEXT: mov %i0, %i4
|
||
|
; V8-UNOPT-NEXT: ! implicit-def: $i0_i1
|
||
|
; V8-UNOPT-NEXT: mov %i4, %i0
|
||
|
; V8-UNOPT-NEXT: mov %i3, %i1
|
||
|
; V8-UNOPT-NEXT: std %i0, [%fp+-8]
|
||
|
; V8-UNOPT-NEXT: ldd [%fp+-8], %f0
|
||
|
; V8-UNOPT-NEXT: std %f0, [%fp+-16]
|
||
|
; V8-UNOPT-NEXT: ldd [%fp+-16], %i0
|
||
|
; V8-UNOPT-NEXT: mov %i0, %o0
|
||
|
; V8-UNOPT-NEXT: call __truncdfhf2
|
||
|
; V8-UNOPT-NEXT: mov %i1, %o1
|
||
|
; V8-UNOPT-NEXT: sth %o0, [%i2]
|
||
|
; V8-UNOPT-NEXT: ret
|
||
|
; V8-UNOPT-NEXT: restore
|
||
|
;
|
||
|
; V9-LABEL: test_fptrunc_double:
|
||
|
; V9: ! %bb.0:
|
||
|
; V9-NEXT: save %sp, -112, %sp
|
||
|
; V9-NEXT: ! kill: def $i1 killed $i1 killed $i0_i1 def $i0_i1
|
||
|
; V9-NEXT: ! kill: def $i0 killed $i0 killed $i0_i1 def $i0_i1
|
||
|
; V9-NEXT: std %i0, [%fp+-8]
|
||
|
; V9-NEXT: ldd [%fp+-8], %f0
|
||
|
; V9-NEXT: std %f0, [%fp+-16]
|
||
|
; V9-NEXT: call __truncdfhf2
|
||
|
; V9-NEXT: ldd [%fp+-16], %o0
|
||
|
; V9-NEXT: sth %o0, [%i2]
|
||
|
; V9-NEXT: ret
|
||
|
; V9-NEXT: restore
|
||
|
;
|
||
|
; SPARC64-LABEL: test_fptrunc_double:
|
||
|
; SPARC64: ! %bb.0:
|
||
|
; SPARC64-NEXT: save %sp, -176, %sp
|
||
|
; SPARC64-NEXT: call __truncdfhf2
|
||
|
; SPARC64-NEXT: nop
|
||
|
; SPARC64-NEXT: sth %o0, [%i1]
|
||
|
; SPARC64-NEXT: ret
|
||
|
; SPARC64-NEXT: restore
|
||
|
%a = fptrunc double %d to half
|
||
|
store half %a, half* %p
|
||
|
ret void
|
||
|
}
|
||
|
|
||
|
define void @test_fadd(half* %p, half* %q) nounwind {
|
||
|
; V8-OPT-LABEL: test_fadd:
|
||
|
; V8-OPT: ! %bb.0:
|
||
|
; V8-OPT-NEXT: save %sp, -104, %sp
|
||
|
; V8-OPT-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-OPT-NEXT: lduh [%i0], %o0
|
||
|
; V8-OPT-NEXT: st %f0, [%fp+-8] ! 4-byte Folded Spill
|
||
|
; V8-OPT-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-OPT-NEXT: lduh [%i1], %o0
|
||
|
; V8-OPT-NEXT: ld [%fp+-8], %f1 ! 4-byte Folded Reload
|
||
|
; V8-OPT-NEXT: fadds %f1, %f0, %f0
|
||
|
; V8-OPT-NEXT: st %f0, [%fp+-4]
|
||
|
; V8-OPT-NEXT: call __gnu_f2h_ieee
|
||
|
; V8-OPT-NEXT: ld [%fp+-4], %o0
|
||
|
; V8-OPT-NEXT: sth %o0, [%i0]
|
||
|
; V8-OPT-NEXT: ret
|
||
|
; V8-OPT-NEXT: restore
|
||
|
;
|
||
|
; V8-UNOPT-LABEL: test_fadd:
|
||
|
; V8-UNOPT: ! %bb.0:
|
||
|
; V8-UNOPT-NEXT: save %sp, -104, %sp
|
||
|
; V8-UNOPT-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-UNOPT-NEXT: lduh [%i0], %o0
|
||
|
; V8-UNOPT-NEXT: st %f0, [%fp+-8] ! 4-byte Folded Spill
|
||
|
; V8-UNOPT-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-UNOPT-NEXT: lduh [%i1], %o0
|
||
|
; V8-UNOPT-NEXT: fmovs %f0, %f1
|
||
|
; V8-UNOPT-NEXT: ld [%fp+-8], %f0 ! 4-byte Folded Reload
|
||
|
; V8-UNOPT-NEXT: fadds %f0, %f1, %f0
|
||
|
; V8-UNOPT-NEXT: st %f0, [%fp+-4]
|
||
|
; V8-UNOPT-NEXT: call __gnu_f2h_ieee
|
||
|
; V8-UNOPT-NEXT: ld [%fp+-4], %o0
|
||
|
; V8-UNOPT-NEXT: sth %o0, [%i0]
|
||
|
; V8-UNOPT-NEXT: ret
|
||
|
; V8-UNOPT-NEXT: restore
|
||
|
;
|
||
|
; V9-LABEL: test_fadd:
|
||
|
; V9: ! %bb.0:
|
||
|
; V9-NEXT: save %sp, -104, %sp
|
||
|
; V9-NEXT: call __gnu_h2f_ieee
|
||
|
; V9-NEXT: lduh [%i0], %o0
|
||
|
; V9-NEXT: st %f0, [%fp+-8] ! 4-byte Folded Spill
|
||
|
; V9-NEXT: call __gnu_h2f_ieee
|
||
|
; V9-NEXT: lduh [%i1], %o0
|
||
|
; V9-NEXT: ld [%fp+-8], %f1 ! 4-byte Folded Reload
|
||
|
; V9-NEXT: fadds %f1, %f0, %f0
|
||
|
; V9-NEXT: st %f0, [%fp+-4]
|
||
|
; V9-NEXT: call __gnu_f2h_ieee
|
||
|
; V9-NEXT: ld [%fp+-4], %o0
|
||
|
; V9-NEXT: sth %o0, [%i0]
|
||
|
; V9-NEXT: ret
|
||
|
; V9-NEXT: restore
|
||
|
;
|
||
|
; SPARC64-LABEL: test_fadd:
|
||
|
; SPARC64: ! %bb.0:
|
||
|
; SPARC64-NEXT: save %sp, -192, %sp
|
||
|
; SPARC64-NEXT: call __gnu_h2f_ieee
|
||
|
; SPARC64-NEXT: lduh [%i0], %o0
|
||
|
; SPARC64-NEXT: st %f0, [%fp+2043] ! 4-byte Folded Spill
|
||
|
; SPARC64-NEXT: call __gnu_h2f_ieee
|
||
|
; SPARC64-NEXT: lduh [%i1], %o0
|
||
|
; SPARC64-NEXT: ld [%fp+2043], %f1 ! 4-byte Folded Reload
|
||
|
; SPARC64-NEXT: call __gnu_f2h_ieee
|
||
|
; SPARC64-NEXT: fadds %f1, %f0, %f1
|
||
|
; SPARC64-NEXT: sth %o0, [%i0]
|
||
|
; SPARC64-NEXT: ret
|
||
|
; SPARC64-NEXT: restore
|
||
|
%a = load half, half* %p
|
||
|
%b = load half, half* %q
|
||
|
%r = fadd half %a, %b
|
||
|
store half %r, half* %p
|
||
|
ret void
|
||
|
}
|
||
|
|
||
|
define void @test_fmul(half* %p, half* %q) nounwind {
|
||
|
; V8-OPT-LABEL: test_fmul:
|
||
|
; V8-OPT: ! %bb.0:
|
||
|
; V8-OPT-NEXT: save %sp, -104, %sp
|
||
|
; V8-OPT-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-OPT-NEXT: lduh [%i0], %o0
|
||
|
; V8-OPT-NEXT: st %f0, [%fp+-8] ! 4-byte Folded Spill
|
||
|
; V8-OPT-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-OPT-NEXT: lduh [%i1], %o0
|
||
|
; V8-OPT-NEXT: ld [%fp+-8], %f1 ! 4-byte Folded Reload
|
||
|
; V8-OPT-NEXT: fmuls %f1, %f0, %f0
|
||
|
; V8-OPT-NEXT: st %f0, [%fp+-4]
|
||
|
; V8-OPT-NEXT: call __gnu_f2h_ieee
|
||
|
; V8-OPT-NEXT: ld [%fp+-4], %o0
|
||
|
; V8-OPT-NEXT: sth %o0, [%i0]
|
||
|
; V8-OPT-NEXT: ret
|
||
|
; V8-OPT-NEXT: restore
|
||
|
;
|
||
|
; V8-UNOPT-LABEL: test_fmul:
|
||
|
; V8-UNOPT: ! %bb.0:
|
||
|
; V8-UNOPT-NEXT: save %sp, -104, %sp
|
||
|
; V8-UNOPT-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-UNOPT-NEXT: lduh [%i0], %o0
|
||
|
; V8-UNOPT-NEXT: st %f0, [%fp+-8] ! 4-byte Folded Spill
|
||
|
; V8-UNOPT-NEXT: call __gnu_h2f_ieee
|
||
|
; V8-UNOPT-NEXT: lduh [%i1], %o0
|
||
|
; V8-UNOPT-NEXT: fmovs %f0, %f1
|
||
|
; V8-UNOPT-NEXT: ld [%fp+-8], %f0 ! 4-byte Folded Reload
|
||
|
; V8-UNOPT-NEXT: fmuls %f0, %f1, %f0
|
||
|
; V8-UNOPT-NEXT: st %f0, [%fp+-4]
|
||
|
; V8-UNOPT-NEXT: call __gnu_f2h_ieee
|
||
|
; V8-UNOPT-NEXT: ld [%fp+-4], %o0
|
||
|
; V8-UNOPT-NEXT: sth %o0, [%i0]
|
||
|
; V8-UNOPT-NEXT: ret
|
||
|
; V8-UNOPT-NEXT: restore
|
||
|
;
|
||
|
; V9-LABEL: test_fmul:
|
||
|
; V9: ! %bb.0:
|
||
|
; V9-NEXT: save %sp, -104, %sp
|
||
|
; V9-NEXT: call __gnu_h2f_ieee
|
||
|
; V9-NEXT: lduh [%i0], %o0
|
||
|
; V9-NEXT: st %f0, [%fp+-8] ! 4-byte Folded Spill
|
||
|
; V9-NEXT: call __gnu_h2f_ieee
|
||
|
; V9-NEXT: lduh [%i1], %o0
|
||
|
; V9-NEXT: ld [%fp+-8], %f1 ! 4-byte Folded Reload
|
||
|
; V9-NEXT: fmuls %f1, %f0, %f0
|
||
|
; V9-NEXT: st %f0, [%fp+-4]
|
||
|
; V9-NEXT: call __gnu_f2h_ieee
|
||
|
; V9-NEXT: ld [%fp+-4], %o0
|
||
|
; V9-NEXT: sth %o0, [%i0]
|
||
|
; V9-NEXT: ret
|
||
|
; V9-NEXT: restore
|
||
|
;
|
||
|
; SPARC64-LABEL: test_fmul:
|
||
|
; SPARC64: ! %bb.0:
|
||
|
; SPARC64-NEXT: save %sp, -192, %sp
|
||
|
; SPARC64-NEXT: call __gnu_h2f_ieee
|
||
|
; SPARC64-NEXT: lduh [%i0], %o0
|
||
|
; SPARC64-NEXT: st %f0, [%fp+2043] ! 4-byte Folded Spill
|
||
|
; SPARC64-NEXT: call __gnu_h2f_ieee
|
||
|
; SPARC64-NEXT: lduh [%i1], %o0
|
||
|
; SPARC64-NEXT: ld [%fp+2043], %f1 ! 4-byte Folded Reload
|
||
|
; SPARC64-NEXT: call __gnu_f2h_ieee
|
||
|
; SPARC64-NEXT: fmuls %f1, %f0, %f1
|
||
|
; SPARC64-NEXT: sth %o0, [%i0]
|
||
|
; SPARC64-NEXT: ret
|
||
|
; SPARC64-NEXT: restore
|
||
|
%a = load half, half* %p
|
||
|
%b = load half, half* %q
|
||
|
%r = fmul half %a, %b
|
||
|
store half %r, half* %p
|
||
|
ret void
|
||
|
}
|