summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp')
-rw-r--r--src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp49
1 files changed, 26 insertions, 23 deletions
diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp
index 04425623bdb..2aa20053c14 100644
--- a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp
+++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp
@@ -42,6 +42,7 @@ TargetNVC0::TargetNVC0(unsigned int card)
42// Will probably make this nicer once we support subroutines properly, 42// Will probably make this nicer once we support subroutines properly,
43// i.e. when we have an input IR that provides function declarations. 43// i.e. when we have an input IR that provides function declarations.
44 44
45// TODO: separate version for nve4+ which doesn't like the 4-byte insn formats
45static const uint32_t nvc0_builtin_code[] = 46static const uint32_t nvc0_builtin_code[] =
46{ 47{
47// DIV U32: slow unsigned integer division 48// DIV U32: slow unsigned integer division
@@ -57,11 +58,11 @@ static const uint32_t nvc0_builtin_code[] =
57// 58//
58#if 1 59#if 1
59 0x04009c03, 0x78000000, 60 0x04009c03, 0x78000000,
60 0x7c209cdd, 61 0x7c209c82, 0x38000000, // 0x7c209cdd,
61 0x0010dd18, 62 0x0400dde2, 0x18000000, // 0x0010dd18,
62 0x08309c03, 0x60000000, 63 0x08309c03, 0x60000000,
63 0x05605c18, 64 0x05205d04, 0x1c000000, // 0x05605c18,
64 0x0810dc2a, 65 0x0810dc03, 0x50000000, // 0x0810dc2a,
65 0x0c209c43, 0x20040000, 66 0x0c209c43, 0x20040000,
66 0x0810dc03, 0x50000000, 67 0x0810dc03, 0x50000000,
67 0x0c209c43, 0x20040000, 68 0x0c209c43, 0x20040000,
@@ -73,15 +74,15 @@ static const uint32_t nvc0_builtin_code[] =
73 0x0c209c43, 0x20040000, 74 0x0c209c43, 0x20040000,
74 0x0000dde4, 0x28000000, 75 0x0000dde4, 0x28000000,
75 0x08001c43, 0x50000000, 76 0x08001c43, 0x50000000,
76 0x05609c18, 77 0x05209d04, 0x1c000000, // 0x05609c18,
77 0x0010430d, 78 0x00105c03, 0x20060000, // 0x0010430d,
78 0x0811dc03, 0x1b0e0000, 79 0x0811dc03, 0x1b0e0000,
79 0x08104103, 0x48000000, 80 0x08104103, 0x48000000,
80 0x04000002, 0x08000000, 81 0x04000002, 0x08000000,
81 0x0811c003, 0x1b0e0000, 82 0x0811c003, 0x1b0e0000,
82 0x08104103, 0x48000000, 83 0x08104103, 0x48000000,
83 0x040000ac, 84 0x04000002, 0x08000000, // 0x040000ac,
84 0x90001dff, 85 0x00001de7, 0x90000000, // 0x90001dff,
85#else 86#else
86 0x0401dc03, 0x1b0e0000, 87 0x0401dc03, 0x1b0e0000,
87 0x00008003, 0x78000000, 88 0x00008003, 0x78000000,
@@ -111,27 +112,27 @@ static const uint32_t nvc0_builtin_code[] =
111// 112//
112 0xfc05dc23, 0x188e0000, 113 0xfc05dc23, 0x188e0000,
113 0xfc17dc23, 0x18c40000, 114 0xfc17dc23, 0x18c40000,
114 0x03301e18, 115 0x01201ec4, 0x1c000000, // 0x03301e18,
115 0x07305e18, 116 0x05205ec4, 0x1c000000, // 0x07305e18,
116 0x0401dc03, 0x1b0e0000, 117 0x0401dc03, 0x1b0e0000,
117 0x00008003, 0x78000000, 118 0x00008003, 0x78000000,
118 0x0400c003, 0x78000000, 119 0x0400c003, 0x78000000,
119 0x0c20c103, 0x48000000, 120 0x0c20c103, 0x48000000,
120 0x0c108003, 0x60000000, 121 0x0c108003, 0x60000000,
121 0x00005c28, 122 0x00005de4, 0x28000000, // 0x00005c28,
122 0x00001d18, 123 0x00001de2, 0x18000000, // 0x00001d18,
123 0x0031c023, 0x1b0ec000, 124 0x0031c023, 0x1b0ec000,
124 0xb000a1e7, 0x40000000, 125 0xe000a1e7, 0x40000000, // 0xb000a1e7, 0x40000000,
125 0x04000003, 0x6000c000, 126 0x04000003, 0x6000c000,
126 0x0813dc03, 0x1b000000, 127 0x0813dc03, 0x1b000000,
127 0x0420446c, 128 0x04204603, 0x48000000, // 0x0420446c,
128 0x040004bd, 129 0x04000442, 0x38000000, // 0x040004bd,
129 0x04208003, 0x5800c000, 130 0x04208003, 0x5800c000,
130 0x0430c103, 0x4800c000, 131 0x0430c103, 0x4800c000,
131 0x0ffc5dff, 132 0xe0001de7, 0x4003fffe, // 0x0ffc5dff,
132 0x01700e18, 133 0x01200f84, 0x1c000000, // 0x01700e18,
133 0x05704a18, 134 0x05204b84, 0x1c000000, // 0x05704a18,
134 0x90001dff, 135 0x00001de7, 0x90000000, // 0x90001dff,
135 136
136// RCP F64: Newton Raphson reciprocal(x): r_{i+1} = r_i * (2.0 - x * r_i) 137// RCP F64: Newton Raphson reciprocal(x): r_{i+1} = r_i * (2.0 - x * r_i)
137// 138//
@@ -180,9 +181,9 @@ static const uint32_t nvc0_builtin_code[] =
180static const uint16_t nvc0_builtin_offsets[NVC0_BUILTIN_COUNT] = 181static const uint16_t nvc0_builtin_offsets[NVC0_BUILTIN_COUNT] =
181{ 182{
182 0, 183 0,
183 8 * (22), 184 8 * (26),
184 8 * (22 + 18), 185 8 * (26 + 23),
185 8 * (22 + 18 + 9) 186 8 * (26 + 23 + 9)
186}; 187};
187 188
188void 189void
@@ -270,7 +271,7 @@ void TargetNVC0::initOpInfo()
270 OP_STORE, OP_WRSV, OP_EXPORT, OP_BRA, OP_CALL, OP_RET, OP_EXIT, 271 OP_STORE, OP_WRSV, OP_EXPORT, OP_BRA, OP_CALL, OP_RET, OP_EXIT,
271 OP_DISCARD, OP_CONT, OP_BREAK, OP_PRECONT, OP_PREBREAK, OP_PRERET, 272 OP_DISCARD, OP_CONT, OP_BREAK, OP_PRECONT, OP_PREBREAK, OP_PRERET,
272 OP_JOIN, OP_JOINAT, OP_BRKPT, OP_MEMBAR, OP_EMIT, OP_RESTART, 273 OP_JOIN, OP_JOINAT, OP_BRKPT, OP_MEMBAR, OP_EMIT, OP_RESTART,
273 OP_QUADON, OP_QUADPOP 274 OP_QUADON, OP_QUADPOP, OP_TEXBAR
274 }; 275 };
275 276
276 joinAnterior = false; 277 joinAnterior = false;
@@ -445,6 +446,8 @@ TargetNVC0::isAccessSupported(DataFile file, DataType ty) const
445{ 446{
446 if (ty == TYPE_NONE) 447 if (ty == TYPE_NONE)
447 return false; 448 return false;
449 if (file == FILE_MEMORY_CONST && getChipset() >= 0xe0) // wrong encoding ?
450 return typeSizeof(ty) <= 4;
448 if (ty == TYPE_B96) 451 if (ty == TYPE_B96)
449 return (file == FILE_SHADER_INPUT) || (file == FILE_SHADER_OUTPUT); 452 return (file == FILE_SHADER_INPUT) || (file == FILE_SHADER_OUTPUT);
450 return true; 453 return true;