This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -96,12 +96,29 @@ pub(crate) fn clif_int_or_float_cast(
96
96
} ,
97
97
) ;
98
98
99
- fx. lib_call (
100
- & name,
101
- vec ! [ AbiParam :: new( from_ty) ] ,
102
- vec ! [ AbiParam :: new( types:: I128 ) ] ,
103
- & [ from] ,
104
- ) [ 0 ]
99
+ if fx. tcx . sess . target . is_like_windows {
100
+ let ret = fx. lib_call (
101
+ & name,
102
+ vec ! [ AbiParam :: new( from_ty) ] ,
103
+ vec ! [ AbiParam :: new( types:: I64X2 ) ] ,
104
+ & [ from] ,
105
+ ) [ 0 ] ;
106
+ // FIXME use bitcast instead of store to get from i64x2 to i128
107
+ let stack_slot = fx. bcx . create_sized_stack_slot ( StackSlotData {
108
+ kind : StackSlotKind :: ExplicitSlot ,
109
+ size : 16 ,
110
+ } ) ;
111
+ let ret_ptr = Pointer :: stack_slot ( stack_slot) ;
112
+ ret_ptr. store ( fx, ret, MemFlags :: trusted ( ) ) ;
113
+ ret_ptr. load ( fx, types:: I128 , MemFlags :: trusted ( ) )
114
+ } else {
115
+ fx. lib_call (
116
+ & name,
117
+ vec ! [ AbiParam :: new( from_ty) ] ,
118
+ vec ! [ AbiParam :: new( types:: I128 ) ] ,
119
+ & [ from] ,
120
+ ) [ 0 ]
121
+ }
105
122
} else if to_ty == types:: I8 || to_ty == types:: I16 {
106
123
// FIXME implement fcvt_to_*int_sat.i8/i16
107
124
let val = if to_signed {
You can’t perform that action at this time.
0 commit comments