Ejemplo n.º 1
0
 /// <summary>
 /// Creates a store instruction.
 /// </summary>
 /// <param name="pointeeType">
 /// The type of <paramref name="value"/>. Also the type of
 /// value pointed to by <paramref name="pointer"/>.
 /// </param>
 /// <param name="pointer">
 /// A pointer the target of the store.
 /// </param>
 /// <param name="value">
 /// A value to store at <paramref name="pointer"/>'s pointee.
 /// </param>
 /// <returns>
 /// A store instruction.
 /// </returns>
 public static Instruction CreateStore(
     IType pointeeType,
     ValueTag pointer,
     ValueTag value)
 {
     return(StorePrototype.Create(pointeeType).Instantiate(pointer, value));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a store instruction.
 /// </summary>
 /// <param name="pointeeType">
 /// The type of <paramref name="value"/>. Also the type of
 /// value pointed to by <paramref name="pointer"/>.
 /// </param>
 /// <param name="pointer">
 /// A pointer the target of the store.
 /// </param>
 /// <param name="value">
 /// A value to store at <paramref name="pointer"/>'s pointee.
 /// </param>
 /// <param name="isVolatile">
 /// Tells if the store is a volatile operation.
 /// Volatile operations may not be reordered with regard to each other.
 /// </param>
 /// <param name="alignment">
 /// The pointer alignment of <paramref name="pointer"/>.
 /// </param>
 /// <returns>
 /// A store instruction.
 /// </returns>
 public static Instruction CreateStore(
     IType pointeeType,
     ValueTag pointer,
     ValueTag value,
     bool isVolatile     = false,
     Alignment alignment = default(Alignment))
 {
     return(StorePrototype.Create(pointeeType, isVolatile, alignment).Instantiate(pointer, value));
 }
Ejemplo n.º 3
0
 private static StorePrototype DecodeStore(IReadOnlyList <LNode> data, DecoderState state)
 {
     if (data.Count >= 3)
     {
         return(StorePrototype.Create(
                    state.DecodeType(data[0]),
                    state.DecodeBoolean(data[1]),
                    state.DecodeAlignment(data[2])));
     }
     else if (data.Count >= 2)
     {
         return(StorePrototype.Create(
                    state.DecodeType(data[0]),
                    state.DecodeBoolean(data[1])));
     }
     else
     {
         return(StorePrototype.Create(state.DecodeType(data[0])));
     }
 }
Ejemplo n.º 4
0
 private static IReadOnlyList <LNode> EncodeStore(StorePrototype value, EncoderState state)
 {
     if (!value.Alignment.IsNaturallyAligned)
     {
         return(new LNode[]
         {
             state.Encode(value.ResultType),
             state.Encode(value.IsVolatile),
             state.Encode(value.Alignment)
         });
     }
     else if (value.IsVolatile)
     {
         return(new LNode[]
         {
             state.Encode(value.ResultType),
             state.Encode(value.IsVolatile)
         });
     }
     else
     {
         return(new LNode[] { state.Encode(value.ResultType) });
     }
 }
 private static IReadOnlyList <LNode> EncodeStore(StorePrototype value, EncoderState state)
 {
     return(new LNode[] { state.Encode(value.ResultType) });
 }
 private static StorePrototype DecodeStore(IReadOnlyList <LNode> data, DecoderState state)
 {
     return(StorePrototype.Create(state.DecodeType(data[0])));
 }