Fix min and max intrinsics

This commit is contained in:
Jasper Bekkers 2020-10-15 17:58:15 +02:00
parent 6df8774dc9
commit 77e2914c21
No known key found for this signature in database
GPG Key ID: 2F16E81D61CAEF01

View File

@ -209,16 +209,16 @@ impl<'a, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'tcx> {
}
sym::minnumf32 | sym::minnumf64 => {
if self.kernel_mode {
self.cl_op(CLOp::fmin, [args[0].immediate()])
self.cl_op(CLOp::fmin, [args[0].immediate(), args[1].immediate()])
} else {
self.gl_op(GLOp::FMin, [args[0].immediate()])
self.gl_op(GLOp::FMin, [args[0].immediate(), args[1].immediate()])
}
}
sym::maxnumf32 | sym::maxnumf64 => {
if self.kernel_mode {
self.cl_op(CLOp::fmax, [args[0].immediate()])
self.cl_op(CLOp::fmax, [args[0].immediate(), args[1].immediate()])
} else {
self.gl_op(GLOp::FMax, [args[0].immediate()])
self.gl_op(GLOp::FMax, [args[0].immediate(), args[1].immediate()])
}
}
sym::copysignf32 | sym::copysignf64 => {