2017-01-11 08:12:39 +08:00
|
|
|
; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s
|
2017-01-25 06:02:15 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s
|
2017-01-11 08:12:39 +08:00
|
|
|
; RUN: llc -march=r600 -mcpu=cypress -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
|
2014-07-10 11:22:20 +08:00
|
|
|
|
2014-07-17 18:51:23 +08:00
|
|
|
declare i16 @llvm.convert.to.fp16.f32(float) nounwind readnone
|
2014-07-10 11:22:20 +08:00
|
|
|
|
2017-01-11 08:12:39 +08:00
|
|
|
; FUNC-LABEL: {{^}}test_convert_fp32_to_fp16:
|
|
|
|
; GCN: buffer_load_dword [[VAL:v[0-9]+]]
|
|
|
|
; GCN: v_cvt_f16_f32_e32 [[RESULT:v[0-9]+]], [[VAL]]
|
|
|
|
; GCN: buffer_store_short [[RESULT]]
|
|
|
|
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG: VTX_READ_32
|
|
|
|
; EG: FLT32_TO_FLT16
|
2014-07-18 16:43:30 +08:00
|
|
|
define void @test_convert_fp32_to_fp16(i16 addrspace(1)* noalias %out, float addrspace(1)* noalias %in) nounwind {
|
2015-02-28 05:17:42 +08:00
|
|
|
%val = load float, float addrspace(1)* %in, align 4
|
2014-07-17 18:51:23 +08:00
|
|
|
%cvt = call i16 @llvm.convert.to.fp16.f32(float %val) nounwind readnone
|
2014-07-10 11:22:20 +08:00
|
|
|
store i16 %cvt, i16 addrspace(1)* %out, align 2
|
|
|
|
ret void
|
|
|
|
}
|