~ori

Recent activity

Re: [PATCH] Add module-level inline assembly 2 days ago

From to ~mpu/qbe

Quoth John Nunley <dev@notgull.net>:
> > I don't believe C needs it for anything.
> 
> C needs it for the top-level "asm" macro, right?
> 
> I guess you can push it into a ".S" file and compile that into the
> executable, but that seems kind of hacky.

C doesn't have a top level asm macro; there are some
compilers that have extensions for it, but not all
implementations have it, and the implementations are
not all compatible. They also have different levels
of integration with the register allocator.

Re: [PATCH] Add module-level inline assembly 2 days ago

From to ~mpu/qbe

Quoth John Nunley <dev@notgull.net>:
> > i'm not sure this is all that helpful from hare's perspective
> 
> I believe it is impossible to implement certain constructs in C and Rust
> without this feature. This patch is mostly intended for them. If Hare
> doesn't use it, that's okay.
> 
> Also, I appear to have messed up the patch formatting. git send-email
> wasn't working for me, so I foolishly tried to just paste the patch into
> Thunderbird and send it on. Let me try again.
> 

I don't believe C needs it for anything.

Re: WebAssembly Support 2 days ago

From to ~mpu/qbe

Quoth John Nunley <dev@notgull.net>:
> Would WebAssembly support be desired for QBE? It would mean rewriting a
> lot of "emit.c" and others, since WebAssembly is not assembled via GAS
> or NASM but with WABT, which has an S-Expr-like format.

It would involve a lot more than that, since wasm doesn't allow
arbitrary control flow graphs.

Re: [PATCH] tests: add in hack to enable unit tests a month ago

From to ~min/agec

Apologies for the slow response.

So, yes, when running in ape/psh, ape should be bound into
/bin; if this was an rc script, it would not be bound in.

I've sent a new version of the patch with the commit adding
the mkfile squashed in.

Quoth Amin <amin@firemail.cc>:
> It doesn't work, complains about missing test/unit/mkfile. It seems
> you forgot to include some diffs. Can you provide them, please?
> 
> > +if [ $(uname) = Plan9 ]; then
> > +	tool=../6.agec

[PATCH] plan9: run tests on plan9 a month ago

From Ori Bernstein to ~min/agec

* add in just enough of a hacked sruner clone
 to enable unit tests to run
* add mkfile to run unit tests
---
diff 13faf69a4efb14cae2c44c239795bb76f658780c ba473a392f59567f90a8272a643b08ebe9a21d53
--- /dev/null
+++ b/plan9/check.h
@@ -1,0 +1,28 @@
+#define CK_ENV 0
+
+typedef unsigned long long size_t;
+
+#define ck_assert_uint_eq(a, b)	assert(a == b)

Re: Queries regarding structures/typedefs 4 months ago

From to ~mpu/qbe

Quoth Rosie <acquitefx@gmail.com>:
> Nevermind, this snippet:
> ```qbe
> export function w $main() {
> @start
>       %foo.addr =:Foo call $getFoo()
>       %foo.copy =:Foo copy %foo.addr
> 
>       %foo.a =w loadw %foo.copy
> 
>       call $printf(l $test, ..., w %foo.a)
>       ret 0
> }
> ```

[PATCH] tests: add in hack to enable unit tests 4 months ago

From Ori Bernstein to ~min/agec

---
diff 863c11267e9b1f3a63dcee5b4d29bfc539661648 c1a496112e665caa4389a878e0eeac94b012618a
--- /dev/null
+++ b/plan9/check.h
@@ -1,0 +1,28 @@
+#define CK_ENV 0
+
+typedef unsigned long long size_t;
+
+#define ck_assert_uint_eq(a, b)	assert(a == b)
+#define	ck_assert_int_eq(a, b)	assert(a == b)
+#define ck_assert_msg(a, ...)	assert(a)
+#define ck_assert 		assert
+#define ck_assert_mem_eq(a, b, n)\

[PATCH] binaries: use exitstatus() to correct exit status on plan 9 4 months ago

From Ori Bernstein to ~min/agec

when a program falls off the end of main, it exits with a failed
status; as a result, call exits() explicitly to fix
---
diff 76b9b28fd0dc8d402a10662c9bbe8339c45cce4d 863c11267e9b1f3a63dcee5b4d29bfc539661648
--- a/agec-keygen.c
+++ b/agec-keygen.c
@@ -117,7 +117,7 @@
 usage(void)
 {
 	fprintf(stderr, "usage: %s [-y]\n", argv0);
-	exitusage();
+	exitstatus("usage");
 }

[PATCH v2] mkfile: make slightly more idiomatic 4 months ago

From Ori Bernstein to ~min/agec

* install agec and agec-keygen as subcommands
  for auth/, so that it sits beside tools like
  auth/aescbc
* use the mkmany bits more effectively,
  with multiple TARGs and a list of OFILES;
  the linker is smart enough to only pull
  the ones that get used into the binaries.
* format more like the other mkfiles
---
diff e6fb7e1db780eb4a0c8e922daf9a28ea5fb89765 a869e21a6fcd486b3f7067eee8fc8943741536a9
--- a/mkfile
+++ b/mkfile
@@ -1,28 +1,49 @@

[PATCH] mkfile: make slightly more idiomatic 4 months ago

From Ori Bernstein to ~min/agec

* install agec and agec-keygen as subcommands
  for auth/, so that it sits beside tools like
  auth/aescbc
* use the mkmany bits more effectively,
  with multiple TARGs and a list of OFILES;
  the linker is smart enough to only pull
  the ones that get used into the binaries.
* format more like the other mkfiles
---
diff e6fb7e1db780eb4a0c8e922daf9a28ea5fb89765 a17bde304156a9cec42b10d4c05e88fdaa94b76f
--- a/mkfile
+++ b/mkfile
@@ -1,28 +1,45 @@