mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-30 15:32:52 +01:00
b8987d93b7
llvm-svn: 12892
22 lines
445 B
Plaintext
22 lines
445 B
Plaintext
; RUN: llvm-as < %s | llc -march=x86
|
|
|
|
implementation
|
|
|
|
declare int %llvm.readport (ushort)
|
|
declare void %llvm.writeport (int, ushort)
|
|
|
|
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
|
|
}
|
|
|
|
|
|
void %out(ushort %p) {
|
|
call void(int, ushort)* %llvm.writeport (int 1, ushort 255)
|
|
call void(int, ushort)* %llvm.writeport (int 4, ushort %p)
|
|
ret void
|
|
}
|
|
|