@@ -148,6 +148,7 @@ pub fn define(insts: &InstructionGroup, immediates: &OperandKinds) -> TransformG
148148 let ieee32 = immediates. by_name ( "ieee32" ) ;
149149 let ieee64 = immediates. by_name ( "ieee64" ) ;
150150 let intcc = immediates. by_name ( "intcc" ) ;
151+ let offset32 = immediates. by_name ( "offset32" ) ;
151152
152153 // List of variables to reuse in patterns.
153154 let x = var ( "x" ) ;
@@ -286,6 +287,30 @@ pub fn define(insts: &InstructionGroup, immediates: &OperandKinds) -> TransformG
286287 ] ,
287288 ) ;
288289
290+ // FIXME generalize to any offset once offset+8 can be represented
291+ narrow. legalize (
292+ def ! ( a = load. I128 ( flags, ptr, Literal :: constant( offset32, 0 ) ) ) ,
293+ vec ! [
294+ def!( al = load. I64 ( flags, ptr, Literal :: constant( offset32, 0 ) ) ) ,
295+ def!( ah = load. I64 ( flags, ptr, Literal :: constant( offset32, 8 ) ) ) ,
296+ // `iconcat` expects the same byte order as stored in memory,
297+ // so no need to swap depending on endianness.
298+ def!( a = iconcat( al, ah) ) ,
299+ ] ,
300+ ) ;
301+
302+ // FIXME generalize to any offset once offset+8 can be represented
303+ narrow. legalize (
304+ def ! ( store. I128 ( flags, a, ptr, Literal :: constant( offset32, 0 ) ) ) ,
305+ vec ! [
306+ // `isplit` gives the same byte order as stored in memory,
307+ // so no need to swap depending on endianness.
308+ def!( ( al, ah) = isplit( a) ) ,
309+ def!( store. I64 ( flags, al, ptr, Literal :: constant( offset32, 0 ) ) ) ,
310+ def!( store. I64 ( flags, ah, ptr, Literal :: constant( offset32, 8 ) ) ) ,
311+ ] ,
312+ ) ;
313+
289314 // Widen instructions with one input operand.
290315 for & op in & [ bnot, popcnt] {
291316 for & int_ty in & [ I8 , I16 ] {
0 commit comments