message: [XLA:CPU] Implement RngBernoulli for F32 and F64
diff: @@ -1267,10 +1267,24 @@ llvm_ir::ElementGenerator ElementalIrEmitter::MakeRngElementGenerator(
  case RNG_BERNOULLI: {
  TF_ASSIGN_OR_RETURN(llvm::Value * p,
  operand_to_generator.at(hlo->operand(0))(index));
  - return ir_builder_->CreateZExt(
  - ir_builder_->CreateFCmpOLT(get_next_uniform_float(), p),
  - llvm_ir::PrimitiveTypeToIrType(hlo->shape().element_type(),
  - module_));
  + PrimitiveType element_type = hlo->shape().element_type();
  + llvm::Value* zero;
  + llvm::Value* one;
  + llvm::Type* result_ir_type = llvm_ir::PrimitiveTypeToIrType(
  + hlo->shape().element_type(), module_);
  + if (primitive_util::IsFloatingPointType(element_type)) {
  + zero = llvm::ConstantFP::get(result_ir_type, 0.0);
  + one = llvm::ConstantFP::get(result_ir_type, 1.0);
  + } else if (primitive_util::IsIntegralType(element_type)) {
  + zero = llvm::ConstantInt::get(result_ir_type, 0);
  + one = llvm::ConstantInt::get(result_ir_type, 1);
  + } else {
  + return Unimplemented(
  + "Rng Bernoulli unimplemented for requested type!");
  + }
  +
  + return ir_builder_->CreateSelect(
  + ir_builder_->CreateFCmpOLT(get_next_uniform_float(), p), one, zero);
  }
  default:
  return InvalidArgument(
  