2015-01-07 02:00:21 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
2015-02-11 22:26:46 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=VI -check-prefix=FUNC %s
|
2014-06-25 06:13:39 +08:00
|
|
|
|
|
|
|
declare double @llvm.AMDGPU.rsq.clamped.f64(double) nounwind readnone
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}rsq_clamped_f64:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_rsq_clamp_f64_e32
|
2015-02-11 22:26:46 +08:00
|
|
|
|
|
|
|
; VI: v_rsq_f64_e32 [[RSQ:v\[[0-9]+:[0-9]+\]]], s[2:3]
|
|
|
|
; TODO: this constant should be folded:
|
|
|
|
; VI: s_mov_b32 s[[ALLBITS:[0-9+]]], -1
|
|
|
|
; VI: s_mov_b32 s[[HIGH1:[0-9+]]], 0x7fefffff
|
|
|
|
; VI: s_mov_b32 s[[LOW1:[0-9+]]], s[[ALLBITS]]
|
|
|
|
; VI: v_min_f64 v[0:1], [[RSQ]], s{{\[}}[[LOW1]]:[[HIGH1]]]
|
|
|
|
; VI: s_mov_b32 s[[HIGH2:[0-9+]]], 0xffefffff
|
|
|
|
; VI: s_mov_b32 s[[LOW2:[0-9+]]], s[[ALLBITS]]
|
|
|
|
; VI: v_max_f64 v[0:1], v[0:1], s{{\[}}[[LOW2]]:[[HIGH2]]]
|
|
|
|
|
2014-06-25 06:13:39 +08:00
|
|
|
define void @rsq_clamped_f64(double addrspace(1)* %out, double %src) nounwind {
|
|
|
|
%rsq_clamped = call double @llvm.AMDGPU.rsq.clamped.f64(double %src) nounwind readnone
|
|
|
|
store double %rsq_clamped, double addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|