View normalization-test.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
U+0x2f8a6: 慈 ('慈') | |
U+0x6148: 慈 ('慈') | |
U+0x2f999: 茝 ('茝') | |
U+0x831d: 茝 ('茝') | |
U+0x387: · ('·') | |
U+0xb7: · ('·') | |
U+6148 U+0xfe00: 慈︀ ('\u{fe00}') | |
U+6148 U+0xfe01: 慈︁ ('\u{fe01}') | |
U+6148 U+0xfe02: 慈︂ ('\u{fe02}') | |
U+6148 U+0xfe03: 慈︃ ('\u{fe03}') |
View vfprintf.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- vfprintf.c.orig 2019-01-08 16:56:58.147457674 -0800 | |
+++ vfprintf.c 2019-01-11 13:49:08.320056831 -0800 | |
@@ -11,6 +11,54 @@ | |
#include <math.h> | |
#include <float.h> | |
+#if defined(WASM_NO_FLOATING_POINT_SUPPORT) | |
+ | |
+__attribute__((__cold__, __noreturn__)) | |
+static void floating_point_not_supported(void) { |
View gist:3c7412adab7566e11a9280e55e4e4da0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cretonne IL is tuned for codegen. You can see this in the use of EBBs, br_table | |
not taking arguments, the lack of builtin def-use lists, the lack of a | |
general-purpose switch statement, the precense of instructions specialized to | |
take an immediate argument, and other places. | |
I'm entertaining the idea that this works out well for Rustc. It'll make | |
"fast compile" use cases, both "debug" and "pretty good optimization" builds | |
faster. Compared to LLVM's 4 layers in a typical compile (LLVM IR, SelectionDAG, | |
MachineFunction, MC), Cretonne uses one IL throughout, and it's designed | |
to be very compact. |
View gist:b2c32cd1b448c2fcb6e6aa4ae385545a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo() -> Result<T, E> | |
When returning an Ok, foo would clear CF via "clc", and then return | |
the value as if the return type were just a plain T. | |
When returning an Err, foo would set the CF flag via "stc", and then | |
return the value as if the return type were just a plain E. | |
On the caller side, immediately after a call to foo, the caller could | |
do a "jc error_label". Fallthrough would be the success path and it'd |
View gist:859d97e2758e02015728f70f7cde15c3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.globl bar | |
.p2align 4, 0x90 | |
.type bar,@function | |
bar: | |
.cfi_startproc | |
cvttss2si %xmm0, %eax | |
cmpl $1, %eax | |
jo 0f | |
retq | |
0: |
View gist:c050d4f60633c49ae6e54a3d45385031
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stddef.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
bool is_valid_utf8(const uint8_t *str, size_t len) | |
{ | |
size_t bytes_seen = 0; | |
size_t bytes_needed = 0; | |
uint8_t lower_boundary = 0x80; | |
uint8_t upper_boundary = 0xbf; |
View gist:78c6a752d60ee84410e9f8fbeb0d0291
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's some C code: | |
void extern_func(int *, int*, int*, int*); | |
static int static_var = 3; | |
int global_var = 4; | |
extern int extern_var; | |
__attribute__((noinline)) | |
static void static_func(void) |
View gist:9234939
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STACKTOP = STACKTOP + 8 | 0; | |
$nHeight$i9409 = STACKTOP; | |
STACKTOP = STACKTOP + 8 | 0; | |
$nHeight$i9363 = STACKTOP; | |
STACKTOP = STACKTOP + 8 | 0; | |
$nHeight$i9316 = STACKTOP; | |
STACKTOP = STACKTOP + 8 | 0; | |
$nHeight$i9091 = STACKTOP; | |
STACKTOP = STACKTOP + 8 | 0; | |
$nHeight$i9044 = STACKTOP; |