Override disjoint_or
in the LLVM backend
This commit is contained in:
parent
f23025305f
commit
4ee1602eab
6 changed files with 54 additions and 0 deletions
|
@ -225,6 +225,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
args[1].val.unaligned_volatile_store(bx, dst);
|
||||
return Ok(());
|
||||
}
|
||||
sym::disjoint_bitor => {
|
||||
let a = args[0].immediate();
|
||||
let b = args[1].immediate();
|
||||
bx.or_disjoint(a, b)
|
||||
}
|
||||
sym::exact_div => {
|
||||
let ty = arg_tys[0];
|
||||
match int_type_width_signed(ty, bx.tcx()) {
|
||||
|
|
|
@ -167,6 +167,11 @@ pub trait BuilderMethods<'a, 'tcx>:
|
|||
fn unchecked_umul(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
|
||||
fn and(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
|
||||
fn or(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
|
||||
/// Defaults to [`Self::or`], but guarantees `(lhs & rhs) == 0` so some backends
|
||||
/// can emit something more helpful for optimizations.
|
||||
fn or_disjoint(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value {
|
||||
self.or(lhs, rhs)
|
||||
}
|
||||
fn xor(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
|
||||
fn neg(&mut self, v: Self::Value) -> Self::Value;
|
||||
fn fneg(&mut self, v: Self::Value) -> Self::Value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue