diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-09-14 15:37:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-14 15:37:05 -0700 |
| commit | 10b62eecd94be53eca4ac2555af860f864966d76 (patch) | |
| tree | 9a140acfda0e3f0755f2c120870c72d5a8f4b232 /source/core | |
| parent | 8cdfce564546c03c2c1ce179561591276aeb23a8 (diff) | |
IR: handle control flow constructs (#186)
* IR: handle control flow constructs
This change includes a bunch of fixes and additions to the IR path:
- `slang-ir-assembly` is now a valid output target (so we can use it for testing)
- This uses what used to be the IR "dumping" logic, revamped to support much prettier output.
- A future change will need to add back support for less prettified output to use when actually debugging
- IR generation for `for` loops and `if` statements is supported
- HLSL output from the above control flow constructs is implemented
- Revamped the handling of l-values, and in particular work on compound ops like `+=`
- Add basic IR support for `groupshared` variables
- Add basic IR support for storing compute thread-group size
- Output semantics on entry point parameters
- This uses the AST structures to find semantics, so its still needs work
- Pass through loop unroll flags
- This is required to match `fxc` output, at least until we implement
unrolling ourselves.
* Fixup: 64-bit build issues.
* fixup for merge
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-string.cpp | 14 | ||||
| -rw-r--r-- | source/core/slang-string.h | 7 |
2 files changed, 15 insertions, 6 deletions
diff --git a/source/core/slang-string.cpp b/source/core/slang-string.cpp index 9bc9e3a54..5a3d8e4f9 100644 --- a/source/core/slang-string.cpp +++ b/source/core/slang-string.cpp @@ -266,7 +266,7 @@ namespace Slang append(slice.begin(), slice.end()); } - void String::append(int value, int radix) + void String::append(int32_t value, int radix) { enum { kCount = 33 }; char* data = prepareForAppend(kCount); @@ -275,7 +275,7 @@ namespace Slang buffer->length += count; } - void String::append(unsigned int value, int radix) + void String::append(uint32_t value, int radix) { enum { kCount = 33 }; char* data = prepareForAppend(kCount); @@ -284,7 +284,7 @@ namespace Slang buffer->length += count; } - void String::append(long long value, int radix) + void String::append(int64_t value, int radix) { enum { kCount = 65 }; char* data = prepareForAppend(kCount); @@ -293,6 +293,14 @@ namespace Slang buffer->length += count; } + void String::append(uint64_t value, int radix) + { + enum { kCount = 65 }; + char* data = prepareForAppend(kCount); + auto count = IntToAscii(data, value, radix); + ReverseInternalAscii(data, count); + buffer->length += count; + } void String::append(float val, const char * format) { diff --git a/source/core/slang-string.h b/source/core/slang-string.h index 98fd51a07..ed333f8e8 100644 --- a/source/core/slang-string.h +++ b/source/core/slang-string.h @@ -257,9 +257,10 @@ namespace Slang return getData() + getLength(); } - void append(int value, int radix = 10); - void append(unsigned int value, int radix = 10); - void append(long long value, int radix = 10); + void append(int32_t value, int radix = 10); + void append(uint32_t value, int radix = 10); + void append(int64_t value, int radix = 10); + void append(uint64_t value, int radix = 10); void append(float val, const char * format = "%g"); void append(double val, const char * format = "%g"); |
