* decl.c (grok_declarator): Remove a redundant semicolon.
[official-gcc.git] / gcc / lambda-trans.c
blob5195bb61c8fe0cd5fcce2ed31ae6b5e3f4ff4b61
1 /* Lambda matrix transformations.
2 Copyright (C) 2003, 2004 Free Software Foundation, Inc.
3 Contributed by Daniel Berlin <dberlin@dberlin.org>.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tm.h"
26 #include "errors.h"
27 #include "ggc.h"
28 #include "tree.h"
29 #include "target.h"
30 #include "varray.h"
31 #include "lambda.h"
33 /* Allocate a new transformation matrix. */
35 lambda_trans_matrix
36 lambda_trans_matrix_new (int colsize, int rowsize)
38 lambda_trans_matrix ret;
40 ret = ggc_alloc (sizeof (*ret));
41 LTM_MATRIX (ret) = lambda_matrix_new (rowsize, colsize);
42 LTM_ROWSIZE (ret) = rowsize;
43 LTM_COLSIZE (ret) = colsize;
44 LTM_DENOMINATOR (ret) = 1;
45 return ret;
48 /* Compute the inverse of the transformation. */
50 lambda_trans_matrix
51 lambda_trans_matrix_inverse (lambda_trans_matrix mat)
53 lambda_trans_matrix inverse;
54 int determinant;
56 inverse = lambda_trans_matrix_new (LTM_ROWSIZE (mat), LTM_COLSIZE (mat));
57 determinant = lambda_matrix_inverse (LTM_MATRIX (mat), LTM_MATRIX (inverse),
58 LTM_ROWSIZE (mat));
59 LTM_DENOMINATOR (inverse) = determinant;
60 return inverse;
64 /* Print out a transformation matrix. */
66 void
67 print_lambda_trans_matrix (FILE *outfile, lambda_trans_matrix mat)
69 print_lambda_matrix (outfile, LTM_MATRIX (mat), LTM_ROWSIZE (mat),
70 LTM_COLSIZE (mat));