2004-04-12 16:42:43 +00:00
|
|
|
; RUN: llvm-as < %s | llc -march=x86
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
declare int %llvm.readport (ushort)
|
|
|
|
declare void %llvm.writeport (int, ushort)
|
|
|
|
|
2004-04-13 17:18:07 +00:00
|
|
|
int %in(ushort %p) {
|
|
|
|
%i1 = call int %llvm.readport (ushort 255)
|
|
|
|
%i2 = call int %llvm.readport (ushort %p)
|
|
|
|
%r = add int %i1, %i2
|
|
|
|
ret int %r
|
2004-04-12 16:42:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-04-13 17:18:07 +00:00
|
|
|
void %out(ushort %p) {
|
2004-04-12 16:42:43 +00:00
|
|
|
call void(int, ushort)* %llvm.writeport (int 1, ushort 255)
|
2004-04-13 17:18:07 +00:00
|
|
|
call void(int, ushort)* %llvm.writeport (int 4, ushort %p)
|
|
|
|
ret void
|
2004-04-12 16:42:43 +00:00
|
|
|
}
|
|
|
|
|