/* Hi Postlude File */ /* first give the inline operators */ *(scalar x,scalar y->scalar)inline ' pop %rax imulq 0(%rsp),%rax movq %rax,0(%rsp) # *'; +(scalar x,scalar y->scalar)inline ' pop %rax addq %rax,0(%rsp) # +'; =(scalar x, scalar y->scalar) inline' pop %rax pop %rbx movq $0, %rcx cmp %rbx,%rax sete %al # = neg %rax push %rax'; <(scalar x, scalar y->scalar) inline'pop %rax pop %rbx mov $0,%rcx cmp %rbx,%rax setl %al #< neg %rax push %rax'; /* vector subscription operator */ #(vec1 v, scalar s->scalar)inline 'pop %rdi pop %rsi pushq 0(%rdi,%rsi,8)'; /* matrix subscription operator */ ##(vec2 v, scalar s->vec1)inline 'pop %rsi pop %rdi pushq 0(%rsi,%rdi,8)'; -(scalar x,scalar y->scalar)inline 'pop %rax subq 0(%rsp),%rax #- movq %rax,0(%rsp)'; ~(scalar x ->scalar)inline 'pop %rax not %rax #not push %rax '; /* an indirect call mechanism passed a pointer to a vector containing 1..n params n function it is assumed the operator is only used in callindirect */ --->(vec1 v->scalar)inline' pop %rsi # get pointer to vec mov 8(%rsi),%r10 # get address of proc from vec for later call movq 0(%rsi),%rcx # get length of vec dec %rcx # adjust for the pointer to the proc which we ignore imul $8,%rcx # convert in bytes lea 16(%rsi),%rsi # set source to 2nd word in the vector # now load the params into the registers as # demanded by the Opteron ABI this will only work up to a certain number of registers mov 0(%rsi),%rdi mov 16(%rsi),%rdx mov 24(%rsi),%rcx mov 32(%rsi),%r8 mov 40(%rsi),%r9 mov 8(%rsi),%rsi call * %r10 # call the function that was in the parameter vectpr lea -8(%rbp),%rsp# drop params mov %rax, 0(%rsp)'; /* now give derived operators */ >(scalar x,scalar y->scalar)yscalar)0-x; length(vec1 x->scalar)x#0; <=(scalar x,scalar y->scalar)~(y=(scalar x,scalar y->scalar)~(xvec1)vconcat(x,y); /* then give external functions */ putChar(scalar x->scalar)external ; vconcat(vec1 x,vec1 y->vec1)external; iota(scalar x->vec1)external; putNum(scalar x->scalar)external; getChar(->scalar)external; getNum(->scalar)external; /* derived functions */ callindirect(vec1 params->scalar)---> params;