diff --git a/asm/qbe/qbe.go b/asm/qbe/qbe.go index 084df54..57696e1 100644 --- a/asm/qbe/qbe.go +++ b/asm/qbe/qbe.go @@ -102,6 +102,10 @@ func emitInstruction(w io.Writer, i ttir.Instruction) error { inst = "mul" case ast.Divide: inst = "div" + case ast.Equal: + inst = "ceql" + case ast.NotEqual: + inst = "cnel" case ast.GreaterThan: inst = "csgtl" case ast.GreaterThanEqual: diff --git a/asm/qbe/qbe_stub.asm b/asm/qbe/qbe_stub.asm index 02ff633..5c6277d 100644 --- a/asm/qbe/qbe_stub.asm +++ b/asm/qbe/qbe_stub.asm @@ -3,6 +3,8 @@ ; https://en.wikipedia.org/wiki/X86_calling_conventions#List_of_x86_calling_conventions format ELF64 +section ".text" executable + public syscall1 public syscall2 public syscall3 diff --git a/build/task.go b/build/task.go index 83d37f6..793df39 100644 --- a/build/task.go +++ b/build/task.go @@ -34,8 +34,8 @@ type processTask struct { func NewProcessTask(name string, args ...string) task { return &processTask{ - taskName: name, name: name, + taskName: fmt.Sprintf("starting %q %v\n", name, args), args: args, } } @@ -49,7 +49,6 @@ func (pt *processTask) Run(id int, output io.Writer, doneChan chan taskResult) { cmd.Stdout = utils.NewPrefixWriterString(output, pt.name+" output: ") cmd.Stderr = cmd.Stdout - io.WriteString(output, fmt.Sprintf("starting %q %v\n", pt.name, pt.args)) err := cmd.Run() var exitError error if cmd.ProcessState.ExitCode() != 0 { @@ -330,7 +329,7 @@ func runTasks(nodes map[int]*node, rootNodes []int, l *utils.Logger) error { for id, node := range nodes { if output[id] == nil { - l.Errorf("output of task %q is nil", nodes[id].task.Name()) + l.Warnf("output of task %q is nil", nodes[id].task.Name()) } else if output[id].Len() > 0 { l.Infof("task %q output: %s", node.task.Name(), output[id]) } diff --git a/test.tt b/test.tt index 04f1db5..7849cdf 100644 --- a/test.tt +++ b/test.tt @@ -1,3 +1,3 @@ fn main() = { - 3 + 5 == 3 };