File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,23 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
192192 ret. place_lane ( fx, 0 ) . write_cvalue ( fx, res_lane) ;
193193 }
194194
195+ "llvm.x86.sse.sqrt.ss" => {
196+ // https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sqrt_ss&ig_expand=6278
197+ intrinsic_args ! ( fx, args => ( a) ; intrinsic) ;
198+
199+ assert_eq ! ( a. layout( ) , ret. layout( ) ) ;
200+ let ( _, lane_ty) = a. layout ( ) . ty . simd_size_and_type ( fx. tcx ) ;
201+ assert ! ( lane_ty. is_floating_point( ) ) ;
202+ let ret_lane_layout = fx. layout_of ( lane_ty) ;
203+
204+ ret. write_cvalue ( fx, a) ;
205+
206+ let lane = a. value_lane ( fx, 0 ) . load_scalar ( fx) ;
207+ let res = fx. bcx . ins ( ) . sqrt ( lane) ;
208+ let res_lane = CValue :: by_val ( res, ret_lane_layout) ;
209+ ret. place_lane ( fx, 0 ) . write_cvalue ( fx, res_lane) ;
210+ }
211+
195212 "llvm.x86.sse.sqrt.ps" => {
196213 // https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sqrt_ps&ig_expand=6245
197214 intrinsic_args ! ( fx, args => ( a) ; intrinsic) ;
You can’t perform that action at this time.
0 commit comments