Skip to content

Commit 71984cb

Browse files
committed
Add support for fmaf16
1 parent 10d745c commit 71984cb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/intrinsic/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
139139
&args.iter().map(|arg| arg.immediate()).collect::<Vec<_>>(),
140140
)
141141
}
142+
sym::fmaf16 => {
143+
let func = self.cx.context.get_builtin_function("fmaf");
144+
let args: Vec<_> = args
145+
.iter()
146+
.map(|arg| {
147+
self.cx.context.new_cast(self.location, arg.immediate(), self.cx.type_f32())
148+
})
149+
.collect();
150+
let result = self.cx.context.new_call(self.location, func, &args);
151+
self.cx.context.new_cast(self.location, result, self.cx.type_f16())
152+
}
142153
sym::is_val_statically_known => {
143154
let a = args[0].immediate();
144155
let builtin = self.context.get_builtin_function("__builtin_constant_p");

0 commit comments

Comments
 (0)