added simple half math ops

Change-Id: I10b1d1023a9e5f2ba63f28c4a2bbe60ee49a8aee
このコミットが含まれているのは:
Aditya Atluri
2016-12-13 20:20:58 -06:00
コミット 7c7d948fc6
2個のファイルの変更50行の追加4行の削除
+16 -1
ファイルの表示
@@ -34,9 +34,24 @@ define linkonce_odr spir_func i32 @__rocm_hadd(i32 %in1, i32 %in2) {
ret i32 %val
}
define linkonce_odr spir_func half @__hip_hadd_clang40_gfx803(half %a, half %b) {
define linkonce_odr spir_func half @__hip_hadd_gfx803(half %a, half %b) #1 {
%val = tail call half asm "v_add_f16 $0, $1, $2","=v,v,v"(half %a, half %b)
ret half %val
}
define linkonce_odr spir_func half @__hip_hfma_gfx803(half %a, half %b, half %c) #1 {
%val = tail call half asm "v_fma_f16 $0, $1, $2, $3","=v,v,v,v"(half %a, half %b, half %c)
ret half %val
}
define linkonce_odr spir_func half @__hip_hmul_gfx803(half %a, half %b) #1 {
%val = tail call half asm "v_mul_f16 $0, $1, $2","=v,v,v"(half %a, half %b)
ret half %val
}
define linkonce_odr spir_func half @__hip_hsub_gfx803(half %a, half %b) #1 {
%val = tail call half asm "v_sub_f16 $0, $1, $2","=v,v,v"(half %a, half %b)
ret half %val
}
attributes #1 = { alwaysinline nounwind }