anchor.diff:                                  | _ -> failwithf "cannot subtract types: %A and %A" a.Type b.Type
   
                           | Mul ->
  -                            match a.Type with
  -                                | Integral | VectorOf(_,Integral) -> yield OpIMul(tid, id, ia, ib)
  -                                | Fractional | VectorOf(_,Fractional) -> yield OpFMul(tid, id, ia, ib)
  -                                | _ -> failwithf "cannot multiply types: %A and %A" a.Type b.Type
  -
  +                            if a.Type = b.Type then
  +                                match a.Type with
  +                                    | Integral | VectorOf(_,Integral) -> yield OpIMul(tid, id, ia, ib)
  +                                    | Fractional | VectorOf(_,Fractional) -> yield OpFMul(tid, id, ia, ib)
  +                                    | MatrixOf(size,bt) when size.X = size.Y -> yield OpMatrixTimesMatrix(tid, id, ia, ib)
  +
  +                                    | _ -> failwithf "cannot multiply types: %A and %A" a.Type b.Type
  +                            else
  +                                match a.Type, b.Type with
  +                                    | MatrixOf(ms, mt), VectorOf(vd, vt) when vt = mt && ms.X = vd ->
  +                                        let! resType = compileType (a.Type.GetProperty("C0").PropertyType)
  +                                        yield OpMatrixTimesVector(resType, id, ia, ib)
  +                                    | _ ->
  +                                        failwithf "cannot multiply types: %A and %A" a.Type b.Type 
                           | Div ->
                               match a.Type with
                                   | SignedIntegral | VectorOf(_,SignedIntegral) -> yield OpSDiv(tid, id, ia, ib)
  
positive.code:                 match t with
                 
                      | Num -> 
                          yield OpConstant(tid, id, value |> getDwords)
  
                      | Bool ->
                          if unbox value then yield OpConstantTrue(tid, id)
  
negative.code:             instructions : RevList<Instruction>
              typeCache : HashMap<Type, uint32>
              labelIds : Map<Label, uint32>
              variableIds : Map<Var, VariableId>
              variableDeclarationLabels : Map<Var, uint32>
              currentScope : list<Scope>
        
  