blob: 7c4e3227396068c37cab02ae40d44f506b44c722 [file] [log] [blame] [edit]
#include <metal_stdlib>
using namespace metal;
int tint_unary_minus(const int v) {
return select(-v, v, v == -2147483648);
}
int4 tint_unary_minus_1(const int4 v) {
return select(-v, v, v == -2147483648);
}
int i(int x) {
return tint_unary_minus(x);
}
int4 vi(int4 x) {
return tint_unary_minus_1(x);
}