summaryrefslogtreecommitdiff
path: root/3/6_control/20_op_bias.c
blob: b071eb9e96a632fae355bc5da79ff6d678741a25 (plain)
1
2
3
4
5
6
7
8
9
10
#define OP <

// x <- %rdi
// %rbx <- 15 + (x), bias to round towards zero
// ZF, SF <- %rdi & %rdi, check if pos or neg
// %rbx <- x if x >= 0, set to unbiased if pos
// %rbx <- %rbx >> 4, divide by 16
short arith(short x) {
    return x / 16;
}