summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/builder.rs
diff options
context:
space:
mode:
authorlcnr/Bastian Kauschke <bastian_kauschke@hotmail.de>2019-06-03 12:59:17 +0200
committerlcnr/Bastian Kauschke <bastian_kauschke@hotmail.de>2019-06-03 12:59:17 +0200
commitd6266a7666c22b4a64bbc9252e4ad080f5950d01 (patch)
tree3c458e1cf8a848c5b965883b972b680d36744770 /src/librustc_codegen_llvm/builder.rs
parentd461555e443a07bc75564b8322dc461efe7cea7c (diff)
downloadrust-d6266a7666c22b4a64bbc9252e4ad080f5950d01.tar.gz
rust-d6266a7666c22b4a64bbc9252e4ad080f5950d01.zip
add support for unchecked math
Diffstat (limited to 'src/librustc_codegen_llvm/builder.rs')
-rw-r--r--src/librustc_codegen_llvm/builder.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/builder.rs b/src/librustc_codegen_llvm/builder.rs
index f37fd0cb833..102e9e38612 100644
--- a/src/librustc_codegen_llvm/builder.rs
+++ b/src/librustc_codegen_llvm/builder.rs
@@ -265,6 +265,12 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
         neg(x) => LLVMBuildNeg,
         fneg(x) => LLVMBuildFNeg,
         not(x) => LLVMBuildNot,
+        unchecked_sadd(x, y) => LLVMBuildNSWAdd,
+        unchecked_uadd(x, y) => LLVMBuildNUWAdd,
+        unchecked_ssub(x, y) => LLVMBuildNSWSub,
+        unchecked_usub(x, y) => LLVMBuildNUWSub,
+        unchecked_smul(x, y) => LLVMBuildNSWMul,
+        unchecked_umul(x, y) => LLVMBuildNUWMul,
     }
 
     fn fadd_fast(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {