2 * Copyright 2011 Christoph Bumiller
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
24 #include "codegen/nv50_ir_target_gm107.h"
25 #include "codegen/nv50_ir_lowering_gm107.h"
29 Target
*getTargetGM107(unsigned int chipset
)
31 return new TargetGM107(chipset
);
34 // BULTINS / LIBRARY FUNCTIONS:
36 // lazyness -> will just hardcode everything for the time being
38 #include "lib/gm107.asm.h"
41 TargetGM107::getBuiltinCode(const uint32_t **code
, uint32_t *size
) const
43 *code
= (const uint32_t *)&gm107_builtin_code
[0];
44 *size
= sizeof(gm107_builtin_code
);
48 TargetGM107::getBuiltinOffset(int builtin
) const
50 assert(builtin
< NVC0_BUILTIN_COUNT
);
51 return gm107_builtin_offsets
[builtin
];
55 TargetGM107::isOpSupported(operation op
, DataType ty
) const
72 TargetGM107::runLegalizePass(Program
*prog
, CGStage stage
) const
74 if (stage
== CG_STAGE_PRE_SSA
) {
75 GM107LoweringPass
pass(prog
);
76 return pass
.run(prog
, false, true);
78 if (stage
== CG_STAGE_POST_RA
) {
79 NVC0LegalizePostRA
pass(prog
);
80 return pass
.run(prog
, false, true);
82 if (stage
== CG_STAGE_SSA
) {
84 return pass
.run(prog
, false, true);
90 TargetGM107::getCodeEmitter(Program::Type type
)
92 return createCodeEmitterGM107(type
);
95 } // namespace nv50_ir