-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gcc: add support for the
lt
and gt
comparison operators
Signed-off-by: Filip Kokosiński <filip.kokosinski@gmail.com>
- Loading branch information
1 parent
d9108b1
commit e1ed6df
Showing
6 changed files
with
61 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../common/common.mk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
static void putc(int); | ||
|
||
void _start(void) | ||
{ | ||
/* TODO: handle sp/fp init better -- separate crt0.S? */ | ||
asm ("law 03000"); | ||
asm ("dac 209"); | ||
asm ("law 04000"); | ||
asm ("dac 208"); | ||
|
||
int x = 30; | ||
int y = 30; | ||
|
||
/* test if `==` works */ | ||
if (x == y) | ||
putc(061); // a | ||
if (x != y) | ||
putc(062); // b | ||
|
||
/* test if `!=` works */ | ||
x = 21; | ||
y = 37; | ||
if (x != y) | ||
putc(063); // c | ||
if (x == y) | ||
putc(064); // d | ||
|
||
/* test if `<` works */ | ||
if (x < y) | ||
putc(065); // e | ||
y = 21; | ||
if (x < y) | ||
putc(066); // f | ||
|
||
/* test if `>` works */ | ||
x = 41; | ||
y = 37; | ||
if (x > y) | ||
putc(067); // g | ||
x = 37; | ||
if (x > y) | ||
putc(070); // h | ||
x = 21; | ||
if (x > y) | ||
putc(071); // i | ||
|
||
asm ("hlt"); | ||
__builtin_unreachable(); | ||
} | ||
|
||
static void putc(int c) { | ||
asm ("lio %0" : : "r"(c)); | ||
asm ("tyo"); | ||
} |
Submodule pdp1-binutils
updated
5 files
+2 −2 | bfd/dec-rim.c | |
+1 −0 | gas/config/tc-pdp1.c | |
+8 −7 | include/opcode/pdp1.h | |
+3 −2 | opcodes/pdp1-dis.c | |
+16 −7 | opcodes/pdp1-opc.c |
Submodule pdp1-gcc
updated
2 files
+18 −4 | gcc/config/pdp1/pdp1.md | |
+1 −1 | gcc/config/pdp1/predicates.md |
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